The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > ROM Hacking Hub
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

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.


Advertise here

Closed Thread
Click here to go to the first staff post in this thread.  
Thread Tools
  #5926    
Old July 29th, 2011, 03:16 PM
Lyzo's Avatar
Lyzo
On vacation
 
Join Date: Mar 2007
Location: The Netherlands
Age: 19
Gender: Male
Nature: Bold
Send a message via Windows Live Messenger to Lyzo

Advertise here
Quote:
Originally Posted by [T]ouko View Post
In my experience, if you want the tutorial battle, you change the third parameter to 0x3. If you want the script to continue after the battle, change the first parameter to 0x9. For example:
-beginning of script-
Trainerbattle 0x9 0x1 0x0 @before @end
Goto @continue
Release
End

#org @continue
-end of script-

For me the trainerbattle 0x 0x 0x @before @end @continue doesn't work, I think it did once, but after that I got an XSE error saying I used too kuch parameters.
If you use trainerbattle 0x1 you can continue after the battle as well, but only if you win, and this is how Gym Leaders are done... I think there's also one to continue if you lost... although I'm not sure...
__________________


Thank you The Blueprint !!!
  #5927    
Old July 29th, 2011, 05:35 PM
Thatonegurl's Avatar
Thatonegurl
Scripter
 
Join Date: Jul 2011
Location: New York, USA
Gender: Female
Nature: Quiet
Quote:
Originally Posted by Lyzo View Post
If you use trainerbattle 0x1 you can continue after the battle as well, but only if you win, and this is how Gym Leaders are done... I think there's also one to continue if you lost... although I'm not sure...
Trainerbattle 0x03 continues script after battle by default.

Trainerbattle 0x09 is the one that displays text win you win or lose.

Last edited by Thatonegurl; July 29th, 2011 at 05:38 PM. Reason: Fixed Typo
  #5928    
Old July 29th, 2011, 05:45 PM
Lyzo's Avatar
Lyzo
On vacation
 
Join Date: Mar 2007
Location: The Netherlands
Age: 19
Gender: Male
Nature: Bold
Send a message via Windows Live Messenger to Lyzo
Quote:
Originally Posted by Thatonegurl View Post
Trainerbattle 0x03 continues script after battle by default.

Trainerbattle 0x09 is the one that displays text win you win or lose.
Yup, just found 0x09 out, and posted it in one of the tutorial threads, but 0x03? don't you mean trainerbattle 0x09 0xtrainerID 0x03 @win @lose ?

Alright, so I have quite an interesting set of bugs with the following script. It's a level script I made for the heck of it to test out this. That's an instant move camera for RS. But if you combine it with some ASM posted 5 posts down, you can use it in FR as well. So that's what I did.

Here's my script:
Spoiler:
Code:
#dynamic 0x800000

#org @start
lockall
setvar 0x4033 0x1
msgbox @msg1 0x6
applymovement 0x01 @move1
waitmovement 0x0
msgbox @msg2 0x4
applymovement 0x01 @move2
waitmovement 0x0
closeonkeypress
pause 0x10
applymovement 0x01 @move3
waitmovement 0x0
msgbox @msg3 0x6
applymovement 0x01 @move4
waitmovement 0x0
msgbox @msg4 0x6
applymovement 0x01 @move5
waitmovement 0x0
msgbox @msg5 0x6
special 0x113
applymovement 0x7F @movecam1
waitmovement 0x0
msgbox @msg6 0x6
applymovement 0x7F @movecam2
waitmovement 0x0
special 0x114
fadescreen 0x1 
special 0x113
setvar 0x8002 0xA
setvar 0x8003 0x12
callasm 0x895DA1
special 0x8E
movesprite 0xFF 0xA 0x5
movesprite 0x1 0xA 0x6
special 0x114
fadescreen 0x0
pause 0x40
msgbox @msg7 0x6
fadescreen 0x1
special 0x113
setvar 0x8002 0x23
setvar 0x8003 0x08
callasm 0x895DA1
special 0x8E
movesprite 0xFF 0xA 0x5
movesprite 0x1 0xA 0x6
special 0x114
fadescreen 0x0
pause 0x40
msgbox @msg8 0x6
fadescreen 0x1
special 0x113
setvar 0x8002 0xA
setvar 0x8003 0x05
callasm 0x895DA1
special 0x8E
movesprite 0xFF 0xA 0x5
movesprite 0x1 0xA 0x6
special 0x114
fadescreen 0x0
msgbox @msg9 0x5
compare lastresult 0x1
if 0x1 goto @yes
msgbox @msg10 0x5
compare lastresult 0x1
if 0x1 goto @yes
msgbox @msg11 0x6
goto @yes
release
end

