PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Other Generations Hacking > Guides & Documentation > Questions & Answers

Questions & Answers Do you have a problem you need a straight answer for? Ask a question here and get an answer.

Reply
 
Thread Tools Display Modes
Old 2nd September 2014, 11:45 PM   #1
NickGirdy55
Getting there...
 
Join Date: Aug 2014
Location: Canada
Posts: 34
NickGirdy55
Default Why won't this code work?

#dynamic 0x80685B

#org @start
checkflag 0x200
if 0x1 goto @Battle
end

#org 0x806866
applymovement 0x8 @WalkRed
waitmovement 0x8
applymovement 0xFF @MoveBlue
waitmovement 0xFF
playsong 0x138 0x0
msgbox @TalkBlue 0x6
applymovement 0xFF @WalkBlue
waitmovement 0xFF
trainerbattle 0x0 0x147 0x0 @before @after
applymovement 11 @WalkLeaf
waitmovement 11
msgbox @TalkLeaf 0x6
applymovement 11 @WalkLeaf2
waitmovement 11
msgbox @TalkBlue2 0x6
playsong 0x138 0x0
setflag 0x1212
setvar 0x4011 0x1

#org @TalkBlue
= blue fr [rival]: Wait [player]!\nLet's check out our POKéMON!\pCome on, I'll take you on!\p

#org @before
= [red_fr][rival]: ... .... ... So be it ... ... ...

#org @after
= [red_fr][rival]: ... ... This isn't over ... ...

#org @TalkLeaf
= LEAF: Don't go just yet, [player]!\nI want to battle you as well! Meet\lme outside!\l

#org @TalkBlue2
= [player]: Okay I'll make my\nPOKéMON battle to toughen it up!\p[rival]! Gramps Leaf!\nSmell you later!

#org @WalkRed
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @MoveBlue
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkBlue
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkLeaf
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xFE 'End of Movements

#org @WalkLeaf2
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements

The battle offset and the offset there are the same in the compiled script
NickGirdy55 is offline   Reply With Quote
Sponsored Links
Old 27th September 2014, 02:55 PM   #2
Aperso
Puddleduck
PHO VIP
 
Aperso's Avatar
 
Join Date: Oct 2012
Location: its long since gone
Posts: 167
Aperso
Default

Quote:
Originally Posted by NickGirdy55 View Post
Spoiler:
#dynamic 0x80685B
#org @start
checkflag 0x200
if 0x1 goto @Battle
end

#org 0x806866
applymovement 0x8 @WalkRed
waitmovement 0x8
applymovement 0xFF @MoveBlue
waitmovement 0xFF
playsong 0x138 0x0
msgbox @TalkBlue 0x6
applymovement 0xFF @WalkBlue
waitmovement 0xFF
trainerbattle 0x0 0x147 0x0 @before @after
applymovement 11 @WalkLeaf
waitmovement 11
msgbox @TalkLeaf 0x6
applymovement 11 @WalkLeaf2
waitmovement 11
msgbox @TalkBlue2 0x6
playsong 0x138 0x0
setflag 0x1212
setvar 0x4011 0x1

#org @TalkBlue
= blue fr [rival]: Wait [player]!\nLet's check out our POKéMON!\pCome on, I'll take you on!\p

#org @before
= [red_fr][rival]: ... .... ... So be it ... ... ...

#org @after
= [red_fr][rival]: ... ... This isn't over ... ...

#org @TalkLeaf
= LEAF: Don't go just yet, [player]!\nI want to battle you as well! Meet\lme outside!\l

#org @TalkBlue2
= [player]: Okay I'll make my\nPOKéMON battle to toughen it up!\p[rival]! Gramps Leaf!\nSmell you later!

#org @WalkRed
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @MoveBlue
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkBlue
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkLeaf
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xFE 'End of Movements

#org @WalkLeaf2
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements


The battle offset and the offset there are the same in the compiled script
Firstly, we'd like to know a little more information about the script, noatbly, which Program you're using and which ROM you're implanting the script on. Furthermore, I'd like to see how the script fails to work. Just saying it doesn't work, doesn't help us all that much.
__________________
Romhack.me ~ Aperso's account|PHO Forums ~ Aperso's account

I'll come up with something to put here later.
Aperso is offline   Reply With Quote
Old 27th September 2014, 03:01 PM   #3
Pia Carrot
Orange Developer
Administrator
 
Pia Carrot's Avatar
 
Join Date: Aug 2010
Location: Valencia Island
Age: 22
Posts: 848
Pia Carrot Pia Carrot Pia Carrot Pia Carrot
Default

If you're using XSE, which version?
What ROM?
What is the script supposed to do?

EDIT: tfw 2 weeks late
__________________

I'm a boob
Pia Carrot is offline   Reply With Quote
Old 29th September 2014, 01:18 PM   #4
NickGirdy55
Getting there...
 
Join Date: Aug 2014
Location: Canada
Posts: 34
NickGirdy55
Default

