• 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?".
  • 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.
910
Posts
13
Years
I just need a quick answer hah.
So I've written out my script and i've got my flags in place but when i go out of the map and back in and I walk on the script tile the script starts again, if i have everything in the correct order (or at least i think i do) i don't know what i've got wrong. Help?
 

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
the flags have to have the following order:

in the very n=beginning of the script, use checkflag 0xflag number
then use 'if 0x1 goto @pointer'
now remember to make the pointer you placed in the if command, and in it, use only release and end. and at the end of the original script, use setflag 0xflag number.

best use flags above 1000, almost all those under 1000are already used, and might glitch up your game if used.
 
910
Posts
13
Years
the flags have to have the following order:

in the very n=beginning of the script, use checkflag 0xflag number
then use 'if 0x1 goto @pointer'
now remember to make the pointer you placed in the if command, and in it, use only release and end. and at the end of the original script, use setflag 0xflag number.

best use flags above 1000, almost all those under 1000are already used, and might glitch up your game if used.

I have all that right i think.
Maybe you can pick out the problem
this is my main script anyway

Spoiler:
 

Crimson Stardust

Anime Addiction
1,319
Posts
15
Years
I have a question,
How do i exactly make the script like you know for the beginning of the hack where you and your rival need to choose a starter.
Like how do i make so that the rival pick out the one that have the elements againts, like if i picked fire he pick water..
And also in the future battle how do i make so that the battle involves the pokemon which the rival picked? since it can be any 3 according to how the player choose..

Is using flags be use for all this?
Then how is the future battle made? like the trainer stats like how i am gonna edit the trainer to have the pokemon the elements against..must i use a-trainer to have the rival 3 types with each different element?

Kind confusing i know, i myself finds it hard to type..haha
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
I have a question,
How do i exactly make the script like you know for the beginning of the hack where you and your rival need to choose a starter.
Like how do i make so that the rival pick out the one that have the elements againts, like if i picked fire he pick water..
And also in the future battle how do i make so that the battle involves the pokemon which the rival picked? since it can be any 3 according to how the player choose..

Is using flags be use for all this?
Then how is the future battle made? like the trainer stats like how i am gonna edit the trainer to have the pokemon the elements against..must i use a-trainer to have the rival 3 types with each different element?

Kind confusing i know, i myself finds it hard to type..haha

You just use a variable or flags and then check it during the rival scripts and then run a different battle depending on the value. There's no other way around it, really.
 

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
I have all that right i think.
Maybe you can pick out the problem
this is my main script anyway

Spoiler:

ok first off, like i said, use flags above a 1000, i'm pretty sure flag A is already used, and if some guide says otherwise, those lists are somethimes wrong, but almost no flags above a thousand are used, but use flags above 2000 just to be sure. So instead of checkflag 0xA and setflag 0xS, use checkflag 0x2001 and setflag 0x2001. That's safer. Secondly, instead of
msgbox @talk
callstd 0x6