#org @yes
msgbox @msg12 0x6
showpokepic 0x07 0xA 0x03
pause 0x40
givepokemon 0x07 0xA 0x00 0x00 0x00 0x00
hidepokepic
fanfare 0x13E
msgbox @yay 0x4
waitfanfare
closeonkeypress
trainerbattle 0x1 0x001 0x0 @before @after @later
release
end

#org @later
msgbox @msg13 0x6
setweather 0x5
doweather
pause 0x30
setweather 0xD
doweather
pause 0x30
msgbox @msg14 0x6
applymovement 0x1 @end
waitmovement 0x0
hidesprite 0x1
setweather 0x2
doweather
setflag 0x200
releaseall
end

#org @msg14
= Or disappear? 

#org @msg13
= How about I change the weather?

#org @after
= See that was fun!

#org @before
= Now lets have that battle!

#org @yay
= [black_fr]You received a Squirtle!

#org @msg12
= But first you need a Pokemon.\nTake this [navyblue_fr]Squirtle[black_fr].

#org @msg11
= We're still having that battle.

#org @msg10
= Aw come on, it'll be fun!

#org @msg9
= As you can see, this town is quite\nsmall.\pHow about we have a battle?

#org @msg8
= This is my lab.

#org @msg7
= This is your rivals house.

#org @msg6
= Well, this is obviously your house.

#org @msg5 
= First I'll show you around!

#org @msg4
= I know!

#org @msg3
= What should I show you\hB0

#org @msg2
= So this script is proof that I can\nactually script.\pThroughout this script I'll show you\nwhat I'm capable of!

#org @msg1
= Oh hey \v\h01!

#org @end
#raw 0x60
#raw 0x1C
#raw 0x61
#raw 0x1C
#raw 0x60
#raw 0x1B
#raw 0x61
#raw 0x1B
#raw 0x60
#raw 0x1A
#raw 0x61
#raw 0x1A
#raw 0x60
#raw 0x19
#raw 0x61
#raw 0x19
#raw 0x60
#raw 0x18
#raw 0x61
#raw 0x18
#raw 0xFE

#org @movecam2
#raw 0x12
#raw 0x10
#raw 0xFE

#org @movecam1
#raw 0x11
#raw 0x13
#raw 0xFE

#org @move5
#raw 0x01
#raw 0xFE

#org @move4
#raw 0x62
#raw 0xFE

#org @move3
#raw 0x0
#raw 0xFE

#org @move2
#raw 0x66
#raw 0xFE

#org @move1
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x1
#raw 0xFE


So here's what goes wrong: Nothing actually
The whole script works fine, but... once it ends, I can't move. After a few seconds it says. [player] received the ????????? item. THen it comes up with the coin menu, 0 coins. Then a message box comes up with a repeating word. qÁF qÁF qÁF qÁF qÁF qÁF
Which goes on forever...

I'm not sure why this happens at all, but it seems that someone else in this thread has the same problem, so that's why I'm relating it to the instant move camera part of my script...

I know this is quite hard to solve, but if anyone has any insight into how to fix this, or any slight ideas on what it may be, help would be appreciated!
__________________


Thank you The Blueprint !!!

Last edited by Lyzo; July 30th, 2011 at 05:01 AM. Reason: Your double post has been automatically merged.
  #5929    
Old July 30th, 2011, 10:23 AM
siper x's Avatar
siper x
I'm Russia, Fear Russia
 
Join Date: Jul 2009
Age: 18
Gender: Male
Nature: Lonely
Quote:
Originally Posted by siper x View Post
One of my first scripts, and it isn’t working. Saying that shows that I know nothing about scripting, but I tried, and since I’m here, failed. Help?