Quote:
Originally Posted by Aperso View Post
Firstly, we'd like to know a little more information about the script, noatbly, which Program you're using and which ROM you're implanting the script on. Furthermore, I'd like to see how the script fails to work. Just saying it doesn't work, doesn't help us all that much.
I'm using XSE and it's FireRed. What do you mean saying it doesn't work doesn't help? It does not work. The code does not play. And I think it locks the character. I've messed up my ROM so it'll be a bit before I'm back to that script.

XSE 1.1.1 by the way

Quote:
Originally Posted by Pia Carrot View Post
If you're using XSE, which version?
What ROM?
What is the script supposed to do?

EDIT: tfw 2 weeks late
What is it supposed to do? Read it. Red moves to the spot where the battle is triggered in the normal game, Blue moves, they battle, and then messages happen.
NickGirdy55 is offline   Reply With Quote
Old 29th September 2014, 02:24 PM   #5
Pia Carrot
Orange Developer
Administrator
 
Pia Carrot's Avatar
 
Join Date: Aug 2010
Location: Valencia Island
Age: 22
Posts: 848
Pia Carrot Pia Carrot Pia Carrot Pia Carrot
Default

Attitude like that is not going to help you. I read it but if you missed a command or something how am I supposed to know what it's meant to do? Now, tell me exactly what you need it to do, how many spaces up, left, down, etc because obviously it's not working as you'd like it to be working.

Also at this point I'd like to ask for a screenshot of the map these characters are supposed to move on, for all I know you derped on a tile permission.
__________________

I'm a boob
Pia Carrot is offline   Reply With Quote
Likes Linkandzelda, Banjora Marxvile liked this post
Old 29th September 2014, 03:38 PM   #6
NickGirdy55
Getting there...
 
Join Date: Aug 2014
Location: Canada
Posts: 34
NickGirdy55
Default

Quote:
Originally Posted by Pia Carrot View Post
Attitude like that is not going to help you. I read it but if you missed a command or something how am I supposed to know what it's meant to do? Now, tell me exactly what you need it to do, how many spaces up, left, down, etc because obviously it's not working as you'd like it to be working.

Also at this point I'd like to ask for a screenshot of the map these characters are supposed to move on, for all I know you derped on a tile permission.
The map is Oak's lab so there's no permission screw up. The spaces up, left, down are in the code. It's exactly what the code says. I don't think I messed up on a command. The code does not work. When the player moves to the the tile, nothing happens. It locks the character. The code works up until after the battle and then Leaf doesn't talk or move and neither does Blue.
NickGirdy55 is offline   Reply With Quote
Old 29th September 2014, 04:49 PM   #7
Aperso
Puddleduck
PHO VIP
 
Aperso's Avatar
 
Join Date: Oct 2012
Location: its long since gone
Posts: 167
Aperso
Default

Quote:
Originally Posted by NickGirdy55 View Post
The map is Oak's lab so there's no permission screw up. The spaces up, left, down are in the code. It's exactly what the code says. I don't think I messed up on a command. The code does not work. When the player moves to the the tile, nothing happens. It locks the character. The code works up until after the battle and then Leaf doesn't talk or move and neither does Blue.
Ah right, I know what you have done, you have used the wrong type of trainerbattle in the script below, I have corrected your error, this should in theory work in Fire red now.

Spoiler:

#dynamic 0x80685B

#org @start
checkflag 0x200
if 0x1 goto @Battle
end

#org 0x806866
applymovement 0x8 @WalkRed
waitmovement 0x8
applymovement 0xFF @MoveBlue
waitmovement 0xFF
playsong 0x138 0x0
msgbox @TalkBlue 0x6
applymovement 0xFF @WalkBlue
waitmovement 0xFF
trainerbattle 0x1 0x147 0x0 @before @after @later
end

#org @later
applymovement 11 @WalkLeaf
waitmovement 11
msgbox @TalkLeaf 0x6
applymovement 11 @WalkLeaf2
waitmovement 11
msgbox @TalkBlue2 0x6
playsong 0x138 0x0
setflag 0x1212
setvar 0x4011 0x1

#org @TalkBlue
= blue fr [rival]: Wait [player]!\nLet's check out our POKéMON!\pCome on, I'll take you on!\p

#org @before
= [red_fr][rival]: ... .... ... So be it ... ... ...

#org @after
= [red_fr][rival]: ... ... This isn't over ... ...

#org @TalkLeaf
= LEAF: Don't go just yet, [player]!\nI want to battle you as well! Meet\lme outside!\l

#org @TalkBlue2
= [player]: Okay I'll make my\nPOKéMON battle to toughen it up!\p[rival]! Gramps Leaf!\nSmell you later!

#org @WalkRed
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @MoveBlue
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkBlue
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkLeaf
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xFE 'End of Movements

#org @WalkLeaf2
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements


Good luck. If it doesn't work, sorry, it has been a while since I have touched my scripting knowledge.