just use msgbox @talk 0x6 (if you're using the new XSE), its much easier (both work, but just take shorcuts) and as for prites 4 5 and 6, is the flag you set put in their person ID field box ? it should. so make it 2001 if you decide to take my advice on flags.

and don't use waitmsgbox 0x0, for only one simple reason, it doesn't exist !! you don't even have to use any wait command, the game has a built i' wait till message is done to continue' feature. lol.

this should make the script work, and only happen once, hey, you see the link that says tutorial part 1 and part 2 in my sig, go to part 1, and read the scripting part, then continue to part 2, it should help you overcome your scripting probs.
 

Envi

Full Metal Fangirl
6
Posts
13
Years
Scripting movement in Ruby.

Ok so I have been browsing alot of scripting tutorials and I have found that most of the ones I look at are directed towards FireRed and totally skip out on how to script movements.

I am currently trying to make a script in Pokemon Ruby where the player's character steps on a tile, and then they are forced to walk to a certain spot and talk to a certain person.

I started with this script to test it, but the game freezes whenever I step on the area where the script is. It looks like this:

#org 0x814E948
'-----------------------------------
lockall
msgbox 0x816D10E ' Test
callstd MSG_NOCLOSE ' Non-closing message
closemsg
movesprite 0x2 0xF 0x3
applymovement PLAYER 0x814EA2C ' walk_up walk_up walk...
msgbox 0x816D119 ' Testing
callstd MSG_NOCLOSE ' Non-closing message
closemsg
setvar 0x4060 0x2
releaseall
end


#org 0x816D10E
= Test

#org 0x816D119
= Testing

#org 0x814EA2C
M walk_up walk_up walk_up walk_up walk_up walk_up walk_up walk_up end


Could anyone tell me what I am doing wrong here? Its very important because having patches of script like this are the basis of my hack and if I can figure this out then I am screwed.
 
910
Posts
13
Years
ok first off, like i said, use flags above a 1000, i'm pretty sure flag A is already used, and if some guide says otherwise, those lists are somethimes wrong, but almost no flags above a thousand are used, but use flags above 2000 just to be sure. So instead of checkflag 0xA and setflag 0xS, use checkflag 0x2001 and setflag 0x2001. That's safer. Secondly, instead of
msgbox @talk
callstd 0x6
...
...
...
this should make the script work, and only happen once, hey, you see the link that says tutorial part 1 and part 2 in my sig, go to part 1, and read the scripting part, then continue to part 2, it should help you overcome your scripting probs.

Okay i changed the flags just to be safe.
I'm using an older version of xse and i just can't be bothered getting the new version right now hah so i have to use callstd hah.
Some tutorial thing on youtube told me to use waitmsgbox hah that is awkward.

I've checked out your tutorials and learnt a few things (thanks) but it still repeats itself i think i might start a new script instead and hopefully that'll work instead :)

Thanks again hahah.
 

TheZerox9

That's Right
10
Posts
13
Years
It is fine until I add another text box after: msgbox 0x831DB3F '"\c\h01Á[player] and [rival] receive..."
callstd 0x6
(yes, i included it at the bottom with a working offset) as soon as i compile, the final movement screws up. every time i fix it, it goes back. Help?

'-----------------------
#org 0x31D81D
applymovement MOVE_PLAYER 0x831D8AA
applymovement 0x1 0x831D8AE
waitmovement 0x0
msgbox 0x831D8B2 '"\c\h01ÇADMIN BONNIE: All right,\nki..."
callstd 0x6
applymovement 0x1 0x831D93D
waitmovement 0x0
applymovement MOVE_PLAYER 0x831D941
waitmovement 0x0
msgbox 0x831D945 '"\c\h01Ë[rival]: Hey!! You mean[.] w..."
callstd 0x6
applymovement MOVE_PLAYER 0x831DA0D
msgbox 0x831DA10 '"\c\h01ÇBONNIE: So, who are you two?..."
callstd 0x6
fanfare 0x13E
waitfanfare
msgbox 0x831DB3F '"\c\h01Á[player] and [rival] receive..."
callstd 0x6
applymovement 0x2 0x831DCAF
waitmovement 0x0
hidesprite 0x2
applymovement 0x1 0x831DCB4
applymovement MOVE_PLAYER 0x831DCB7
waitmovement 0x0
msgbox 0x831DCBA '"\c\h01Ë[rival]: Hey, [player], I'm ..."
callstd 0x6
applymovement MOVE_PLAYER 0x831DD3E
waitmovement 0x0
applymovement 0x1 0x831DD41
waitmovement 0x0
hidesprite 0x1
writebytetooffset 0x11 0x11116CFE


'-----------
' Movements
'-----------
#org 0x31D8AA
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw FE 'End of Movements

#org 0x31D8AE
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw FE 'End of Movements

#org 0x31D93D
#raw 65 'Double Exclamation Mark (!!)
#raw 53 'Jump in Place (Facing Up)
#raw FE 'End of Movements

#org 0x31D941
#raw 3 'Face Right
#raw 63 'Question Mark (?)
#raw FE 'End of Movements

#org 0x31DA0D
#raw 1 'Face Up
#raw FE 'End of Movements

#org 0x31DCAF
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw FE 'End of Movements

#org 0x31DCB4
#raw 1F 'Step Left (Fast)
#raw FE 'End of Movements

#org 0x31DCB7
#raw 3 'Face Right
#raw FE 'End of Movements

#org 0x31DD3E
#raw 1 'Face Up
#raw FE 'End of Movements

#org 0x31DD41
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw FE 'End of Movements


'---------
' Strings
'---------
#org 0x31D8B2
= \c\h01ÇADMIN BONNIE: All right,\nkiddies! First mission!\pWe won't go easy on you.\pYou're about to go mano-a-mano\nwith supernatural phenomena.

#org 0x31D945
= \c\h01Ë[rival]: Hey!! You mean[.] we're\ngoing to visit the SAFFRON GYM?!\p\c\h01ÇBONNIE: What? No, don't be\nridiculous.\pEven we ADMIN have trouble with\nSABRINA's PSYCHICS.\pYou're going to LAVENDER TOWN.\p\c\h01Ë[rival]: Oh[.]

#org 0x31DA10
= \c\h01ÇBONNIE: So, who are you two?\p[.]\pAh, the infamous [player] and \n[rival]. I heard you two were quite\lthe troublemakers as TRAINEES.\pGood.\pWe've got three GRUNTS in POKéMON\nTOWER rounding up CUBONE.\pThey're reporting trouble, in the\nform of a mother MAROWAK.\pYou two are going to check it out.\nHere, take these.

#org 0x31DB3F
= \c\h01Á[player] and [rival] received two\nWEIRD RED BRICKY THINGAMABOBS!

#org 0x31DCBA
= \c\h01Ë[rival]: Hey, [player], I'm gonna\nfind us some better POKéMON before\lwe head to LAVENDER TOWN. Meet me\loutside when you're done in here.

whoops! first line was cut off! It is fire red, XSE, and a script box.

whoops! first line was cut off! It is fire red, XSE, and a script box.
 
Last edited:
9
Posts
12
Years
  • Seen Oct 17, 2013
Hi guys, im pretty new here, so i have a quick question.
When I Compile a script, it's works and everything. But, if I want to change the script, and I compile it, it does the old script. So everytime I want to change the script, i have to delete the person event in AdvanceMap, and re-do it? (Because thats what im doing)
Isn't there any quicker solution for this?
 
Last edited:

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Hi guys, im pretty new here, so i have a quick question.
When I Compile a script, it's works and everything. But, if I want to change the script, and I compile it, it does the old script. So everytime I want to change the script, i have to delete the person event in AdvanceMap, and re-do it? (Because thats what im doing)
Isn't there any quicker solution for this?

You just have to change the script offset in AMap to the new location that it gets compiled to.
 
9
Posts
12
Years
  • Seen Oct 17, 2013
So, it's not possible to just change the script under an offset?
So let's see, there is a script with offset "a". It contains the next: "Text one"
But, i want the script with offset "a" change to "text two", i must create a new offset?
 
43
Posts
14
Years
  • Seen Jan 26, 2018
I hope this is a simple question... So I have been working on this hack for a long while now, and I just recently reset the game and tried to play through what i have hacked.
The problem is, when I walk out of my house. This text box appears that won't go away.

WTF.png


This is the level script (type 3)
'---------------
#org 0x165465
setworldmapflag 0x890
checkflag 0x291
if 0x1 call 0x8165488
compare 0x4070 0x0
if 0x1 call 0x81654A8
compare 0x4070 0x1
if 0x1 call 0x81654A2
end

'---------------
#org 0x165488
checkflag 0x83E
if 0x0 goto 0x81A77A9
compare 0x4070 0x1
if 0x4 goto 0x81A77A9
setvar 0x4070 0x1
return