Spoiler:

It is the how you get your pokemon, original pokedex, etc. script, but isn’t working. I looked at other scripts for reference and help, but it still isn’t working.

#org 0x9750439
'-----------------------------------
checkflag FR_POKEMON
if true jump 0x994382 ' Flag is set
lockall
checkflag FR_POKEMON
if false jump 0x9843675
release
end

#org 0x994382
'-----------------------------------
release
end

#org 0x9843675
'-----------------------------------
textcolor RED
applymovement PLAYER 0x94b32l6 ' walk_left walk_left...
applymovement 0x6 0x94b32l7 ' look_up_delayed e...
msgbox 0x991269D ' Hi...
addpokemon EEVEE 7 ORANBERRY 0x0 0x0 0x0
msgbox 0x991279D ' Yo...
additem TRIPASS 0x1
setflag FR_POKEDEX
setflag FR_POKEMON
msgbox 0x9943695 ' Th...
setflag FR_RUNNING_SHOES
msgbox 0x9953976 ' Go...
release
end

#org 0x94b32l6
M walk_left walk_left walk_down end

#org 0x94b32l7
M look_up_delayed end

#org 0x991269D
= Hi [player]!\nHow's it going?\pYou got a package from\nyour dad. It's an EEVEE\nand a Pokedex!

#org 0x991279D
= You also have been given\na pass to the PokeSchool!

#org 0x9943695
= This is from me.\nI hope you like it.\pObtained Running Shoes!

#org 0x9953976
= Go on now.\nMake me and your father\nproud!
Still no help. Why was i the only one skipped?
__________________
Never wish for death, but life. If you die, who will protect those precious to you?

Blood brother to Kroso
  #5930    
Old July 30th, 2011, 10:52 AM
Lyzo's Avatar
Lyzo
On vacation
 
Join Date: Mar 2007
Location: The Netherlands
Age: 19
Gender: Male
Nature: Bold
Send a message via Windows Live Messenger to Lyzo
Quote:
Originally Posted by siper x View Post
Still no help. Why was i the only one skipped?
It would help if you specified where in the script it goes wrong... And how, because it might be a setting in advancemap or your script...
__________________


Thank you The Blueprint !!!
  #5931    
Old July 30th, 2011, 01:01 PM
Hacks0rus's Avatar
Hacks0rus
Monster Raving Looney
 
Join Date: Jul 2011
Gender: Male
Nature: Timid
hello, i was wondering if anybody could help me.

[game] pokemon sapphire

i am using advancemap and PKSV

here is my problem:
whenever i attempt to change the text of an event, ie a person talking or a sign, it works. however whenever i create an event and attampt to do the same thing, it gives me this code whenever i reopen the script after compiling.

#org 0xC019974
'-----------------------------------


here was the script i compiled with:

#dyn 0x740000
#org @start
lock
faceplayer
msgbox @text ' hi
callstd MSG_NORMAL
release
end

#org @text
= hi

my compile log:
Initialized.
#DYN
-> 0x740000
#ORG
-> @start
MSGBOX
DYN-> @text
CALLSTD
-> msg_normal
-> 0x6
#ORG
-> @text
[STRING]
-> hi

#ORG: data
-> @start <-> 0x7401A8 (0xC bytes) '< I copied the numbers bit here and put it in the script offset

-> @text <-> 0x7401B4 (0x3 bytes)


and help would be much appreciated, thanks
  #5932    
Old July 30th, 2011, 03:55 PM
DavidJCobb
RESIDENT RAAAAAAAAAAAAGEMASTER
 
Join Date: Jul 2010
Gender: Male
Nature: Lonely
Quote:
Originally Posted by Hacks0rus View Post
hello, i was wondering if anybody could help me . . . i am using advancemap and PKSV

here is my problem:
whenever i attempt to change the text of an event, ie a person talking or a sign, it works. however whenever i create an event and attampt to do the same thing, it gives me this code whenever i reopen the script after compiling.

#org 0xC019974
Wait, so when you reopen the script in PKSV, you see a random offset with no script code inside?

