![]() |
My event keeps re-triggering after I Save&Quit
Hi everybody!
I'm currently working on my own little Emerald Hack and I ran into a problem with my first attempt at a scripted event. The event is supposed to trigger when you take your first step off the dock in Dewford Town and has Noland walk up to the player, talk and walk offscreen. When stepping onto the trigger it works like a charm, but when I save the game, restart and walk over the script again part of the script triggers again (essentially the message boxes, because I suppose the hidesprite flag did apply correctly). My best guess is that the var I set is used somewhere else. Sadly I can't find a list on which vars are safe. Every Input is appreciated! SCRIPT from XSE '--------------- #org 0x86A139 lock applymovement 0x6 0x886A188 waitmovement 0x0 msgbox 0x89C0FBA MSG_NORMAL '"[darkgrey_em]Well, hello young TRA..." applymovement 0x6 0x89C12C5 waitmovement 0x0 msgbox 0x89C114B MSG_NORMAL '"[darkgrey_em]...\p[red_em]SHE[dark..." applymovement 0x6 0x89C12CA waitmovement 0x0 msgbox 0x89C1250 MSG_NORMAL '"[darkgrey_em]Well, thank you very ..." applymovement 0x6 0x89C12CF waitmovement 0x0 hidesprite 0x6 setflag 0x22 setvar 0x8003 0x1 release end '--------- ' Strings '--------- #org 0x9C0FBA = [darkgrey_em]Well, hello young TRAINER!\nDid you happen to see a dark haired\l[red_em]LADY [darkgrey_em]around here?\pYou see, we-\p...\pOh, pardon me. I think I forgot to\nintroduce myself.\pMy name is NOLAND and\nI'm the head of the Battle Factory\ldown at the Battle Frontier.\pMy colleagues and I heard\nrumours about certain legendary\lPOKèMON coming to roost here\lon mainland HOENN.\pBut somehow my [red_em]PARTNER[darkgrey_em] and I\nwere split. #org 0x9C114B = [darkgrey_em]...\p[red_em]SHE[darkgrey_em] might have headed to\nSLATEPORT if I think about it... #org 0x9C1250 = [darkgrey_em]Well, thank you very much\nyoung TRAINER. I'll be off then.\pMaybe we will see each other\nsometime in the future. '----------- ' Movements '----------- #org 0x86A188 #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0x14 'Delay5 #raw 0x2 'Face Left #raw 0x14 'Delay5 #raw 0x3 'Face Right #raw 0x14 'Delay5 #raw 0x56 'Exclamation Mark (!) #raw 0x14 'Delay5 #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xFE 'End of Movements #org 0x9C12C5 #raw 0x14 'Delay5 #raw 0x2 'Face Left #raw 0x14 'Delay5 #raw 0xFE 'End of Movements #org 0x9C12CA #raw 0x14 'Delay5 #raw 0x3 'Face Right #raw 0x14 'Delay5 #raw 0xFE 'End of Movements #org 0x9C12CF #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xFE 'End of Movements |
Vars 8001-800f aren't safe. They are often used as parameters in functions. I'm assuming they reset whenever the game does. Here is a list of vars from the decomp:
Code:
|
Mainly vars in the 0x8000 range are used as parameters or to return values from commands, so they're not best to use for your triggers and level scripts. 0x4034-0x40FF are generally safe! Here's a link to a detailed list of vars :)
|
@Mkol103 @Avara
Thanks guys! @Mkol103 Alright. I'll try and keep to the "state of [town_name]" vars. The one for Dewford works perfectly fine and solved my problem :) @Avara Thanks for the link! The list certainly helps a lot :) |
| All times are GMT -8. The time now is 9:18 AM. |
![]()
© 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.