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)
-   -   Script Need Help With Script (https://www.pokecommunity.com/showthread.php?t=384038)

DubTheNarwhals November 25th, 2016 4:55 PM

Need Help With Script
 
This Script I Worked For Choosing Your Starter. When You Choose Your Pokemon The Game As Far As I Can See, It Freezes. Its A Person Event & Can Someone Fix It?

Heres The Script:
#dynamic 0x80000
#org @start
lock
faceplayer
checkflag 0x201
compare LASTRESULT 0x1
if 0x1 goto @arh
msgbox @t1 0x5
compare LASTRESULT 0x1
if 0x1 goto @t2
msgbox @t5 0x6
release
end

#org @t5
= Thats To Bad.

#org @arh
msgbox @arh2 0x6
release
end

#org @arh2
= [black_fr]Pokemon Freak:You All Ready/nGot A Pokemon [player]!

#org @t1
= [black_fr]Pokemon Freak:Do You Want A\nPokemon, [red_fr][player][grey_fr]?

#org @t2
msgbox @t2-1 0x5
compare LASTRESULT 0x1
if 0x1 goto @t2y
msgbox @t3 0x5
compare LASTRESULT 0x1
if 0x1 @t3y
msgbox @t4 0x5
compare LASTRESULT 0x1
if 0x1 @t4y
msgbox @t5 0x6
release
end

#org @t2-1
= [black_fr]Pokemon Freak:Do You Want Azurill?

#org @t3
= [black_fr]Pokemon Freak:Do You Want Hoppip?

#org @t4
= [black_fr]Pokemon Freak:Do You Want Magby?

#org @t2y
givepokemon 0x350 0x5 0x139 0x0 0x0 0x0
setflag 201
release
end

#org @t3y
givepokemon 0x187 0x5 0x139 0x0 0x0 0x0
setflag 201
release
end

#org @t4y
givepokemon 0x240 0x5 0x139 0x0 0x0 0x0
setflag 0x201
release
end

mbcn10ww November 25th, 2016 5:34 PM

Quote:

Originally Posted by DubTheNarwhals (Post 9498363)
This Script I Worked For Choosing Your Starter. When You Choose Your Pokemon The Game As Far As I Can See, It Freezes. Its A Person Event & Can Someone Fix It?

Heres The Script:
Spoiler:
#dynamic 0x80000
#org @start
lock
faceplayer
checkflag 0x201
compare LASTRESULT 0x1
if 0x1 goto @arh
msgbox @t1 0x5
compare LASTRESULT 0x1
if 0x1 goto @t2
msgbox @t5 0x6
release
end

#org @t5
= Thats To Bad.

#org @arh
msgbox @arh2 0x6
release
end

#org @arh2
= [black_fr]Pokemon Freak:You All Ready/nGot A Pokemon [player]!

#org @t1
= [black_fr]Pokemon Freak:Do You Want A\nPokemon, [red_fr][player][grey_fr]?

#org @t2
msgbox @t2-1 0x5
compare LASTRESULT 0x1
if 0x1 goto @t2y
msgbox @t3 0x5
compare LASTRESULT 0x1
if 0x1 @t3y
msgbox @t4 0x5
compare LASTRESULT 0x1
if 0x1 @t4y
msgbox @t5 0x6
release
end

#org @t2-1
= [black_fr]Pokemon Freak:Do You Want Azurill?

#org @t3
= [black_fr]Pokemon Freak:Do You Want Hoppip?

#org @t4
= [black_fr]Pokemon Freak:Do You Want Magby?

#org @t2y
givepokemon 0x350 0x5 0x139 0x0 0x0 0x0
setflag 201
release
end

#org @t3y
givepokemon 0x187 0x5 0x139 0x0 0x0 0x0
setflag 201
release
end

#org @t4y
givepokemon 0x240 0x5 0x139 0x0 0x0 0x0
setflag 0x201
release
end

Well, you don't need "compare" for flags, and you've placed 2 adresses with the same condition, use it as your @start:

lock
faceplayer
checkflag 0x201
if 0x1 goto @arh (enabled flag)
(disabled flag)
...
...
...

DubTheNarwhals November 25th, 2016 5:53 PM

Thanks, I'm Still New To Scripting

DubTheNarwhals November 25th, 2016 6:08 PM

It Still Freezes When You Choose A Pokemon, How Do I Fix It?

mbcn10ww November 25th, 2016 7:48 PM

Quote:

Originally Posted by DubTheNarwhals (Post 9498405)
It Still Freezes When You Choose A Pokemon, How Do I Fix It?

Well, I was looking at your script, and it needs a new multichoice box, but it's not my area. =\
Then you can take a look at this tutorial.

Oracolo November 26th, 2016 4:41 AM

I'm no scripting God myself, but just a two things which seem out of place to me:

- In @t2y and @t3y you've set the flags as 201, in @t4y you've used 0x201. Should all be 0x201, if I'm correct (as your checkflag also points to 0x201).
- I'm not quite sure if @t2-1 is a valid name, really. Wouldn't it be easier for yourself if you just named those sequences differently, as you've already used an @t1 and @t2 before.

Hope this fixes it.

DubTheNarwhals November 26th, 2016 9:21 AM

Thanks!


All times are GMT -8. The time now is 9:18 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.