The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Script help (https://www.pokecommunity.com/showthread.php?t=359321)

Marugi December 3rd, 2015 12:01 PM

Script help
 
Hi everyone,
I'm having a problem with this script that hides 2 sprites (people id numbers 3 and 4). When you step on the script after getting a pokemon, these sprites should disappear (They are in the same map, but not visible when you are standing on the script event), but when I try, they don't. Here's my script:
Spoiler:
#dynamic 0x72AE6A

#org @main
checkflag 0x828
compare LASTRESULT 0x1
if 0x0 goto @nopoke
compare LASTRESULT 0x1
if 0x1 goto @poke
end

#org @nopoke
lock
release
end

#org @poke
hidesprite 0x3
setflag 0x12C
hidesprite 0x4
setflag 0x12D
end


What am I doing wrong?
Thanks,
Marugi

Marugi December 11th, 2015 10:50 AM

Anyone?

C me December 11th, 2015 12:21 PM

Quote:

Originally Posted by Marugi (Post 9030658)
Anyone?

You don't need the compare lastresults. After the check just have 'if 0x1 goto @poke' then 'end'.

You say 'when you step on a script' so it's a script tile right. You will need a setvar before the ends or it won't work.

I suggest you read more on scripting, knowledge is your friend. Try this tutorial.

Marugi December 14th, 2015 8:34 AM

Thanks for the help. I've been using this tutorial for a while now, and I noticed he doesn't really explain some things. I'll keep looking though.

esperance December 14th, 2015 12:18 PM

So first I'll rewrite the script a bit so that it is more efficient.

Code:

#dynamic 0x72AE6A

#org @main
checkflag 0x828
if 0x1 goto @poke
end

#org @poke
hidesprite 0x3
setflag 0x12C
hidesprite 0x4
setflag 0x12D
end


You seem to have misunderstood the "checkflag" command. When you use it, the result is not stored in LASTRESULT, but rather immediately ready for an if statement. This is likely why your script was not working in the first place.


All times are GMT -8. The time now is 2:24 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.