To Explain what you basically did wrong, you used
Quote:
trainerbattle 0x0 0x147 0x0 @before @after
Which if I remember correctly automatically ends the script when the battle ends, despite the fact if the script continues. What I have done

Quote:
trainerbattle 0x1 0x147 0x0 @before @after @later
Basically, the 0x1 makes the script go to a defined pointer (in the case of the script @later) which causes the script to continue. This form of the script is usually used in "Official battles" such as rival battles, battles against an evil team and the Pokémon league and the Gym leaders, who more often than not have something to say to the victors of the battle.
__________________
Romhack.me ~ Aperso's account|PHO Forums ~ Aperso's account

I'll come up with something to put here later.

Last edited by Aperso; 29th September 2014 at 05:01 PM.
Aperso is offline   Reply With Quote
Old 29th September 2014, 06:13 PM   #8
NickGirdy55
Getting there...
 
Join Date: Aug 2014
Location: Canada
Posts: 34
NickGirdy55
Default

Quote:
Originally Posted by Aperso View Post
Ah right, I know what you have done, you have used the wrong type of trainerbattle in the script below, I have corrected your error, this should in theory work in Fire red now.

Spoiler:

#dynamic 0x80685B

#org @start
checkflag 0x200
if 0x1 goto @Battle
end

#org 0x806866
applymovement 0x8 @WalkRed
waitmovement 0x8
applymovement 0xFF @MoveBlue
waitmovement 0xFF
playsong 0x138 0x0
msgbox @TalkBlue 0x6
applymovement 0xFF @WalkBlue
waitmovement 0xFF
trainerbattle 0x1 0x147 0x0 @before @after @later
end

#org @later
applymovement 11 @WalkLeaf
waitmovement 11
msgbox @TalkLeaf 0x6
applymovement 11 @WalkLeaf2
waitmovement 11
msgbox @TalkBlue2 0x6
playsong 0x138 0x0
setflag 0x1212
setvar 0x4011 0x1

#org @TalkBlue
= blue fr [rival]: Wait [player]!\nLet's check out our POKéMON!\pCome on, I'll take you on!\p

#org @before
= [red_fr][rival]: ... .... ... So be it ... ... ...

#org @after
= [red_fr][rival]: ... ... This isn't over ... ...

#org @TalkLeaf
= LEAF: Don't go just yet, [player]!\nI want to battle you as well! Meet\lme outside!\l

#org @TalkBlue2
= [player]: Okay I'll make my\nPOKéMON battle to toughen it up!\p[rival]! Gramps Leaf!\nSmell you later!

#org @WalkRed
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @MoveBlue
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkBlue
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org @WalkLeaf
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xFE 'End of Movements

#org @WalkLeaf2
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements


Good luck. If it doesn't work, sorry, it has been a while since I have touched my scripting knowledge.

To Explain what you basically did wrong, you used

Which if I remember correctly automatically ends the script when the battle ends, despite the fact if the script continues. What I have done



Basically, the 0x1 makes the script go to a defined pointer (in the case of the script @later) which causes the script to continue. This form of the script is usually used in "Official battles" such as rival battles, battles against an evil team and the Pokémon league and the Gym leaders, who more often than not have something to say to the victors of the battle.
Thanks a lot. I hope it works. As a related note, how do I make it so that the script continues even if you lose? At least for this rival battle. Later the added battles will have to take you to a Pokemon Center and the battle will have to still trigger even if you lost.
NickGirdy55 is offline   Reply With Quote
Old 29th September 2014, 06:21 PM   #9
Aperso
Puddleduck
PHO VIP
 
Aperso's Avatar
 
Join Date: Oct 2012
Location: its long since gone
Posts: 167
Aperso
Default

Quote:
Originally Posted by NickGirdy55 View Post
Thanks a lot. I hope it works. As a related note, how do I make it so that the script continues even if you lose? At least for this rival battle. Later the added battles will have to take you to a Pokemon Center and the battle will have to still trigger even if you lost.
You'd have to use the tutorial battle. (You know that battle with the rival in Fire red when you first receive your Pokémon). except I can't remember how you trigger that piece of code, it may be a special, but it may be some ASM. I'll have to go through the script.
__________________
Romhack.me ~ Aperso's account|PHO Forums ~ Aperso's account

I'll come up with something to put here later.
Aperso is offline   Reply With Quote
Old 29th September 2014, 06:24 PM   #10
NickGirdy55
Getting there...
 
Join Date: Aug 2014
Location: Canada
Posts: 34
NickGirdy55
Default

Quote:
Originally Posted by Aperso View Post
You'd have to use the tutorial battle. (You know that battle with the rival in Fire red when you first receive your Pokémon). except I can't remember how you trigger that piece of code, it may be a special, but it may be some ASM. I'll have to go through the script.
Cool, thanks. I don't know where the code even is for that battle. What's ASM by the way?
NickGirdy55 is offline   Reply With Quote
Reply

Tags
code, work, [Other]

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:34 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts