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 First movement script not working AKA tearing my hair out (https://www.pokecommunity.com/showthread.php?t=451956)

WistyFish May 23rd, 2021 9:13 PM

First movement script not working AKA tearing my hair out
 
Hi! So I just wrote my first Big Boy Script, and no matter what I've tried so far, walking over the script tile in question results in big fat nothing. It doesn't freeze, but the player sprite walks right on by with nothing happening at all. I'll try to put all pertinent info below. If you can help me figure out what I'm doing wrong, I would really appreciate it. I'm using XSE and Advancemap

Script:
Spoiler:

'---------------
#org 0xEE30E8
checkflag 0x960
if 0x1 goto 0x8EE312A
lock
applymovement 0x7 0x8EE312D
msgbox 0x8EE3130 0x6 '"???: After we catch these two, we\..."
applymovement 0x7 0x8EE3188
applymovement 0x6 0x8EE318D
waitmovement 0x0
msgbox 0x8EE3192 0x6 '"???: Oh shoot! We're out of\npokéb..."
applymovement 0x7 0x8EE320E
waitmovement 0x0
setflag 0x960
release
end

'---------------
#org 0xEE312A
release
end


'---------
' Strings
'---------
#org 0xEE3130
= ???: After we catch these two, we\ncan go back to the boss. Move in\lon that TRAPINCH!

#org 0xEE3192
= ???: Oh shoot! We're out of\npokéballs! Boss is gonna kill\lme...\pDo you think we could catch them\nwith a net or something?


'-----------
' Movements
'-----------
#org 0xEE312D
#raw 0x47 'Jump in Place (Facing Up)
#raw 0xFE 'End of Movements

#org 0xEE3188
#raw 0x5 'Step Up (Slow)
#raw 0x10 'Delay1
#raw 0x56 'Exclamation Mark (!)
#raw 0xFE 'End of Movements

#org 0xEE318D
#raw 0x5 'Step Up (Slow)
#raw 0x5 'Step Up (Slow)
#raw 0x3 'Face Right
#raw 0xFE 'End of Movements

#org 0xEE320E
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements


XSE settings:
Spoiler:

Unknown: 0300
Var Number: 4050
Var Value: 0000
Unknown: 00 00
Script Offset: $EE30E8


That's all the pertinent info I could think of. Thanks in advance!

Asith May 24th, 2021 4:12 AM

The first things to check would be whether flag 0x960 has accidentally already been set, causing you to jump to your end-and-do-nothing script; and also whether var 4050 is actually 0 - if it isn't the script would rightly not activate. Try switching the checkflag to "if 0x0 goto", and try using other var values or var numbers. If that changes nothing, we'll look into it more, but those would be the first things to look at :)

kalarie May 24th, 2021 4:53 AM

@WistyFish

1: Have expanded the amount of available flags? Flag 0x960 is not available in vanilla Fire Red, check this for a comprehensive flag list.

2: Are you sure variable 0x4050 actually contains value 0x0 and has not been set to anything else in-game? Check this for a comprehensive variable list.

3: The first unknown value in AdvanceMap should be the current height the protagonist is on +1. The highest available height in the vanilla games is 13. You probably need to set it to 0x0003 instead of 0x0300 (if the player is on a movement permission block C).

WistyFish May 25th, 2021 4:55 PM

Quote:

Originally Posted by Asith (Post 10362400)
The first things to check would be whether flag 0x960 has accidentally already been set, causing you to jump to your end-and-do-nothing script; and also whether var 4050 is actually 0 - if it isn't the script would rightly not activate. Try switching the checkflag to "if 0x0 goto", and try using other var values or var numbers. If that changes nothing, we'll look into it more, but those would be the first things to look at :)

Thanks for responding! I don't think it's the flag. I had the same thought, and removed the flag check entirely and nothing changed. I will also try your suggestion though to double check. I was tired at that point lol

As far as the var number, I honestly don't understand those numbers at all, and am basing what I am doing on a comment I saw on an old thread. I clearly need to do more research into this.

I will fiddle with these and update!

WistyFish May 25th, 2021 5:08 PM

Quote:

Originally Posted by kalarie (Post 10362411)
@WistyFish

1: Have expanded the amount of available flags? Flag 0x960 is not available in vanilla Fire Red, check this for a comprehensive flag list.

Glad you mentioned this! I'm actually using Emerald, but I was able to find the flags list through your link. I misunderstood something I read, I think, and have picked a new unused flag! However, this doesn't seem to do anything with regards to my problem. I also removed the check and set flag lines as a test and nothing changed.

Quote:

Originally Posted by kalarie (Post 10362411)
2: Are you sure variable 0x4050 actually contains value 0x0 and has not been set to anything else in-game? Check this for a comprehensive variable list.

3: The first unknown value in AdvanceMap should be the current height the protagonist is on +1. The highest available height in the vanilla games is 13. You probably need to set it to 0x0003 instead of 0x0300 (if the player is on a movement permission block C).

Thank you for giving me some context for what these numbers are, frankly I don't understand them yet, and was just copying someone else. I did try unknown 0003, copying the unknown of other scripts in the game, but I had no idea it was the height. Variables.... I know nothing. I will do more research on this, I expect I will find that this is my issue.

WistyFish May 25th, 2021 5:21 PM

It was the variable! Changed it to 0x4059, and the script works exactly as I wanted it to. Well... Actually I need to tweak the movements a little but that's no issue. I also partially understand what a Variable ID is now! Progress!

I could cry. Thanks to both of you! Now I get to work on a scripted battle!.... y.. yaaay??

Momoro May 29th, 2021 10:31 PM

Quote:

Originally Posted by WistyFish (Post 10363081)
It was the variable! Changed it to 0x4059, and the script works exactly as I wanted it to. Well... Actually I need to tweak the movements a little but that's no issue. I also partially understand what a Variable ID is now! Progress!

I could cry. Thanks to both of you! Now I get to work on a scripted battle!.... y.. yaaay??

If you need help with scripting you can PM me, I'll gladly help 🙂


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