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 I need help with my script (https://www.pokecommunity.com/showthread.php?t=468940)

Ace Trainer Slash March 20th, 2022 4:31 PM

I need help with my script
 
Hello.

I have made a script where a person will give the player a Pokemon when you talk to them. I then made this person to disappear. I haven't included any of the scripts to check for a full party because this is a starter Pokemon. This is the script I made. I followed a few guides like Avara's but nothing seems to be working at all. When I removed the nicknaming parts of the script and loaded the rest of it into the game, the game crashed when I interacted with the person that I gave the script below. When I have the nicknaming parts of the scripts in it, I keep getting an Error 9 'subscript out of range' on the text-string 'It's your newly caught Herdier\p[player]...' part of the script.

What is wrong with my script?

#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @hi 0x6
givepokemon 0x371 0x15 0x0 0x0 0x0 0x0
fanfare 0x101
msgbox @receive 0x4
waitfanfare
closeonkeypress
msgbox @nick 0x5
compare LASTRESULT 0x1
if 0x1 call @YesToNick
setflag 0x240
hidesprite 0x1
setflag 0x2F0
release
end

#org @YesToNick
setvar 0x8004 0x0
call 0x81A74EB
return

#org @hi
= Its your newly caught Herdier!\p[player]: Finally, a strong Pok\h1Bmon\n that’s going to help me win the Pok\h1Bmon \lLeague. I’ve been waiting for this\lmoment ever since I first got\lthat Lillipup.

#org @receive
= You added Herdier to your party!

#org @nick
= Should I nickname it?

Please someone help me with this. The demo I'm making falls apart if I can't at bare minimum get this script right.

Tacobell24 March 21st, 2022 3:15 PM

I'm not heaps au faut with scripting so ignore me kf this ks stupjd/wrong, but don't you need to define where the text strings are stored?

At the moment it looks to me like you haven't put any offsets there.

Are you using XSE and does the script compile?

Ace Trainer Slash March 21st, 2022 3:33 PM

I forgot to say, I ended up spending most of my day yesterday and I got my whole script to work, including the person disappearing after the dialogue sequence happens. Only weird thing now is when nicknaming any other Pokemon given, it will go to nickname the Pokemon given in the script above. But that won't be difficult to solve. Thankyou for your help anyway!


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