Does the script work in-game? If so, then it sounds like a glitch in PKSV rather than a problem with your script or ROM. (Specifically, it sounds like AdvanceMap is telling PKSV to load one offset, but PKSV is loading some other random offset instead.) If the NPC does what they're supposed to when you actually play the ROM hack, then you should look into using XSE instead of PKSV; I'm told that it is more reliable and more stable.
__________________
  #5933    
Old July 31st, 2011, 01:03 AM
Hacks0rus's Avatar
Hacks0rus
Monster Raving Looney
 
Join Date: Jul 2011
Gender: Male
Nature: Timid
I loaded up my rom but the character didnt even appear in game...
thanks for the advice, i will try XSE
  #5934    
Old July 31st, 2011, 01:48 AM
ZangoMango's Avatar
ZangoMango
Unhatched Egg
 
Join Date: Jul 2011
Gender: Male
Nature: Impish
OK, so my first time using XSE, I decided to try to make a script where it looks like the player steals one of those Pokemon that walks around inside a house. The actual script is supposed to give the player that Pokemon, then make the Pokemon in the house disappear, creating the illusion that the player stole it.

Now, none of that works with my script. If you guys could tell me why, that'd be fantastic. Here's the hunka junk right here:
Spoiler:
#dynamic 0x800300

#org @start
lock

checkflag 0x828
if 0x1 goto @done
compare LASTRESULT 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @take
givepokemon 0x15 0x5 0x0 0x0 0x0 0x0
hidesprite 0x800F
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @1
= Steal the POKeMON?

#org @2
= SPEARY chirped at you.\nIt seems happy!

#org @3
= [black_fr][player] stole SPEARY!

#org @4
= [black_fr]Would you like to rename\n SPEARY?

#org @5
= What?! No! SPEARY!

#org @6
= THIEF! Give us back SPEARY!
  #5935    
Old July 31st, 2011, 02:29 AM
Spherical Ice's Avatar
Spherical Ice
Community Supporter
 
Join Date: Nov 2007
Location: UK
Send a message via Skype™ to Spherical Ice
Spoiler:
#dynamic 0x800000

#org @start
lock
checkflag 0x828
if 0x1 goto @done
msgbox @2 0x5
compare LASTRESULT 0x1
if 0x1 goto @take

release
end

#org @take
givepokemon 0x15 0x5 0x0 0x0 0x0 0x0
hidesprite 0x800F // This needs to be changed to the Person ID of the Spearow OW.
fanfare 0x13E
preparemsg @3
waitmsg
waitfanfare
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @1
= Steal the POKeMON?

#org @2
= SPEARY chirped at you.\nIt seems happy!

#org @3
= [black_fr][player] stole SPEARY!

#org @4
= [black_fr]Would you like to rename\n SPEARY?

#org @5
= What?! No! SPEARY!

#org @6
= THIEF! Give us back SPEARY!

Edited in bold. You'll probably get some errors with the nicknaming btw.
__________________
  #5936    
Old July 31st, 2011, 10:39 AM
ZangoMango's Avatar
ZangoMango
Unhatched Egg
 
Join Date: Jul 2011
Gender: Male
Nature: Impish
Ok thanks, that made it much better, it still stumbles a bit ingame though: when I talk to the Spearow, it first says Message 2 (SPEARY chirped at you. It seems happy!) which should be the result to saying "No" to Message 1 (Steal the POKeMON?); Msg1 is intended to be the first message. The good news is that Msg2 is followed by a Yes/No that, if Yes, adds the Spearow to my team. As for hidesprite, it does hide the Spearow's sprite if I leave the house and come back, but how can we make it so that it hides the sprite right on the spot when I say "Yes" to stealing it? Thanks a ton.
  #5937    
Old July 31st, 2011, 11:50 AM
Lyzo's Avatar
Lyzo
On vacation
 
