Go Back   The PokéCommunity Forums > ROM Hacking > ROM Hacking Hub
Reload this Page Script Help Thread (DO NOT REQUEST SCRIPTS)

Notices
For all updates, view the main page.

ROM Hacking Hub General discussions about ROM Hacking and Emulation. Not sure where to start? This is the place for you.
Posting links to ROMs is illegal and is not tolerated anywhere on the forum.
New threads in this forum are to be approved by a moderator before they are displayed.



Closed Thread
 
Thread Tools
  #7801    
Old February 2nd, 2013 (01:28 PM).
kj3400's Avatar
kj3400 kj3400 is offline
Wants a Magneton for a Charger
 
Join Date: Mar 2012
Gender: Male
Nature: Lax
Posts: 53
Send a message via Skype™ to kj3400
I'm just going to point out the problems in the script. Keep in mind, I'm not the best, though I think I know what I'm doing, so you may want to check with someone who's got more advanced knowledge.


Spoiler:
#dynamic 0x9C0000

#org @start
lock
faceplayer
if 0x1 goto @done (if what is 0x1? you need a compare or checkflag)
message @leave 0x6 (for fire red the message box for asking questions is 0x5, it might be different for emerald, i don't know)
compare LASTRESULT 1
if b_true goto @yes (if they say yes, and you want all this applymovement to happen, you need to put return under #org @yes, not end)
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
if 0x1 goto @move3 (once again, if what is 0x1?)
applymovement 0x1 @move3
waitmovement 0x1
compare LASTRESULT 0x1 (For no, the correct thing here would be 0x0)
if b_true goto @no
applymovement 0xFF @exit (I'm not sure what this is for exactly)
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @done
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
end

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp


I hope I helped a little...
  #7802    
Old February 2nd, 2013 (01:55 PM). Edited February 2nd, 2013 by thetripplenine.
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by kj3400:
I'm just going to point out the problems in the script. Keep in mind, I'm not the best, though I think I know what I'm doing, so you may want to check with someone who's got more advanced knowledge.

Spoiler:
#dynamic 0x9C0000

#org @start
lock
faceplayer
if 0x1 goto @done (if what is 0x1? you need a compare or checkflag)
message @leave 0x6 (for fire red the message box for asking questions is 0x5, it might be different for emerald, i don't know)
compare LASTRESULT 1
if b_true goto @yes (if they say yes, and you want all this applymovement to happen, you need to put return under #org @yes, not end)
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
if 0x1 goto @move3 (once again, if what is 0x1?)
applymovement 0x1 @move3
waitmovement 0x1
compare LASTRESULT 0x1 (For no, the correct thing here would be 0x0)
if b_true goto @no
applymovement 0xFF @exit (I'm not sure what this is for exactly)
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @done
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
end

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp


I hope I helped a little...
What happened was the boat went of without me and I turned invisible... lol


EDIT:

I think this is what you wanted me to do right?
Spoiler:
#dynamic 0x9C0000

#org @start
lock
faceplayer
message @leave 0x5
compare LASTRESULT 1
if b_true goto @yes
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
waitmovement 0x1
compare LASTRESULT 0x0
if b_true goto @no
applymovement 0xFF @exit
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
return

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp

[/COLOR][/COLOR]
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7803    
Old February 2nd, 2013 (03:03 PM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
Quote originally posted by thetripplenine:


What happened was the boat went of without me and I turned invisible... lol


EDIT:

I think this is what you wanted me to do right?
Spoiler:
#dynamic 0x9C0000

#org @start
lock
faceplayer
message @leave 0x5
compare LASTRESULT 1
if b_true goto @yes
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
waitmovement 0x1
compare LASTRESULT 0x0
if b_true goto @no
applymovement 0xFF @exit
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
return

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp

[/COLOR][/COLOR]
Are you really using applymovement to get the boat from one island to the next lol. Just do what I suggested and use a warp. Also if you want the player/camera to follow the boat you need to do to do this:

Spoiler:

#org @start
lock
faceplayer
message @leave 0x5
compare LASTRESULT 1
if b_true goto @yes
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
compare LASTRESULT 0x0
if b_true goto @no
applymovement 0xFF @exit
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
return

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp


Probably the most inefficient and wierdest way to do this, but if you add that one line I did it should work (unless the two maps are not connected...then it won't.
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7804    
Old February 2nd, 2013 (04:30 PM). Edited February 2nd, 2013 by thetripplenine.
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by FBI agent:
Are you really using applymovement to get the boat from one island to the next lol. Just do what I suggested and use a warp. Also if you want the player/camera to follow the boat you need to do to do this:

Spoiler:

#org @start
lock
faceplayer
message @leave 0x5
compare LASTRESULT 1
if b_true goto @yes
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
compare LASTRESULT 0x0
if b_true goto @no
applymovement 0xFF @exit
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE


#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
return

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp


Probably the most inefficient and wierdest way to do this, but if you add that one line I did it should work (unless the two maps are not connected...then it won't.
Um, how does making applymovement 0xFF @move3 move the camera... I already have a @move 3 btw, or did you do that on purpose?

EDIT:
Ok, well now I know how it works, btw you only move if you say no, also the part that I made red in the script does not come in affect after you reach your destination.
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7805    
Old February 2nd, 2013 (04:48 PM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
Quote originally posted by thetripplenine:


Um, how does making applymovement 0xFF @move3 move the camera... I already have a @move 3 btw, or did you do that on purpose?

EDIT:
Ok, well now I know how it works, btw you only move if you say no, also the part that I made red in the script does not come in affect after you reach your destination.
You have a compare lastresult 0x1 there for some apparent reason which skips the part in your script that you've highlighted.
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7806    
Old February 2nd, 2013 (04:51 PM). Edited February 2nd, 2013 by karatekid552.
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by FBI agent:
You have a compare lastresult 0x1 there for some apparent reason which skips the part in your script that you've highlighted.
0x7F is the camera!!!!! 0xFF is the player!

Edit: whoops, sorry, I thought you wanted to move the camera independently. Yeah, that will work.
__________________

Paired with Simba
  #7807    
Old February 2nd, 2013 (04:56 PM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
Quote originally posted by karatekid552:
0x7F is the camera!!!!! 0xFF is the player!

Edit: whoops, sorry, I thought you wanted to move the camera independently. Yeah, that will work.
Who do you think you're trying to correct assistant?

-------------
Also, after the question, you want to compare the lastresult to NO not YES. Then make a jump to @no and continue the script, that way you don't need that many subroutines.
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7808    
Old February 2nd, 2013 (05:19 PM).
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by FBI agent:
Who do you think you're trying to correct assistant?

-------------
Also, after the question, you want to compare the lastresult to NO not YES. Then make a jump to @no and continue the script, that way you don't need that many subroutines.

Which lastresult, and also it won't work if I press yes, but works if I press no...
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7809    
Old February 2nd, 2013 (05:30 PM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
Quote originally posted by thetripplenine:



Which lastresult, and also it won't work if I press yes, but works if I press no...
First of all, I want you to try understand why it works when you press no and not when you press yes. It's very obvious, and something that you should really look into before continuing. I know I've been just handing you the fixes and such, but this time you must work for it :P

I only give you this example as a hint:

Code:
#dynamic 0x740000

#org @start
lock
faceplayer
msgbox @yesorno 0x5            'A yes no box, whether you hit yes or no gets stored in LASTRESULT
compare LASTRESULT YES      'A check to see if the LASTRESULT was yes, I.E you pressed yes
if == jump @yep
msgbox @no 0x6                   'If the jump wasn't made, then this runs. I.E player said NO for the message
release
end

#org @yesorno
= Can you see what's wrong with your script now?

#org @yep
= Good. I'm too nice, it's spoiling you :P

#org @no
= Think of what determines when the no box is run and when the @yep is run.
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7810    
Old February 2nd, 2013 (06:16 PM).
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by FBI agent:
First of all, I want you to try understand why it works when you press no and not when you press yes. It's very obvious, and something that you should really look into before continuing. I know I've been just handing you the fixes and such, but this time you must work for it

I only give you this example as a hint:

Code:
#dynamic 0x740000

#org @start
lock
faceplayer
msgbox @yesorno 0x5            'A yes no box, whether you hit yes or no gets stored in LASTRESULT
compare LASTRESULT YES      'A check to see if the LASTRESULT was yes, I.E you pressed yes
if == jump @yep
msgbox @no 0x6                   'If the jump wasn't made, then this runs. I.E player said NO for the message
release
end

#org @yesorno
= Can you see what's wrong with your script now?

#org @yep
= Good. I'm too nice, it's spoiling you :P

#org @no
= Think of what determines when the no box is run and when the @yep is run.

That didn't really help, lol, i don't know if i'm being stupid or what
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7811    
Old February 2nd, 2013 (06:56 PM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
Quote originally posted by thetripplenine:



That didn't really help, lol, i don't know if i'm being stupid or what
Yes is 0x1, no is 0x0. Now, read it again with those changes.
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7812    
Old February 2nd, 2013 (06:57 PM).
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by FBI agent:
Yes is 0x1, no is 0x0. Now, read it again with those changes.
I already tried that that's why i said it didn't help...
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7813    
Old February 2nd, 2013 (07:14 PM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
OK, lets look at your script.

Code:
#org @start
lock
faceplayer
message @leave 0x5           'alright the message is being asked now
compare LASTRESULT 0x1    'If the player said yes it's jumping to @yes, lets go to @yes
if 0x1 goto @yes
applymovement 0x2 @move  'From here down is executed if you pressed No.
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit 
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
movements

#org @move2
movements

#org @move3
movements

#org @exit
movements

#org @exit2
movements

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6        'Cool a message
release                               'Woah, woah, why are we releasing? Incorrect use
return                                'Return only works if you used call before it (not goto)
                                        'Lets go back and see what happens

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp
Do you see what this means? You have a return but it's not doing anything. Sure goto and jump work the same way, but you have no way to get back to your original place in the script. Hence, we use:

Code:
#org @start
lock
faceplayer
call @something
msgbox @text 0x6
release
end

#org @something
msgbox @yay 0x6
return

#org @text
= Hey the script came back here!

#org @something
= Alrighty, we're down here.
This means there are 2 ways you can fix your script. One is by moving all the movements and such to that @yes body. The second is that you move the message @yes back to the main body and check if the user answered NO to the text. If he/she did say no, then you JUMP/GOTO (not call) to @no.

I hope you understand the difference between call & goto. Call is a very useful thing, but in your script it's unneeded. :)
Also, the pattern in your scripts that don't work is mostly logical errors. You need to understand the commands you're using and what they do.
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7814    
Old February 2nd, 2013 (08:29 PM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,767
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote originally posted by FBI agent:
OK, lets look at your script.

Code:
#org @start
lock
faceplayer
message @leave 0x5           'alright the message is being asked now
compare LASTRESULT 0x1    'If the player said yes it's jumping to @yes, lets go to @yes
if 0x1 goto @yes
applymovement 0x2 @move  'From here down is executed if you pressed No.
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit 
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
movements

#org @move2
movements

#org @move3
movements

#org @exit
movements

#org @exit2
movements

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6        'Cool a message
release                               'Woah, woah, why are we releasing? Incorrect use
return                                'Return only works if you used call before it (not goto)
                                        'Lets go back and see what happens

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp
Do you see what this means? You have a return but it's not doing anything. Sure goto and jump work the same way, but you have no way to get back to your original place in the script. Hence, we use:

Code:
#org @start
lock
faceplayer
call @something
msgbox @text 0x6
release
end

#org @something
msgbox @yay 0x6
return

#org @text
= Hey the script came back here!

#org @something
= Alrighty, we're down here.
This means there are 2 ways you can fix your script. One is by moving all the movements and such to that @yes body. The second is that you move the message @yes back to the main body and check if the user answered NO to the text. If he/she did say no, then you JUMP/GOTO (not call) to @no.

I hope you understand the difference between call & goto. Call is a very useful thing, but in your script it's unneeded.
Also, the pattern in your scripts that don't work is mostly logical errors. You need to understand the commands you're using and what they do.
Just to add to what my friend FBI agent said:

Call is generally used for quick jumps out of a script like a different message for a boy/girl in which you will 'return' right back to where you were.

Goto/jump will take you to the next section where the script will proceed and you will not be returning to the section of the script you jumped out of. Many times, using a return at the end a script you "jumped" out to, will do nothing.
__________________

Paired with Simba
  #7815    
Old February 2nd, 2013 (08:49 PM).
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by FBI agent:
OK, lets look at your script.

Code:
#org @start
lock
faceplayer
message @leave 0x5           'alright the message is being asked now
compare LASTRESULT 0x1    'If the player said yes it's jumping to @yes, lets go to @yes
if 0x1 goto @yes
applymovement 0x2 @move  'From here down is executed if you pressed No.
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit 
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
movements

#org @move2
movements

#org @move3
movements

#org @exit
movements

#org @exit2
movements

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6        'Cool a message
release                               'Woah, woah, why are we releasing? Incorrect use
return                                'Return only works if you used call before it (not goto)
                                        'Lets go back and see what happens

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp
Do you see what this means? You have a return but it's not doing anything. Sure goto and jump work the same way, but you have no way to get back to your original place in the script. Hence, we use:

Code:
#org @start
lock
faceplayer
call @something
msgbox @text 0x6
release
end

#org @something
msgbox @yay 0x6
return

#org @text
= Hey the script came back here!

#org @something
= Alrighty, we're down here.
This means there are 2 ways you can fix your script. One is by moving all the movements and such to that @yes body. The second is that you move the message @yes back to the main body and check if the user answered NO to the text. If he/she did say no, then you JUMP/GOTO (not call) to @no.

I hope you understand the difference between call & goto. Call is a very useful thing, but in your script it's unneeded.
Also, the pattern in your scripts that don't work is mostly logical errors. You need to understand the commands you're using and what they do.
Ya, it still only works if you press no...
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7816    
Old February 2nd, 2013 (09:19 PM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
Quote originally posted by thetripplenine:


Ya, it still only works if you press no...
Of course, that's because I never did fix the script. I just commented your broken script and tried to point you to the right direction in order to fix it. I get the feeling you're not reading my suggestions/instructions.
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7817    
Old February 2nd, 2013 (09:32 PM). Edited February 2nd, 2013 by thetripplenine.
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by FBI agent:
Of course, that's because I never did fix the script. I just commented your broken script and tried to point you to the right direction in order to fix it. I get the feeling you're not reading my suggestions/instructions.
I did... Lol I told you I already tried to change it..

EDIT:
I played around and finally got it to work.

EDIT 2:
Now when you click no it goes to the yes message...
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7818    
Old February 2nd, 2013 (11:42 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~ 'ω'
Silver Tier
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Posts: 7,076
Quote originally posted by thetripplenine:


I did... Lol I told you I already tried to change it..

EDIT:
I played around and finally got it to work.

EDIT 2:
Now when you click no it goes to the yes message...
As you have stated, you have edited your script.
It would be useful for us to help you if you included your new script.
Though please wrap it within Spoiler or Code tags though...
HTML Code:
[CODE]script here[/CODE]
__________________

3DS FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)


  #7819    
Old February 3rd, 2013 (10:09 AM).
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by destinedjagold:


As you have stated, you have edited your script.
It would be useful for us to help you if you included your new script.
Though please wrap it within Spoiler or Code tags though...
HTML Code:
[CODE]script here[/CODE]
Here's the script uncompiled:

Spoiler:
#dynamic 0x9C0000

#org @start
lock
faceplayer
message @leave 0x5
compare LASTRESULT 0x0
if 0x1 goto @yes
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
return


#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp


Here's the compiled script:

Spoiler:
'---------------
#org 0x9C5AB9
lock
faceplayer
msgbox 0x89C5B3D MSG_YESNO '"Do you want to go to the training\..."
compare LASTRESULT 0x0
if 0x1 goto 0x89C5B67
applymovement 0x2 0x89C5B0A
waitmovement 0x2
applymovement MOVE_PLAYER 0x89C5B0E
waitmovement 0xFF
applymovement 0x1 0x89C5B13
applymovement MOVE_PLAYER 0x89C5B13
waitmovement 0x1
applymovement MOVE_PLAYER 0x89C5B34
waitmovement 0xFF
applymovement 0x1 0x89C5B39
waitmovement 0x1
release
end

'---------------
#org 0x9C5B67
msgbox 0x89C5B7D MSG_NORMAL '"Ok lets go!"
release
end


'---------
' Strings
'---------
#org 0x9C5B3D
= Do you want to go to the training\ncamp?

#org 0x9C5B7D
= Ok lets go!


'-----------
' Movements
'-----------
#org 0x9C5B0A
#raw 0x9 'Step Up (Normal)
#raw 0x54 'Hide
#raw 0xFE 'End of Movements

#org 0x9C5B0E
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x54 'Hide
#raw 0xFE 'End of Movements

#org 0x9C5B13
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org 0x9C5B34
#raw 0x55 'Show
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org 0x9C5B39
#raw 0x55 'Show
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7820    
Old February 3rd, 2013 (10:15 AM).
FBI agent's Avatar
FBI agent FBI agent is offline
If my PM box is full, VM instead :x
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 823
Quote originally posted by thetripplenine:


Here's the script uncompiled:

Spoiler:
#dynamic 0x9C0000

#org @start
lock
faceplayer
message @leave 0x5
compare LASTRESULT 0x0
if 0x1 goto @yes
applymovement 0x2 @move
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move2
#raw 0x09
#raw 0x09
#raw 0x54
#raw 0xFE

#org @move3
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit
#raw 0x55
#raw 0x09
#raw 0x09
#raw 0xFE

#org @exit2
#raw 0x55
#raw 0x09
#raw 0xFE

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6
release
return


#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp


Here's the compiled script:

Spoiler:
'---------------
#org 0x9C5AB9
lock
faceplayer
msgbox 0x89C5B3D MSG_YESNO '"Do you want to go to the training\..."
compare LASTRESULT 0x0
if 0x1 goto 0x89C5B67
applymovement 0x2 0x89C5B0A
waitmovement 0x2
applymovement MOVE_PLAYER 0x89C5B0E
waitmovement 0xFF
applymovement 0x1 0x89C5B13
applymovement MOVE_PLAYER 0x89C5B13
waitmovement 0x1
applymovement MOVE_PLAYER 0x89C5B34
waitmovement 0xFF
applymovement 0x1 0x89C5B39
waitmovement 0x1
release
end

'---------------
#org 0x9C5B67
msgbox 0x89C5B7D MSG_NORMAL '"Ok lets go!"
release
end


'---------
' Strings
'---------
#org 0x9C5B3D
= Do you want to go to the training\ncamp?

#org 0x9C5B7D
= Ok lets go!


'-----------
' Movements
'-----------
#org 0x9C5B0A
#raw 0x9 'Step Up (Normal)
#raw 0x54 'Hide
#raw 0xFE 'End of Movements

#org 0x9C5B0E
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x54 'Hide
#raw 0xFE 'End of Movements

#org 0x9C5B13
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org 0x9C5B34
#raw 0x55 'Show
#raw 0x9 'Step Up (Normal)
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org 0x9C5B39
#raw 0x55 'Show
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
And here's the error:
Code:
compare LASTRESULT 0x0 'check player pressed no
if 0x1 goto @yes ' goto @yes 
__________________
...

My name forum name is FBI Agent, though you can call me FBI because it's shorter.

Some of my stuff:
ASM request/resource thread
ASM tutorials thread
ASM Workshop
  #7821    
Old February 3rd, 2013 (10:34 AM).
thetripplenine's Avatar
thetripplenine thetripplenine is offline
999
 
Join Date: Jan 2013
Location: California
Age: 17
Gender: Male
Nature: Bold
Posts: 98
Quote originally posted by FBI agent:
And here's the error:
Code:
compare LASTRESULT 0x0 'check player pressed no
if 0x1 goto @yes ' goto @yes 
Oh, Totally My bad... Sorry for the trouble.
__________________
Hatch my eggs by clicking on them!
Don't let them die!



Fully Grown Dragons:
Spoiler:
  #7822    
Old February 3rd, 2013 (09:43 PM). Edited February 3rd, 2013 by mariosr10.
mariosr10 mariosr10 is offline
 
Join Date: Jun 2012
Posts: 5
I have posted it in a wrong category so I thought about posting it in the right category!

I have searched for these problems but with no luck! :-/
I need a little help with pokescript in Fire Red!
I have two issues
1)with messages and how they appear in the rom!
e.g
Code:
#org $script
lock
faceplayer
cry 0xA1 410
#raw 0x33
pause 0x30
message $cry
$cry 1 = De-oxys!
boxset 6
wildbattle 410 10 1
pause 0x70
fadescreen 1
removesprite 0x800F
setflag 0x1211
pause 0x10
fadescreen 0
release
end
it should make the text De-oxys! appear and start the battle
when i import this compiled script via advance map to my rom i get the deoxys event but instead of saying De-oxys! it makes unreadable characters appear and then the event starts with no problems!
-------------------------------------------------------------------------------------------------------------------
2)Another problem i come across is that when i run from the battle or catch it or anyways end the battle in every way possible the deoxys stays in its place instead of disappearing!
P.S. The rom is clean i just named the folder beta 1 because i wanted to create a hack but right now the *.gba file is clean!
Thanks in advance!
  #7823    
Old February 4th, 2013 (02:57 AM).
QuartierGenerale QuartierGenerale is offline
 
Join Date: Oct 2012
Posts: 53
Hi, i'm writing a pokemart script using pksv.

All work fine but when the SELL/BUY/EXIT popup appear, the first option is not selected, and than i cannot do nothing, the play is locked and i must restart.

That's the code:

Spoiler:
#org 0x8740D2B
'-----------------------------------
lock
faceplayer
message 0x8740D42 ' Ciao
showmsg
pokemart 0x8740DBD
msgbox 0x81A0C02 ' Arrivederci!
callstd MSG_NOCLOSE ' Non-closing message
release
' Release commands close any open messages
end


#org 0x8740D42
= Ciao

#org 0x81A0C02
= Arrivederci!

#org 0x8740DBD
item TM50
item TM46
item TM27
item TM20
item TM03
endmart


ps. now there're offset instead of dynamics because i've still compile the code, but i've write it in dynamic mode.
  #7824    
Old February 4th, 2013 (03:53 AM).
tajaros's Avatar
tajaros tajaros is offline
Hi I'm dawg
 
Join Date: Apr 2012
Location: Philippines
Age: 16
Gender: Male
Nature: Timid
Posts: 857
Send a message via Windows Live Messenger to tajaros
Quote originally posted by mariosr10:
I have posted it in a wrong category so I thought about posting it in the right category!

I have searched for these problems but with no luck! :-/
I need a little help with pokescript in Fire Red!
I have two issues
1)with messages and how they appear in the rom!
e.g
Code:
#org $script
lock
faceplayer
cry 0xA1 410
#raw 0x33
pause 0x30
message $cry
$cry 1 = De-oxys!
boxset 6
wildbattle 410 10 1
pause 0x70
fadescreen 1
removesprite 0x800F
setflag 0x1211
pause 0x10
fadescreen 0
release
end
it should make the text De-oxys! appear and start the battle
when i import this compiled script via advance map to my rom i get the deoxys event but instead of saying De-oxys! it makes unreadable characters appear and then the event starts with no problems!
-------------------------------------------------------------------------------------------------------------------
2)Another problem i come across is that when i run from the battle or catch it or anyways end the battle in every way possible the deoxys stays in its place instead of disappearing!
P.S. The rom is clean i just named the folder beta 1 because i wanted to create a hack but right now the *.gba file is clean!
Thanks in advance!
I recommend you using XSE switching to it doesn't take a large amount of time since you already know Pokescript which has some same commands with XSE.

Though I use to script with it I forgot how to script in Pokescript but anyways try compiling this with XSE.
Spoiler:
#dynamic 0x800000

#org @start
lock
faceplayer
cry 0x19A 0x0
msgbox @cry 0x6
pause 0x30
waitcry
wildbattle 0x19A 0xA 0x1
pause 0x70
fadescreen 0x1
hidesprite 0x800F
setflag 0x200
pause 0x10
fadescreen 0x0
release
end

#org @cry
= De-oxys!


This should work and also I don't recommend you using flags hgher than 0x900 since they are not safe to use.
__________________
  #7825    
Old February 4th, 2013 (09:17 AM).
mariosr10 mariosr10 is offline
 
Join Date: Jun 2012
Posts: 5
@tajaros
Thanks man!That did the trick!Guess i should now move to XSE!
So, it is recommended to use flags from 200 to 900?
Does it matter if i use the flag 200 for every script i make?
Thanks again :-)
Closed Thread
Quick Reply

Sponsored Links
Thread Tools

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 UTC -8. The time now is 09:50 AM.