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 Layered Trainer Script (https://www.pokecommunity.com/showthread.php?t=352384)

awipe1 July 17th, 2015 7:09 PM

Layered Trainer Script
 
Alright so I am working on a script for my game and I was wondering if someone would be able to help me. What I want is, when you run into a trainer, he will battle you. Pretty simple right? However the difficult part is getting his pokemon to change depending on how far you have progressed through the game. For example, if 0x4012 is set to 0x0, you will fight a weak pokemon. However, if 4012 is set to 0x1, you will fight something stronger. This is the script that I have.
Spoiler:

'---------------
#org 0x8084DA
lock
faceplayer
textcolor 0x0
compare 0x4012 0x0
if 0x1 goto 0x8808502
compare 0x4012 0x1
if 0x1 goto 0x880851B
compare 0x4012 0x2
if 0x1 goto 0x8808534
release
end

'---------------
#org 0x808502
trainerbattle 0x0 0x3 0x0 0x880854D 0x8808559
msgbox 0x8808565 MSG_NORMAL '"Talking 3"
release
end

'---------------
#org 0x80851B
trainerbattle 0x0 0x4 0x0 0x880854D 0x8808559
msgbox 0x8808565 MSG_NORMAL '"Talking 3"
release
end

'---------------
#org 0x808534
trainerbattle 0x0 0x5 0x0 0x880854D 0x8808559
msgbox 0x8808565 MSG_NORMAL '"Talking 3"
release
end


'---------
' Strings
'---------
#org 0x80854D
= Talking 1

#org 0x808559
= Talking 2

#org 0x808565
= Talking 3


See, I am doing this using JPANs hack applier. In order to make the JPANs hack applier option work, you need to set the 'Unknown' value to be anything but 00. So in this case mine is set to 01. The script works perfectly fine except for one thing. Once you finish the battle, you can talk to the trainer and everything is normal. However once you leave the map and come back the trainer spots you again, does the talking, but doesn't do the battle. I don't want that to happen. The trainer should NEVER spot you again. The trainer should just be standing there and will say "Talking 3" if you talk to him. Anyone know how to fix this issue? If you are still confused please let me know and I will explain in more detail.

Please only answer if you have a good understanding of JPANs hack applier. I feel like I am a pretty decent hacker and this error isn't something simple.

Joexv July 19th, 2015 1:11 PM

Thats because a normal trainer when beaten sets the trainer option as off basically. Where as Jpans engine will keep seeing you even though you have beaten him. What you may have to do is have a hidden sprite under the current one that only has the talking script and then a level script that will check your vars then hide/show the sprites according to if you need to battle or not. This should work, it may be a little odd, but it should work.

Touched July 19th, 2015 1:24 PM

Quote:

Originally Posted by joexv (Post 8852998)
Thats because a normal trainer when beaten sets the trainer option as off basically. Where as Jpans engine will keep seeing you even though you have beaten him. What you may have to do is have a hidden sprite under the current one that only has the talking script and then a level script that will check your vars then hide/show the sprites according to if you need to battle or not. This should work, it may be a little odd, but it should work.

Or edit JPAN's routine.

Joexv July 19th, 2015 1:33 PM

Quote:

Originally Posted by Touched (Post 8853008)
Or edit JPAN's routine.

Thats assuming he knows or wants to learn ASM.


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