Join Date: Mar 2007
Location: The Netherlands
Age: 19
Gender: Male
Nature: Bold
Send a message via Windows Live Messenger to Lyzo
Quote:
Originally Posted by ZangoMango View Post
Ok thanks, that made it much better, it still stumbles a bit ingame though: when I talk to the Spearow, it first says Message 2 (SPEARY chirped at you. It seems happy!) which should be the result to saying "No" to Message 1 (Steal the POKeMON?); Msg1 is intended to be the first message. The good news is that Msg2 is followed by a Yes/No that, if Yes, adds the Spearow to my team. As for hidesprite, it does hide the Spearow's sprite if I leave the house and come back, but how can we make it so that it hides the sprite right on the spot when I say "Yes" to stealing it? Thanks a ton.
To fix your message error:

Spoiler:
Code:
#dynamic 0x800000

#org @start
lock
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x5
compare LASTRESULT 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @take
givepokemon 0x15 0x5 0x0 0x0 0x0 0x0
hidesprite 0x800F // This needs to be changed to the Person ID of the Spearow OW.
fanfare 0x13E
preparemsg @3
waitmsg
waitfanfare
setflag 0x828
msgbox @4 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
msgbox @5 0x6
release
end

#org @name
call 0x1A74EB
return

#org @done
msgbox @6 0x6
release
end

#org @1
= Steal the POKeMON?

#org @2
= SPEARY chirped at you.\nIt seems happy!

#org @3
= [black_fr][player] stole SPEARY!

#org @4
= [black_fr]Would you like to rename\n SPEARY?

#org @5
= What?! No! SPEARY!

#org @6
= THIEF! Give us back SPEARY!


For fixing the hidesprite, are you sure you did the stuff in bold? Look up the person event number of Speary in advance map and change the 'hidesprite' part like this:

Code:
hidesprite 0xPersonEventNo.
so get rid of the 0x800F
__________________


Thank you The Blueprint !!!
  #5938    
Old July 31st, 2011, 01:14 PM
ZangoMango's Avatar
ZangoMango
Unhatched Egg
 
Join Date: Jul 2011
Gender: Male
Nature: Impish
That fixed the message problem, thanks! As for hidesprite, well, Speary's Person ID in A-Map was 0000 so I changed it to 0828, and scripted it accordingly. Is that how you do it? It does hide the sprite after I leave the house and come back, but not immediately after givepokemon gives the player Speary (the desired result).
  #5939    
Old July 31st, 2011, 01:16 PM
Surigamaru
 
 
Join Date: Oct 2010
Gender: Male
Nature: Calm
Doesn't the parameter 0x800F in hidesprite mean to hide the last sprite interacted with? I guess you should change it to the person event number which you get from A-Map, like Lyzo mentioned. And shouldn't ZangoMango set a flag, different from the Pokémon menu flag, in order for his OW Speary to completely disappear by putting the flag set in the sprite's person ID?

I haven't been much following up the scripting scenes, so if that method is either now obsolete or useless, forget what I said.

Last edited by Surigamaru; July 31st, 2011 at 01:26 PM.
  #5940    
Old July 31st, 2011, 01:47 PM
Lyzo's Avatar
Lyzo
On vacation
 
Join Date: Mar 2007
Location: The Netherlands
Age: 19
Gender: Male
Nature: Bold
Send a message via Windows Live Messenger to Lyzo
Quote:
Originally Posted by ZangoMango View Post
That fixed the message problem, thanks! As for hidesprite, well, Speary's Person ID in A-Map was 0000 so I changed it to 0828, and scripted it accordingly. Is that how you do it? It does hide the sprite after I leave the house and come back, but not immediately after givepokemon gives the player Speary (the desired result).
This is the person ID you need


Quote:
Originally Posted by Surigamaru View Post
Doesn't the parameter 0x800F in hidesprite mean to hide the last sprite interacted with? I guess you should change it to the person event number which you get from A-Map, like Lyzo mentioned. And shouldn't ZangoMango set a flag, different from the Pokémon menu flag, in order for his OW Speary to completely disappear by putting the flag set in the sprite's person ID?

I haven't been much following up the scripting scenes, so if that method is either now obsolete or useless, forget what I said.
It does, but I guess it doesn't always work, so I thought why not use the actual person ID
__________________


Thank you The Blueprint !!!
  #5941    
