• 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?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.
1
Posts
12
Years
  • Seen Aug 31, 2011
rom freezes

ok so i have a give pokemon script and it works on giving it but when i ask again it freezes. i have checkflag so it wont give it again. i dont want them to keep gettn that pokemon


emerald\\
person\\give pokemon



Spoiler:


can i suggest someone on youtube? he is awesome an your move script confuses me alot. he could do the same thing u got typed on but in 2 lines lol

google chrome. translate languages for you. as for xse idk
 
Last edited:
2
Posts
13
Years
  • Seen Aug 19, 2015
Every time I try and step on the script box, it gets to the point where it says the text, and then I can no longer move. Can anyone see something wrong with the script?
Code:
#org $script
jingle
checkflag 0x829
if 0x01 goto $done
message $you
$you 1 = You have a strange feeling you\n shouldn't leave.
boxset 6
applymovement 0xFF $walkdown
$walkdown 1 ; #binary 0x10
pausemove 0x0000
release
end

#org $done
setvar 0x6001 0x0002
release
end
 

hinkage

Everyone currently in an argument with this member
381
Posts
13
Years
  • Age 28
  • Seen yesterday
Every time I try and step on the script box, it gets to the point where it says the text, and then I can no longer move. Can anyone see something wrong with the script?
Code:
#org $script
jingle
checkflag 0x829
if 0x01 goto $done
message $you
$you 1 = You have a strange feeling you\n shouldn't leave.
boxset 6
applymovement 0xFF $walkdown
$walkdown 1 ; #binary 0x10
pausemove 0x0000
release
end

#org $done
setvar 0x6001 0x0002
release
end


It's simply because you forgot the 0xFE at the end of your movement data. Add that, and it should work perfectly.

Also, as a side note, you only need "pausemove 0x0" not "pausemove 0x0000". Same thing goes for the vars.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Yes one is hidden. Do I have to un-hide it?

You have two options: There are more than one "Hidden" listed as the behavior. You can change it to the one after the first one, and it should be okay. Keep in mind, though, that the sprite is still on the map and can still be bumped into and interacted with by the player. It's only invisible.

The second option, if using Fire Red, is to set the sprite to a normal behavior and place 2C as its ID #. This will hide any sprite on the map, and make it like it's not there, so it can't be interacted with or bumped into. As long as you don't clear flag 2C, all sprites set to this ID # will be hidden. This is the method I recommend if you want it to seem like the sprite isn't there at all until a certain event takes place.

The problem isn't with your script. Anytime a sprite's behavior is set to the first Hidden command, anytime you get near it the game resets.
 

shinyabsol1

Pokemon DarkJasper!?
333
Posts
13
Years
  • Seen Nov 23, 2022
Is it possible to make a script keep track of how much time has passed since a certain event occurred (using RTC)?

Like for a honey tree script...where you put honey on a tree, then have to wait a certain amount of time for a pokemon to appear...

Thanks.
 
52
Posts
12
Years
Can someone help me with this it is pokescript but it doesn't work..

Spoiler:


Here are pictures from advancemap:
Spoiler:
 
275
Posts
13
Years
  • Seen Oct 9, 2019
The second option, if using Fire Red, is to set the sprite to a normal behavior and place 2C as its ID # . . . As long as you don't clear flag 2C, all sprites set to this ID # will be hidden.
I feel the need to note that if they're trying to keep the original FireRed scripts intact, then using ID 2C will cause conflicts with Professor Oak's sprite in Pallet Town (3.0).

There is a very large range of flags (0x300 - 0x3FF) that I could not find in any of the game's default scripts. These flags could technically be used by the game engine itself, but if they're not, then one of them would work well for the asker.

Of course, if they're not planning on keeping FireRed's original scripts, then they can use almost any flag they want.
 

hinkage

Everyone currently in an argument with this member
381
Posts
13
Years
  • Age 28
  • Seen yesterday
