• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.
Help fixing my Squirtle-giving script?

Game: Pokemon Fire red
Editor: XSE
Problem: Need help adding a squirtle Givepoke script to this and Fixing it.
Script:
Spoiler:

Screenshots and/or videos: N/A

NOTE: Whenever I try and test the script that I already have, Nothing happens and my player gets frozen in his current position. Anyone wnow why?
 
Hi, I got a litte problem with ALL my scripts... they dont work any more.
I hacked a German FireRed, and had done a bit, when I realized many things would be easier on a US FireRed. SO I switched, but now I freeze on EVERY script I made. Here's one of them:

What could be the problem? Do I have to change anything due to the ROM change?
Try redownloading XSE. Sometimes programs go wacky for no real reason, and the only way to solve those problems is to redownload the whole program again.
 
Game: Pokemon Fire red
Editor: XSE
Problem: Need help adding a squirtle Givepoke script to this and Fixing it.
Script:
Spoiler:

Screenshots and/or videos: N/A

NOTE: Whenever I try and test the script that I already have, Nothing happens and my player gets frozen in his current position. Anyone wnow why?

Try using this:

Code:
#dynamic 0x800000

#org @start
checkflag 0x14E
if 0x1 goto @skip
givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
msgbox @Squirtle 0x2
setflag 0x14E
release
end

#org @skip
msgbox @Letters 0x2
release
end

#org @Squirtle
= [PLAYER] found a Squirtle!

#org @Letters
= There's a few letter in her.\nNothing much, though.

What kind of event are you making this for (green script tile, sign etc)? If it is a green script tile then the cause for your freezing would most like be because you haven't set the variable number and value boxes correctly (but judging from how you've written this script I'd say you're using a signpost event).
 
What kind of event are you making this for (green script tile, sign etc)?

Yeah, It's a Signpost event to go on a mailbox. Thanks for the script help. Is that written in a different script language or do the @'s not make a difference?

EDIT: I have a new problem - Possibly unrelated to the previous one. I used the suggestion you posted but when I closed XSE and opened the script again it had gone back to my non-working one? Any idea why? Thanks :)
 
Last edited:
Yeah, It's a Signpost event to go on a mailbox. Thanks for the script help. Is that written in a different script language or do the @'s not make a difference?

EDIT: I have a new problem - Possibly unrelated to the previous one. I used the suggestion you posted but when I closed XSE and opened the script again it had gone back to my non-working one? Any idea why? Thanks :)
Are you ABSOLUTELY sure that you compiled it?
 
Try redownloading XSE. Sometimes programs go wacky for no real reason, and the only way to solve those problems is to redownload the whole program again.

Hm, I redownloaded XSE, recompiled the script and put the new offset in A-Map, but it still freezes :/
Any other idea?

BTW, what exactly belongs in the edit-boxes above the offset of a script? Unknown, Var-Number and so on? I read different things everywhere.
Thanks, Reygok
 
Last edited:
Hm, I redownloaded XSE, recompiled the script and put the new offset in A-Map, but it still freezes :/
Any other idea?

BTW, what exactly belongs in the edit-boxes above the offset of a script? Unknown, Var-Number and so on? I read different things everywhere.
Thanks, Reygok

Alright, as for the script, are you using FSF to get the offset? 800000 should be fine, but I hope you're not using it for all your scripts.

The game usually uses flags that are under 1000. Not all of them, but most. These flags are used for various reasons, ranging from activating functions to actual flags for in-game events. One of the flags you set (i.e 100 or 200) might have a bugged or unused function at your point in the game. So I'd suggest using flags over 1000.

As for the data areas (Var Number ; Unknown ; Var Value ...), I can explain those I have time for, the others should be easy:
  • Var Number and Var Value: Alright. Ever level scripted? Well, when setting a Var Number(x) and a Var Value(y), you are basically telling the ROM that the script you've set to this event will only take place if Variable 'x' is set to value 'y'. However, certain functions are set to some variables, and others are used for default scripts. For some reason or another, variable 4051 in FireRed is the default variable used to activate Script Tiles. I don't know why others don't work, but still.
  • Unknown: As the title says, this is unknown. The only 'known' thing about it is that it has to be 0003(Or 0300 in certain ROMs), for the script tile to activate. This was only discovered via studying default scripts, and no one knows exactly what it is.

Hope this helped.
 
Thanks, after many tries they suddenly worked, all of them.
For the offsets, I always use 800000, I thought '#dynamic 0x800000' would automatically search for enough space after 800000? Isn't that the case?
If not, I don't want to search for a new offset for every single script, additionally I don't know how much space I need per script?

For the rest: thanks :)

EDIT: Strangely, SOME of my scripts only work if I give them the Var number 4051. If I let it on 0000 they freeze, but only when the flag they depend of isn't set. If I set that flag, the script is ignored, as it should be.

#dynamic 0x800000

#org @start
checkflag 0x102
if 0x0 goto @1
release
end

#org @1
lock
msgbox @msg1 0x6
applymovement 0xFF @go1
waitmovement 0x0
release
end

#org @msg1
= Hm, I should see [rival],\nhe certainly wants to know\lwhich Pokémon I got.

#org @go1
#raw 0x12
#raw 0xFE
 