Old July 31st, 2011, 01:47 PM
[T]ouko's Avatar
[T]ouko
Dedicated Scripter!
 
Join Date: Jul 2011
Gender: Female
Quote:
Originally Posted by ZangoMango View Post
That fixed the message problem, thanks! As for hidesprite, well, Speary's Person ID in A-Map was 0000 so I changed it to 0828, and scripted it accordingly. Is that how you do it? It does hide the sprite after I leave the house and come back, but not immediately after givepokemon gives the player Speary (the desired result).
The ID is for the setflag method, and since the flag 828 is for the Pokémon menu this can't be used, anything from 8C3 and up can be used. The hidesprite number is the same as the applymovement number, in A-Map, at the top of the properties it will say something like People event number, that one is used for hidesprite. Most of the time you use
hidesprite 0x1
setflag 0x8C3
for example, it will hide it with hidesprite, and keep it hidden with the flag.


Edit: Aw damn, Lyzo was just a bit quicker And he has a picture
__________________


Credits to: .Mini
  #5942    
Old July 31st, 2011, 01:54 PM
ZangoMango's Avatar
ZangoMango
Unhatched Egg
 
Join Date: Jul 2011
Gender: Male
Nature: Impish
Haha, ok that worked. Thanks for helping me steal the Pokemon of others everyone! You are true good samaritans.
  #5943    
Old July 31st, 2011, 02:07 PM
Surigamaru
 
 
Join Date: Oct 2010
Gender: Male
Nature: Calm
I have a question now. Is there a looping method in XSE's interface? To further elaborate my point, assume this piece of code:

Code:
#dynamic 0xoffset

#org @beginScript
...
...
call @one
call @one
call @one
call @one
...
...
end

#org @one
...
...
end
Instead of repeating call @one four times for example, is there a way to, in one command, call that function several times? Something similar do the while/do loop in C.
  #5944    
Old July 31st, 2011, 02:10 PM
[T]ouko's Avatar
[T]ouko
Dedicated Scripter!
 
Join Date: Jul 2011
Gender: Female
Quote:
Originally Posted by Surigamaru View Post
I have a question now. Is there a looping method in XSE's interface? To further elaborate my point, assume this piece of code:

Code:
#dynamic 0xoffset

#org @beginScript
...
...
call @one
call @one
call @one
call @one
...
...
end

#org @one
...
...
end
Instead of repeating call @one four times for example, is there a way to, in one command, call that function several times? Something similar do the while/do loop in C.
You're saying you want to loop it? Why don't you just do this:

Code:
#org @start
-Code-
goto @start
end
Or do you mean something else?
__________________


Credits to: .Mini
  #5945    
Old July 31st, 2011, 02:16 PM
Surigamaru
 
 
Join Date: Oct 2010
Gender: Male
Nature: Calm
Yes, I want to loop it. But your example jumps to the start of the script once; by loop, I want to call a certain function from the main function, in my case @beginScript, several times without having to use call @one many times, like my previous example. Like, call @one 0x9, where 0x9 stands for the amount of times I want to call that function (example).

I'm guessing something similar to this might work:

Code:
#org @beginScript
...
setvar 0x700E 0x0
...
compare 0x700E 0x6
if <= call @one
...
...
end

#org @one
addvar 0x700E 0x1
...
return
My scripting is a little rusty at the moment, so the above snippet might be horribly wrong. Bare with me, if you may.
  #5946    
Old July 31st, 2011, 02:22 PM
[T]ouko's Avatar
[T]ouko
Dedicated Scripter!
 
Join Date: Jul 2011
Gender: Female
Quote:
Originally Posted by Surigamaru View Post
Yes, I want to loop it. But your example jumps to the start of the script once; by loop, I want to call a certain function from the main function, in my case @beginScript, several times without having to use call @one many times, like my previous example. Like, call @one 0x9, where 0x9 stands for the amount of times I want to call that function (example).

I'm guessing something similar to this might work:

Code:
#org @beginScript
...
setvar 0x700E 0x0
...
compare 0x700E 0x6
if <= call @one
...
...
end