I feel the need to note that if they're trying to keep the original FireRed scripts intact, then using ID 2C will cause conflicts with Professor Oak's sprite in Pallet Town (3.0).

There is a very large range of flags (0x300 - 0x3FF) that I could not find in any of the game's default scripts. These flags could technically be used by the game engine itself, but if they're not, then one of them would work well for the asker.

Of course, if they're not planning on keeping FireRed's original scripts, then they can use almost any flag they want.


OR if they want to use FireRed's original scripts, flags 0x1200+ are unused.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I feel the need to note that if they're trying to keep the original FireRed scripts intact, then using ID 2C will cause conflicts with Professor Oak's sprite in Pallet Town (3.0).

There is a very large range of flags (0x300 - 0x3FF) that I could not find in any of the game's default scripts. These flags could technically be used by the game engine itself, but if they're not, then one of them would work well for the asker.

Of course, if they're not planning on keeping FireRed's original scripts, then they can use almost any flag they want.

I don't think it matters regardless of if you keep the old scripts in place. I don't believe flag 2C is ever cleared in Fire Red and it (seems) to be set automatically from the start of the game. As long as you don't clear the flag in a future script, it can be recycled to hide any sprite on the map, and then just have the sprite appear with the showsprite command when an event requires it.

I don't think it matters if multiple sprites use the same flag. It only won't work if you want them to appear permanently on the map after a certain event, or to appear before an event and then be hidden afterwards. Then you'd have to use an unused flag. For one-shot events (like Oak stopping you from leaving Pallet, or whenever Gary appears to battle you) using 2C, from my experience, works without fail.
 
49
Posts
14
Years
  • Seen Sep 10, 2011
Hey guys, long time no see. I have a problem trying use the settrainerflag script.. Here it is, anything wrong with this?

Using:
A-Map
A-Trainer
XSE
Pokemon Fire Red

Spoiler:


Set the script to a script tile in A-Map with unknown 03 and Var number at 4050 with the talking level at "always".. I step on it on the next map, in the small building going on to route 2 (leaving varidian forest). When I step on it, it doesn't freeze or anything, just doesn't reset the trainers in the forest.

I even tried adding it in the header as an "entering map" script and that didn't work either.

Any suggestions? Please PM me so I don't have to look through all these posts. Thanks in advanced. :D
 
49
Posts
14
Years
  • Seen Sep 10, 2011
Really? The tutorial I read said that settrainerflag was it.. Ok, I'll try that, thanks. I'll edit this post if it works.

EDIT:, ok, still didn't work.. Not sure what to do.. Anyone have an example that they know works?

Also, I noticed that A-Trainer already converts them into hex, and the "cleartrainerflag" and the "settrainerflag" don't work.. Maybe I'm missing stuff?

new compiled script:

'---------------
#org 0x751695
cleartrainerflag 0x66
cleartrainerflag 0x67
cleartrainerflag 0x68
cleartrainerflag 0x213
cleartrainerflag 0x214
end
 
Last edited:

colcolstyles

Yours truly
1,588
Posts
15
Years
Sorry, I got confused. "settrainerflag" will make a trainer battle-able again. I just tested it in Emerald and it worked fine. The problem either lies with the numbers or the configuration of the trigger script itself. For the numbers, just copy over the values in the "trainerbattle" command that you get when you decompile the person events' scripts. As for the trigger script, throw in a "msgbox" command to test if the script is activating properly.
 
49
Posts
14
Years
  • Seen Sep 10, 2011
Awesome idea, thank you. I tested it with this new code (compiled):

Spoiler:


I got no message.. So I guess its not reading.. I think it has something to do with the way I'm placin it as a script tile maybe..

