• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

thetripplenine

tripple.
98
Posts
11
Years
Looking at it now, you don't have wait fanfare and stuff. Though I can tell you right now, you're doing things that are a little too hard for your level right now. Try to do something simpler and build on it. Master applymovement and flags :)


Ehhhh level shmevel, I just want to try becoming more advanced and i do look at other scripting tutorials
 

Blah

Free supporter
1,924
Posts
11
Years
I'm trying to use setmaptile but it refreshes back as fast as I move :/
Is there something else I should be doing?

Ehhhh level shmevel, I just want to try becoming more advanced and i do look at other scripting tutorials

Spoiler:
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
I'm trying to use setmaptile but it refreshes back as fast as I move :/
Is there something else I should be doing?

You need to use the command 'special 0x8E' after the setting the tile. This updates the map and retains all of your changes.
 

thetripplenine

tripple.
98
Posts
11
Years
Spoiler:


LOL,
ok btw i updated it, but now it just freezes, fun...

Spoiler:
 

Blah

Free supporter
1,924
Posts
11
Years
LOL,
ok btw i updated it, but now it just freezes, fun...

Spoiler:

Don't use warp command to move people, it's meant to warp the player. Remove warp commands. Use disappear and flag setting to create the illusion she warped back. Also after fanfare you need waitfanfare, and is this right syntax : giveitem 0xD 0x5 MSG_OBTAIN ? I don't know not a very XSE kinda guy. Compile your script after those changes.

EDIT: I just noticed you're trying to script door animations and stuff inside the movement block. You can't do that you can only have your #raw movements in those. Everthing else for you goes in the main block of code.
 

thetripplenine

tripple.
98
Posts
11
Years
Don't use warp command to move people, it's meant to warp the player. Remove warp commands. Use disappear and flag setting to create the illusion he warped back. Also after fanfare you need waitfanfare, and is this right syntax : giveitem 0xD 0x5 MSG_OBTAIN ? I don't know not a very XSE kinda guy.


OH WARP IS FOR THE PLAYER I thought it could be for anyone...
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Don't use warp command to move people, it's meant to warp the player. Remove warp commands. Use disappear and flag setting to create the illusion she warped back. Also after fanfare you need waitfanfare, and is this right syntax : giveitem 0xD 0x5 MSG_OBTAIN ? I don't know not a very XSE kinda guy. Compile your script after those changes.

EDIT: I just noticed you're trying to script door animations and stuff inside the movement block. You can't do that you can only have your #raw movements in those. Everthing else for you goes in the main block of code.


The new XSE should tell the nesesary parameters as you type. Honestly, my favorite feature. I got tired of searching through the command database everytime I needed to know how many fillers a command had..:)
 

thetripplenine

tripple.
98
Posts
11
Years
Well I'm trying to make the mom walk through the door and go to a different map so i thought I had to use the warp command...

Here's my better script I think

Spoiler:
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Well I'm trying to make the mom walk through the door and go to a different map so i thought I had to use the warp command...

Here's my better script I think

Spoiler:

When you're using an applymovement command your pointer should only be comprised of #raws unlike what you have in your @move sections of the script. Don't place other commands such as hidesprite or setdooropen in those sections as they will be interpreted differently by the ROM when compiled. Also, you haven't fully closed off your script at the end of your @take pointer.

I'm not trying to offend you but honestly, the whole script is a pretty big mess of jumbled commands and I don't think you have really learned the basics of what each command does or how it should be used. While you said that you want to become advanced and move on to bigger scripts, you're not at that point yet. Just slow down, try to get the grasp of individual commands, work on basic scripts in a practicing ROM and keep re-reading the tutorials available (particularly diegoisawesome's one if you're using XSE). Once again, I'm not trying to be mean/ a downer but from what I can see you're biting off more than you can chew at this point.
 

thetripplenine

tripple.
98
Posts
11
Years
When you're using an applymovement command your pointer should only be comprised of #raws unlike what you have in your @move sections of the script. Don't place other commands such as hidesprite or setdooropen in those sections as they will be interpreted differently by the ROM when compiled. Also, you haven't fully closed off your script at the end of your @take pointer.