#org @one
addvar 0x700E 0x1
...
return
My scripting is a little rusty at the moment, so the above snippet might be horribly wrong. Bare with me, if you may.
Well, does this come close?

Code:
#org @start
compare 0x7000 0x5
if 0x1 goto @continue
addvar 0x7000 0x1
goto @start
end

#org @continue
rest of script when 7000 = 5
__________________


Credits to: .Mini
  #5947    
Old July 31st, 2011, 02:30 PM
Surigamaru
 
 
Join Date: Oct 2010
Gender: Male
Nature: Calm
Touché (not in its place, but I don't care). Thank you, [T]ouko. I hope my question wasn't that blatant. It's close to what I was looking for; might tweak it a bit.
  #5948    
Old July 31st, 2011, 02:36 PM
[T]ouko's Avatar
[T]ouko
Dedicated Scripter!
 
Join Date: Jul 2011
Gender: Female
Quote:
Originally Posted by Surigamaru View Post
Touché (not in its place, but I don't care). Thank you, [T]ouko. I hope my question wasn't that blatant. It's close to what I was looking for; might tweak it a bit.
Haha, and you're welcome, glad I could help :D
__________________


Credits to: .Mini
  #5949    
Old August 1st, 2011, 03:22 AM
Hacks0rus's Avatar
Hacks0rus
Monster Raving Looney
 
Join Date: Jul 2011
Gender: Male
Nature: Timid
Ok, back now with yet more problems.

I changed my rom to fire red because Sapphire just wasnt working for me.

i got this script to work:
Spoiler:
'-----------------------
#org 0x71A294
lock
faceplayer
msgbox 0x871A2F8 '"Hi"
callstd 0x3
release
end


'---------
' Strings
'---------
#org 0x71A2F8
= Hi


but whenever i try a simple script from the tutorials on the forum, the character appears, the message box sound is heard but no message box comes up?

Script:
Spoiler:
#dynamic 0x71A294
#org @start
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= Hi.\nMy name is Richard.
  #5950    
Old August 1st, 2011, 04:53 AM
toeter
Beginning Trainer
 
Join Date: Jul 2010
Gender: Male
Hello, I would like to change the battle background music of a trainer. It's a script in PKSV. Is there a command that lets you change the background music?

Here is my Script:

Spoiler:
#dyn 0x800000
#org @start

lockall
faceplayer
setvar 0x4001 0x0
jump @main

#org @main
textcolor BLUE
playsound 0x0 0x11D
reappear 0xA
msgbox @talk
callstd MSG_NOCLOSE
closemsg
applymovement 0xA @walk
pauseevent 0x0
message @question
callstd MSG_YESNO
compare LASTRESULT YES
if == call @pushedyes
compare LASTRESULT NO
if == call @pushedno
trainerbattle 0x9 0x2 0x0 @win @lose
msgbox @speak
callstd MSG_NOCLOSE
closemsg
pause 0xA
playsound 0x0 0x112
compare 0x4001 0x0
if == call @move1
compare 0x4001 0x1
if == call @move2
compare 0x4001 0x2
if == call @move1
compare 0x4001 0x3
if == call @move2
fadedefault
disappear 0xA
setvar 0x601A 0x1
releaseall
end

#org @pushedyes
message @yes
callstd MSG_NORMAL
return

#org @pushedno
message @no
callstd MSG_NORMAL
return

#org @move1
applymovement 0xA @away1
pauseevent 0x0
return

#org @move2
applymovement 0xA @away2
pauseevent 0x0
return

#org @talk
= Stop right there!

#org @question
= Your name is \v\h01,\nam I right?

#org @yes
= Then prepare to fight!

#org @no
= Either way, \nprepare to fight!

#org @win
= Lucky you.

#org @lose
= Ha, I knew it.

#org @speak
= I'm going to report this.

#org @walk
M walk_down walk_down walk_down walk_down walk_down end

#org @away1
M walk_right walk_down walk_down walk_down walk_down walk_down walk_down walk_down end

#org @away2
M walk_left walk_down walk_down walk_down walk_down walk_down walk_down walk_down end
Closed Thread
Quick Reply

Sponsored Links


Advertise here
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 06:44 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 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 - 2014 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.