Here are the settings for the script tile on A-map:
x/y pos (thats fine..)
Talking level: always. (maybe "height 2,normal?)
unknown: $03 (only 2 digits available, if it makes a difference.. saw it listed as $0003 in the tutorial I read, but I think the version of A-map I have is up to date.)
Var Number: $4050
Var value: $0000
unkown: $0000
Offset: (its correct..)

Also, JPANs Fire Red Hacked tools have been applied, but I didn't wipe the rom to start from scratch, just added some extra specials and such. (if that makes a difference.. probably not tho.)
 

Truality

Left for good
1,006
Posts
12
Years
  • Age 32
  • Seen May 17, 2013
Awesome idea, thank you. I tested it with this new code (compiled):

Spoiler:


I got no message.. So I guess its not reading.. I think it has something to do with the way I'm placin it as a script tile maybe..

Here are the settings for the script tile on A-map:
x/y pos (thats fine..)
Talking level: always. (maybe "height 2,normal?)
unknown: $03 (only 2 digits available, if it makes a difference.. saw it listed as $0003 in the tutorial I read, but I think the version of A-map I have is up to date.)
Var Number: $4050
Var value: $0000
unkown: $0000
Offset: (its correct..)

Also, JPANs Fire Red Hacked tools have been applied, but I didn't wipe the rom to start from scratch, just added some extra specials and such. (if that makes a difference.. probably not tho.)
Iirc you've put in the wrong 'unknown'. You see, there's another value as 'unknown' next to the 'var value'. That's the one you need to change. Also, a reminder: variables in tile scripts exist in a similar way to flags: you set the variables to 0x1 to activate them, and to 0x1 to deactivate them. (So either way if you don't want this script to repeat itself every time you step on it, add 'setvar 0x4050 0x1' before the 'release' in your script)
 
49
Posts
14
Years
  • Seen Sep 10, 2011
Ok, so that "unkown 0003" needs to be in the second unkown, not the first?

Well, I tried that and didn't work either..

its A-map version 1.95, if that helps.. Hmmm....

PS: I want it to repeat, thats fine.
 
275
Posts
13
Years
  • Seen Oct 9, 2019
Ok, so that "unkown 0003" needs to be in the second unkown, not the first?

Well, I tried that and didn't work either..

its A-map version 1.95, if that helps.. Hmmm....

PS: I want it to repeat, thats fine.
I think I may know what your problem is.

Do you see the "var value" field? The variable you chose has to be equal to that value for the script to run. So if you use variable 0x4050, value 0x0000, then the script tile will only activate if you step on it while variable 0x4050 has the value 0x0000.

So if something -- anything at all -- has assigned a different value to that variable, your script won't run.
 
49
Posts
14
Years
  • Seen Sep 10, 2011
I think I may know what your problem is.

Do you see the "var value" field? The variable you chose has to be equal to that value for the script to run. So if you use variable 0x4050, value 0x0000, then the script tile will only activate if you step on it while variable 0x4050 has the value 0x0000.

So if something -- anything at all -- has assigned a different value to that variable, your script won't run.

Ok, I think I get ya.. But what might I want to do to change it? I'm still in tutorial mode right now, lol, so according to what I've looked up, the var number I use for script tiles is 4050 I guess, or does that even matter, I pick a new one like, say, a new flag or offset?

Hmm.. I've been getting by for a while now by myself, kinda sucks I got stuck on this as it seemed to be an easy script to write. (compared to a "shiny rock", that generates random selected shiny pokemon. this rock is hidden and meant to be seeked out for "new, special" pokemon not normally available..) Maybe a new approach? I bet if I assigned the script to a sign or a person it would work, but I was hoping for a way to reset them on entrance instead.

EDIT: Oh wait, you mean like, make the Var value 0x0001 maybe so it continues? (like, "yes", do something?) or is it checking for a value that doesn't exist? I think I get that with a value of 0 nothing would happen.. Maybe with 0x0001 it will trigger only once, then end? I'm not sure what could be in that variable if its used, I haven't used it myself so I suppose its been used already? I'm not sure, I'm still kinda noob.. At least with variables.
 
Last edited:
Status
Not open for further replies.
Back
Top