'---------------
#org 0x1654A8
checkflag 0x291
if 0x1 goto 0x81654BD
movesprite2 0x1 0x5 0xF
spritebehave 0x1 0x7
return

'---------------
#org 0x1654A2
setvar 0x4070 0x2
return

'---------------
#org 0x1A77A9
return

'---------------
#org 0x1654BD
movesprite2 0x1 0xC 0x2
spritebehave 0x1 0x8
setvar 0x4002 0x1
return
 
Last edited:
9
Posts
12
Years
  • Seen Oct 17, 2013
Hi guys, I have a small problem. I'd like to make an npc what gives you a Mew. The problem is, somewhy the script doesn't work. (Of course, I tried another offset instead of "gimmethatgoddampokemon")

#dynamic 0x802530

#org @gimmethatgoddampokemon
givepokemon 0x97 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox 0x802840 0x4
waitfanfare
closeonkeypress
setflag 0x200
release
end

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x880255D
msgbox 0x8802549 0x5
compare 0x800D 0x1
if 0x1 goto @gimmethatgoddampokemon
msgbox 0x802830 0x6
release
end

#org 0x802830
= Oh, that's okay. I guess I'll have\nto find some other people to look\lafter for my Legendary, really\lrare, only one pokemon!


#org 0x80255D
msgbox 0x880256D 0x6
release
end

#org 0x802549
= As You can see, I will go away\pfrom this peaceful island. I want\pyou to take care of my little Mew!\pWill you do this for me?

#org 0x80256D
= Do you take good care of my Mew?


#org 0x802840
= [black_fr]You received a Mew!

If i decompile it, it shows the next:
'---------------
#org 0x802530
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x880255D
msgbox 0x8802549 0x5 '"As You can see, I will go away\pfr..."
compare 0x800D 0x1
if 0xBB goto 0xE3D300E7
'---------------
#org 0x80255D

'---------
' Strings
'---------
#org 0x802549
= As You can see, I will go away\pfrom Do you take good care of my Mew?

As you can see, the whole script is messed up somewhere, but I can't find it where. Any help would be appreciated:3
 
Last edited:

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
So, it's not possible to just change the script under an offset?
So let's see, there is a script with offset "a". It contains the next: "Text one"
But, i want the script with offset "a" change to "text two", i must create a new offset?
No. You can open the script with XSE via Advance Map. Once the script at a particular offset is opened, press the decompile button (should be somewhere on the toolbar) and then edit the script. You can't edit the script without decompiling. Once you're happy with what you've edited, compile the script.

If you're going to add major changes, I would suggest writing a new script though.
I hope this is a simple question... So I have been working on this hack for a long while now, and I just recently reset the game and tried to play through what i have hacked.
The problem is, when I walk out of my house. This text box appears that won't go away.

WTF.png


This is the level script (type 3)
'---------------
#org 0x165465
setworldmapflag 0x890
checkflag 0x291
if 0x1 call 0x8165488
compare 0x4070 0x0
if 0x1 call 0x81654A8
compare 0x4070 0x1
if 0x1 call 0x81654A2
end

'---------------
#org 0x165488
checkflag 0x83E
if 0x0 goto 0x81A77A9
compare 0x4070 0x1
if 0x4 goto 0x81A77A9
setvar 0x4070 0x1
return

'---------------
#org 0x1654A8
checkflag 0x291
if 0x1 goto 0x81654BD
movesprite2 0x1 0x5 0xF
spritebehave 0x1 0x7
return

'---------------
#org 0x1654A2
setvar 0x4070 0x2
return

'---------------
#org 0x1A77A9
return

'---------------
#org 0x1654BD
movesprite2 0x1 0xC 0x2
spritebehave 0x1 0x8
setvar 0x4002 0x1
return
I believe the solution to your problem can be found here.