I'm not trying to offend you but honestly, the whole script is a pretty big mess of jumbled commands and I don't think you have really learned the basics of what each command does or how it should be used. While you said that you want to become advanced and move on to bigger scripts, you're not at that point yet. Just slow down, try to get the grasp of individual commands, work on basic scripts in a practicing ROM and keep re-reading the tutorials available (particularly diegoisawesome's one if you're using XSE). Once again, I'm not trying to be mean/ a downer but from what I can see you're biting off more than you can chew at this point.

Well I stopped trying to do the advanced part,
now all i need help on is getting 5 pokeballs, 5 potions, and the running shoes after the movement, everything else is fine....

Here's my new script:
Spoiler:
 

tajaros

Hi I'm dawg
855
Posts
12
Years
Well I stopped trying to do the advanced part,
now all i need help on is getting 5 pokeballs, 5 potions, and the running shoes after the movement, everything else is fine....

Here's my new script:
Spoiler:

Ok, so here are your problems on your script why have if 0x1 in the pointer that goes to @take you don't need that you just put goto @take in there.

And for your fanfares remove the fadedefault there that is used for music not for fanfares instead put a waitfanfare after your msgbox.

And remove the release at the end of your script since you didn't put a lock code in your script.
 

.parado✗

paranormal user
38
Posts
11
Years
Hey guys!
How can I compare, if i defeated or lost at the last trainer battled?

with trainerbattle 0x9 0x0 0x3 @win @loose i can just pop up messageboxes but
i cant write code..
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
Hey guys!
How can I compare, if i defeated or lost at the last trainer battled?

with trainerbattle 0x9 0x0 0x3 @win @loose i can just pop up messageboxes but
i cant write code..
Trace the routine defined for making the blackout to occur. That way, you'll find out which byte value is changed determining whether you win or lost the match. Of course it doesn't have to work like this, but it does in G/S/C and the same developers made FRLG and RSE so it likely does.

