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 Script Tile keeps activating randomly (https://www.pokecommunity.com/showthread.php?t=446050)

AJaxs March 4th, 2021 5:40 AM

Script Tile keeps activating randomly
 
Hello guys and girls.
My Problem is that i wrote a Script Tile but it does't activate correctly.
One can step on it multiple times and nothing happens or it through sheer luck
it activates.
Also even if it was activated and the var set to 1 it can still activate again.
I don't really know why this happens.
I will post the script ,maybe I forgot something there.
Any help will be appreciated.🙂


SCRIPT:

#dynamic 0x800000
#org @start
lock
faceplayer

spriteface 0x6 0x1
spriteface 0xFF 0x2
applymovement 0x6 @m1
waitmovement 0x0
msgbox @talk 0x6

msgbox @t1 0x6
applymovement 0x6 @m2
waitmovement 0x0
hidesprite 0x6
setflag 0x242
hidesprite 0x6
setvar 0x4022 0x1

release
end

#org @talk
= Hello, [PLAYER]!\nHow are you doing?

#org @t1
= I just came to say my Prayers for\nall the fallen POKéMON here.\lIt reminds me of the BELL TOWER in\lJOHTO where 3 POKéMON fell\ltragically.\pWell anyway, have a nice day.\nBye!


'-----------
' Movements
'-----------
#org @m1
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @m2
#raw 0x13
#raw 0x10
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0xFE 'End of Movements

mcferaligatr March 4th, 2021 9:41 AM

Quote:

Originally Posted by AJaxs (Post 10302836)
Hello guys and girls.
My Problem is that i wrote a Script Tile but it does't activate correctly.
One can step on it multiple times and nothing happens or it through sheer luck
it activates.
Also even if it was activated and the var set to 1 it can still activate again.
I don't really know why this happens.
I will post the script ,maybe I forgot something there.
Any help will be appreciated.🙂


SCRIPT:

#dynamic 0x800000
#org @start
lock
faceplayer

spriteface 0x6 0x1
spriteface 0xFF 0x2
applymovement 0x6 @m1
waitmovement 0x0
msgbox @talk 0x6

msgbox @t1 0x6
applymovement 0x6 @m2
waitmovement 0x0
hidesprite 0x6
setflag 0x242
hidesprite 0x6
setvar 0x4022 0x1

release
end

#org @talk
= Hello, [PLAYER]!\nHow are you doing?

#org @t1
= I just came to say my Prayers for\nall the fallen POKéMON here.\lIt reminds me of the BELL TOWER in\lJOHTO where 3 POKéMON fell\ltragically.\pWell anyway, have a nice day.\nBye!


'-----------
' Movements
'-----------
#org @m1
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @m2
#raw 0x13
#raw 0x10
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0xFE 'End of Movements

This is most likely happening because of var 4022. Vars from 4020 to 4024 have something to do with keeping repel values, so you should use a var other than those and the script should work properly.

AJaxs March 6th, 2021 3:04 AM

ahhh,Thanks man.😄
This also explains why I get a "Repel wore of" Text message for another script.😂


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