Hi guys, I have a small problem. I'd like to make an npc what gives you a Mew. The problem is, somewhy the script doesn't work. (Of course, I tried another offset instead of "gimmethatgoddampokemon")

#dynamic 0x802530

#org @gimmethatgoddampokemon
givepokemon 0x97 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox 0x802840 0x4
waitfanfare
closeonkeypress
setflag 0x200
release
end

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x880255D
msgbox 0x8802549 0x5
compare 0x800D 0x1
if 0x1 goto @gimmethatgoddampokemon
msgbox 0x802830 0x6
release
end

#org 0x802830
= Oh, that's okay. I guess I'll have\nto find some other people to look\lafter for my Legendary, really\lrare, only one pokemon!


#org 0x80255D
msgbox 0x880256D 0x6
release
end

#org 0x802549
= As You can see, I will go away\pfrom this peaceful island. I want\pyou to take care of my little Mew!\pWill you do this for me?

#org 0x80256D
= Do you take good care of my Mew?


#org 0x802840
= [black_fr]You received a Mew!

If i decompile it, it shows the next:
'---------------
#org 0x802530
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x880255D
msgbox 0x8802549 0x5 '"As You can see, I will go away\pfr..."
compare 0x800D 0x1
if 0xBB goto 0xE3D300E7
'---------------
#org 0x80255D

'---------
' Strings
'---------
#org 0x802549
= As You can see, I will go away\pfrom Do you take good care of my Mew?

As you can see, the whole script is messed up somewhere, but I can't find it where. Any help would be appreciated:3
First of all, use appropriate pointers. Not something as confusing as gimmethatgoddampokemon. :/
Also, while writing a new script, try not to use real offsets. By real offsets, I'm referring to those strings of hex numbers. Use pointers like @1, @2, etc. unless you really know what that offset contains, or if the offset is free.
Lastly, try compiling the script again in some free space.
 
9
Posts
12
Years
  • Seen Oct 17, 2013
First of all, use appropriate pointers. Not something as confusing as gimmethatgoddampokemon. :/
Also, while writing a new script, try not to use real offsets. By real offsets, I'm referring to those strings of hex numbers. Use pointers like @1, @2, etc. unless you really know what that offset contains, or if the offset is free.
Lastly, try compiling the script again in some free space.[/FONT][/QUOTE]

Well, I tried, and it's helped with the pointers, thank you:b (Actually, I had to compile to a new offset, because with the old one it didn't work. But thank you :D!
 

Crimson Stardust

Anime Addiction
1,319
Posts
15
Years
Ok another quick question...

it sound's simple i think but i don't know why i can't seem to know or get how to do this..

Basically i have a o/w like when you first talk to him he will say like there is someone standing outside the door.
Then you walk near the house and a script tile will activate where an event will occur.
The thing i want to do is that the event will make so that the someone infront of the door go inside of the house[ Which i use a hidesprite to make him dessapear ],
then i put a applymovement at the guy[ who wassaying that someone is outside the door] so that he moved outside the door now.

What i want is that he stay there even after the script is done but after the tile script finish he went back to the spot before the applymovement since the movement only occurs during the script and i put a flag to make it work once..
So how do i make it so that the guy will move to the spot after the event occur?
Make another script? for the guy?

Just know that the guy need to be outside the door without you interacting with him, this happen right after the event.

I don't need anyone to make the script for me, just tell me how to go about it..lol
 
29
Posts
12
Years
  • Seen Sep 9, 2014
#dynamic 0x800000

#org @get
givepokemon 0x0A 0x5 0x0 0x0 0x0 0x0
end

#dynamic 0x800000

#org @catch

removeitem 0x4 0x1
end

'Strings
#org @talk
= You caught a Caterpie!

I'm replacing a person in Viridian Forest, and I gave him this script. I changed the sprite to 92, the Poké Ball.

However, the script always reverts to the original script.

Does the script work? And why does it keep reverting?
 
Status
Not open for further replies.
Back
Top