This ram address (where the byte is) is possibly called later on to check whether or not the match was won. Call a subroutine, at this point, for making this byte value being set to "battle won" even if you lost the battle against this certain opponent (whom I believe you're planning to use this routine with).

That's all I can say about it really...

Spoiler:
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Hey guys!
How can I compare, if i defeated or lost at the last trainer battled?

with trainerbattle 0x9 0x0 0x3 @win @loose i can just pop up messageboxes but
i cant write code..

You can figure out whether you won or lost a battle by using the command 'special2 0xYYYY 0xB4', where 0xYYYY is a variable which you can read the result from later. Special 0xB4 works by storing a value to the variable indicating what the result of the battle was. If the value is equal to 0x1 then the enemy was defeated, if it is 0x4 then the enemy ran away and if it is 0x7 then they were captured. While most of the results are for wild Pokemon, if you compare the variable to 0x1 after a trainer battle then it works in much the same way.

Here's an example of it in use:

Code:
#dynamic 0x800000

#org @start
trainerbattle 0x9 0x1 0x3 @Victory @Defeat
special2 0x800D 0xB4
compare 0x800D 0x1
if 0x1 goto @Beaten
msgbox @Winner 0x2
release
end

#org @Beaten
msgbox @Loser 0x2
release
end

#org @Victory
= I'm the best!

#org @After
= Disappointing.

#org @Winner
= I won!

#org @Loser
= I lost...
 
241
Posts
11
Years
I have a script acting strangely...its a modified version of Oak giving you a starter in FR. I'll highlight what I've changed.

Spoiler:
They all continue to this script:

Spoiler:
When I only insert the script into the first pokeball and not the others, it always returns a nidoran male. And if you talk to a different pokeball before the first one, the game glitches up and restarts.

If I insert the scripts to all three, the first still shows a nidoran male and the second two always glitch, no matter what order you talk to them in.

If I remove the bufferpokemon from the continue script and message scripts, the first ball returns nidoran male and the second two don't seem to have a value, as the picture is a question mark and the game freezes when you accept the (non)pokemon.
 
50
Posts
11
Years
  • Seen Jan 4, 2021
Hey, quick question. I am trying to make an applymovement script, but this isn't the applymovement after you talk to a sprite. It is a "level script" I believe it's called. Anyways, every time I step on the tile where the script is, the ROM just freezes. I know it doesn't have anything to do with the script because it works fine if I apply it directly to a sprite. Does this have anything to do with SetVar? I hope I'm not being to vague and hope someone can help me out as soon as possible. Thanks!
 

Blah

Free supporter
1,924
Posts
11
Years
Hey, quick question. I am trying to make an applymovement script, but this isn't the applymovement after you talk to a sprite. It is a "level script" I believe it's called. Anyways, every time I step on the tile where the script is, the ROM just freezes. I know it doesn't have anything to do with the script because it works fine if I apply it directly to a sprite. Does this have anything to do with SetVar? I hope I'm not being to vague and hope someone can help me out as soon as possible. Thanks!

That's not a level script, I think you're talking about the green script tile in advance map. Open A-map and change:

Var number: 5240
Unknown: 03 00
 
154
Posts
11
Years
  • Seen Jan 8, 2017
That's not a level script, I think you're talking about the green script tile in advance map. Open A-map and change:

Var number: 5240
Unknown: 03 00
hey, FBI agent, why do you say change it to 5240? Just wondering cause i put mine at 4050, is 5240 better or something? o-o
 

Blah

Free supporter
1,924
Posts
11
Years
I have a script acting strangely...its a modified version of Oak giving you a starter in FR. I'll highlight what I've changed.

Spoiler:
They all continue to this script:

Spoiler:
When I only insert the script into the first pokeball and not the others, it always returns a nidoran male. And if you talk to a different pokeball before the first one, the game glitches up and restarts.

If I insert the scripts to all three, the first still shows a nidoran male and the second two always glitch, no matter what order you talk to them in.

If I remove the bufferpokemon from the continue script and message scripts, the first ball returns nidoran male and the second two don't seem to have a value, as the picture is a question mark and the game freezes when you accept the (non)pokemon.

Problem #1:
#dynamic 0x800000
#org @begin1
lock
faceplayer
setvar 0x4001 0x0
checkflag 0x900
if 0x0 call @startersel1
copyvar 0x4002 0x9000
setvar 0x4003 0x4
setvar 0x4004 0x7
compare 0x4055 0x3
if 0x4 goto 0x8169DE4
compare 0x4055 0x2
if 0x1 goto @continue
msgbox 0x818EA19 MSG_KEEPOPEN
release
end

#org @startersel1
random 0x3
copyvar 0x8008 LASTRESULT
compare 0x8008 0x0
if 0x1 call @bulbasaur
compare 0x8008 0x1
if 0x1 call @chikorita
compare 0x8008 0x2
if 0x1 call @treeko
setflag 0x900
return

You are setting the flag at a subroutine that's executed only if the flag is set. This the subroutine is never executed and whatever value is in variable 0x9002 is being displayed @continue instead. My hunch is 0x9002 holds nidoran male's number.

Ball #2 and Ball #3 have the same problem ^^

hey, FBI agent, why do you say change it to 5240? Just wondering cause i put mine at 4050, is 5240 better or something? o-o

If 4050 works, use 4050 ;D
5240 works for me everytime because 5240 is never used. If you set variable 0x5240 to something other than 0 somewhere it'll stop working (same with 4050). I'm not sure if 4050 is used anywhere, but should be safe I think. Theoretically unimportant temporary variables are probably ideal.
 
Last edited:

thetripplenine

tripple.
98
Posts
11
Years
Ok, so here are your problems on your script why have if 0x1 in the pointer that goes to @take you don't need that you just put goto @take in there.

And for your fanfares remove the fadedefault there that is used for music not for fanfares instead put a waitfanfare after your msgbox.

And remove the release at the end of your script since you didn't put a lock code in your script.

I got some problems, so when the mom talks to the player i want the player to face the mom, I do not receive the running shoes from her either and it says Received pokeballs in not what i want it to say like it says it twice once in light green and the other regular, it is the same with potions.

Edit:
Here's the new script

Spoiler:
 
Status
Not open for further replies.
Back
Top