• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

siper x

I'm Russia, Fear Russia
375
Posts
14
Years
  • Age 28
  • Seen Mar 29, 2023
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:
Still no help. Why was i the only one skipped?
 

Hacks0rus

Monster Raving Looney
24
Posts
12
Years
  • Seen Nov 9, 2012
help needed

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
 
275
Posts
13
Years
  • Seen Oct 9, 2019
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.
 

Hacks0rus

Monster Raving Looney
24
Posts
12
Years
  • Seen Nov 9, 2012
I loaded up my rom but the character didnt even appear in game...
thanks for the advice, i will try XSE
 
42
Posts
12
Years
  • Seen Aug 23, 2022
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. :cool: If you guys could tell me why, that'd be fantastic. Here's the hunka junk right here:
Spoiler:
 
5,256
Posts
16
Years
Spoiler:

Edited in bold. You'll probably get some errors with the nicknaming btw.
 
42
Posts
12
Years
  • Seen Aug 23, 2022
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.
 

Lyzo

Back from vacation
261
Posts
17
Years
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:

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
 
42
Posts
12
Years
  • Seen Aug 23, 2022
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).
 
85
Posts
13
Years
  • Age 32
  • Seen Aug 21, 2014
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:

Lyzo

Back from vacation
261
Posts
17
Years
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
people%20event%20num.jpg


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 :)
 

[T]ouko

Dedicated Scripter!
46
Posts
12
Years
  • Seen Jul 9, 2013
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 :P And he has a picture :P
 
42
Posts
12
Years
  • Seen Aug 23, 2022
Haha, ok that worked. Thanks for helping me steal the Pokemon of others everyone! You are true good samaritans.
 
85
Posts
13
Years
  • Age 32
  • Seen Aug 21, 2014
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.
 

[T]ouko

Dedicated Scripter!
46
Posts
12
Years
  • Seen Jul 9, 2013
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?
 
85
Posts
13
Years
  • Age 32
  • Seen Aug 21, 2014
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.
 

[T]ouko

Dedicated Scripter!
46
Posts
12
Years
  • Seen Jul 9, 2013
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
 
85
Posts
13
Years
  • Age 32
  • Seen Aug 21, 2014
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.
 

[T]ouko

Dedicated Scripter!
46
Posts
12
Years
  • Seen Jul 9, 2013
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
 
Status
Not open for further replies.
Back
Top