- 1
- Posts
- 11
- Years
- Seen Oct 15, 2013
Game: FireRed Editor: XSE
I want to create a person event script where you talk to a guy and he tells you 'now playing sound X' and plays that sound at the same time. The next time you talk to him, he plays sound X + 1. So on and so forth throughout all the sounds in the game that are called by the 'sound 0x01' command.
Right now all I can think of doing is using a variable, adding one to the variable each time the sound is played. A flag check is used for the first time you talk to him to set the variable to 0x0. All I can think of doing from there is ham-handedly throwing in [variable 0x5000] in where I want it to go, but I know that's not going to make it work.
Disclaimer: I know I cannot put #org scripts so close to eachother. The above is an example with simpler numbers to be easier to read.
I want to create a person event script where you talk to a guy and he tells you 'now playing sound X' and plays that sound at the same time. The next time you talk to him, he plays sound X + 1. So on and so forth throughout all the sounds in the game that are called by the 'sound 0x01' command.
Right now all I can think of doing is using a variable, adding one to the variable each time the sound is played. A flag check is used for the first time you talk to him to set the variable to 0x0. All I can think of doing from there is ham-handedly throwing in [variable 0x5000] in where I want it to go, but I know that's not going to make it work.
Spoiler:
#org 0x800000
checkflag 0x1000
if 0x1 goto #0x800001
setflag 0x1000
setvar 0x5000 0x0
sound 0x[variable 0x5000]
msgbox 0x800002 0x2
addvar 0x5000 0x1
end
#org 0x800001
sound 0x[variable 0x5000]
msgbox 0x800001 0x2
addvar 0x5000 0x1
end
#org 0x800002
= now playing sound [variable 0x5000].
checkflag 0x1000
if 0x1 goto #0x800001
setflag 0x1000
setvar 0x5000 0x0
sound 0x[variable 0x5000]
msgbox 0x800002 0x2
addvar 0x5000 0x1
end
#org 0x800001
sound 0x[variable 0x5000]
msgbox 0x800001 0x2
addvar 0x5000 0x1
end
#org 0x800002
= now playing sound [variable 0x5000].
Disclaimer: I know I cannot put #org scripts so close to eachother. The above is an example with simpler numbers to be easier to read.