Last edited:
Thanks, after many tries they suddenly worked, all of them.
For the offsets, I always use 800000, I thought '#dynamic 0x800000' would automatically search for enough space after 800000? Isn't that the case?
If not, I don't want to search for a new offset for every single script, additionally I don't know how much space I need per script?

For the rest: thanks :)

Sure!
To be honest, I've never tried using the same offset for more than one script, so I wouldn't know if it should work. Scripts are simply text, and thus do not require much space. You don't have to edit anything in FSF, the default settings should do it. Just hit 'find' and the 'copy'.

Despite whether or not XSE will automatically throw the script towards the following free space range, I advise against it. Better safe than sorry. Try testing your older scripts. If they work, then your theory is correct. If not, then you best use FSF.

However, try using it both ways. It's easy. Just keep it open in its own window, and just hit 'find', 'copy', then 'paste'. Easy, quick, and like I said, better safe than sorry :)
 
Until now, every script worked, but some of them, like I said in my last post (after I edited it, but that was already too late :P) some only work with Var-Number on 4051. That sucks, because I have a script right next to the entrance to a town, and when the towns name is displayed after entering the town, it disappears immediately if you walk over the script. If I set the Var Number to 0000, this does not happen, BUT as I said before, in this case the game freezes as long as the flag 0x102 is not set yet.
 
Until now, every script worked, but some of them, like I said in my last post (after I edited it, but that was already too late :P) some only work with Var-Number on 4051. That sucks, because I have a script right next to the entrance to a town, and when the towns name is displayed after entering the town, it disappears immediately if you walk over the script. If I set the Var Number to 0000, this does not happen, BUT as I said before, in this case the game freezes as long as the flag 0x102 is not set yet.
You couldn't have possibly tried ALL the vars. Maybe you tried the wrong ones, by some sort of twisted luck.

Maybe you could tell us the general range of the variables you're using?
 
I never said I tried all of them, but considering what Pedro12 said, the varnumber only has to be changed if I want it to activate after a certain var has been set to a certain value, determined by what i enter in the Var value box.
Because I dis not need that, I thought i could leave them all on 0000.
The reason I set those which did not work on 4051 is, that in one of the first tutorials I read, the guy said the var number HAD to be on 4051...
Thats why I tool that one. but WHY cant i just leave it on 0000?
 
Thats why I tool that one. but WHY cant i just leave it on 0000?
Because it would result in a glitch, is that acceptable answer?
 
Okay, I took 5000, that's working. Now I've got the same problem as mentioned already:
I have a script one step away from the entrance to a town, so hwne I now walk from the route into the town, the towns name appears. But as I make two steps forward, I walk over the script. At that moment, the towns name just didappears immediately, instead of remaining there for a few seconds. Why is this and how can I fix it?
 
Last edited:
Can anyone explain why this snippet of my XSE script won't work?

...
addvar 0x10AA 0x1
copyvar 0x10AA 0x800D
compare 0x800D 0x3
if 0x1 call @2
...

I'm trying to make [compare] send the script to @2 when the variable 0x10AA reaches 3 (adding 1 in this script and 2 in another beforehand) however nothing happens - I'm not sure if its the adding which isn't working or my method of comparing the value :S.
 
SwiftSign said:
Can anyone explain why this snippet of my XSE script won't work?

You should use a different variable. I'm not sure if 0x10AA even is a variable, and if it is, it's probably not safe. Try something more in the 0x4000 range.
 
You should use a different variable. I'm not sure if 0x10AA even is a variable, and if it is, it's probably not safe. Try something more in the 0x4000 range.

I had forgotten there are safer ranges ;_; silly me. That aside changing the variable to 0x4000 doesn't seem to help.
 
Can anyone explain why this snippet of my XSE script won't work?

...
addvar 0x10AA 0x1
copyvar 0x10AA 0x800D
compare 0x800D 0x3
if 0x1 call @2
...

I'm trying to make [compare] send the script to @2 when the variable 0x10AA reaches 3 (adding 1 in this script and 2 in another beforehand) however nothing happens - I'm not sure if its the adding which isn't working or my method of comparing the value :S.

The copyvar command is being used incorrectly, when you don't even need to use it at all. The first variable you put in copyvar is the destination while the second is the source (i.e the first variable copies the value of the second variable). In your script, variable 0x10AA will be taking on the value of 0x800D rather than the other way around, which is why the script will never work in the way you want it to. In addition, you don't need to copyvar 0x10AA to 0x800D at all, as the 'compare' command doesn't discriminate based on the variable used. Just use this:

Code:
...
addvar 0x10AA 0x1
compare 0x10AA 0x3
if 0x1 call @2
...
 
The copyvar command is being used incorrectly, when you don't even need to use it at all. The first variable you put in copyvar is the destination while the second is the source (i.e the first variable copies the value of the second variable). In your script, variable 0x10AA will be taking on the value of 0x800D rather than the other way around, which is why the script will never work in the way you want it to. In addition, you don't need to copyvar 0x10AA to 0x800D at all, as the 'compare' command doesn't discriminate based on the variable used. Just use this:

Code:
...
addvar 0x10AA 0x1
compare 0x10AA 0x3
if 0x1 call @2
...

Thank you! Fixed my problem.

I did start at what you gave me, however it didn't work >< but now I'm using 0x4000 it works fine :s

Thank you again, back to re-re-relearning to script.
 
Status
Not open for further replies.
Back
Top