• 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.
2
Posts
11
Years
  • Seen May 19, 2012
Game: FireRed
Type: Level Script
Editor: XSE
Script:
Spoiler:
So, what I'm trying to do is get the player to walk up to where Oak and the Spearow are after exiting his house for the first time. The script itself will run without error, though I can't seem to get it to run as a level script, so I imagine I'm setting it up wrong.

Level script set up:
i.imgur [DOT] com/bkEaH.png

Video: screencast-o-matic [DOT] com/watch/clhqoQECu
Here you can see that the script itself works, but it isn't being executed upon entering the map as a level script should.

So, where am I messing up at?
 
54
Posts
13
Years
  • Seen Jul 5, 2013
Did you compile the level script itself (the one found at 71AA78)?

I don't remember clearly, but sometimes this is the cause of the level script not working.
 
5,256
Posts
16
Years
Sleepy Head, you need to upgrade your version of XSE to 1.1 (click me!)

Your script will then have to be upgraded to 1.1's syntax, like so:
Code:
#dynamic 0x800000

#org @start
msgbox @string1 0x6
applymovement MOVE_PLAYER @move1
waitmovement 0x0
msgbox @string2 0x6
setvar 0x5001 0x1
release
end


'-----------
' Movements
'-----------
#org @move1
#raw 62 'Exclamation Mark (!)
#raw 20 'Step Right (Fast)
#raw 20 'Step Right (Fast)
#raw 20 'Step Right (Fast)
#raw 20 'Step Right (Fast)
#raw 20 'Step Right (Fast)
#raw 20 'Step Right (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw 1E 'Step Up (Fast)
#raw FE 'End of Movements


'---------
' Strings
'---------
#org @string1
= HEEEEELP!

#org @string2
= [player]!\nThis SPEAROW is attacking me!\lQUICK! Go get one of the POKEMON\loff of my desk!
 
2
Posts
11
Years
  • Seen May 19, 2012
Did you compile the level script itself (the one found at 71AA78)?

I don't remember clearly, but sometimes this is the cause of the level script not working.
Pulled into XSE and compiled, but no luck.

Sleepy Head, you need to upgrade your version of XSE to 1.1
Thanks! Unfortunately, upgrading XSE did not affect my problem, although I'm sure it'll save me some headache later on.

EDIT: Haha, whoops. I had the default script in, too. I removed that from the Header menu and my script started working.

Thanks for the help, though, guys!
 
Last edited:
30
Posts
14
Years
  • Seen Jul 27, 2012
So I recently downloaded a hacked fire red engine, and applied it to my already in progress hack. Needless to say it deletes all scripts already in the game, as well as some that were already in my hack (all I had to do was re insert them). For things like the strength boulders and what not I can just easily re-insert the scripts, however there's 2 scripts I currently am desperate for.

The pokemart and pokecenter scripts

I have no clue how to use these, I figure I could simply re insert the mart ones perhaps if I wanted the same items, however it would seem that the fire red engine hack I have implimented changes the way pokemon centers are done or something.

I know I'm not supposed to request scripts, which I'm not entirely doing, I'm jsut wondering how I go about implementing the correct commands to heal, and make the screen flash, set it to be a place you can respawn at, etc.

Thanks, sorry for the lack of information, I just have no where else to turn and find it very difficult to test a hack without healing or items.
 

droomph

weeb
4,285
Posts
12
Years
Look from a clean ROM. Decompile the scripts you want on XSE or whatever you use, and then save them. Then compile them back in the ROM you want the scripts in, and use them as you like.

To make this easy for you, just choose the "decompile as pointers" setting and save it. That way you don't have to deal with the jumps and multiple scripts.

Then, if you do that, remember to record down the compiled offset!
 
30
Posts
14
Years
  • Seen Jul 27, 2012
Look from a clean ROM. Decompile the scripts you want on XSE or whatever you use, and then save them. Then compile them back in the ROM you want the scripts in, and use them as you like.

To make this easy for you, just choose the "decompile as pointers" setting and save it. That way you don't have to deal with the jumps and multiple scripts.

Then, if you do that, remember to record down the compiled offset!

thanks, I know how to do that though.
Basically I need a template of a pokemon centre healing script.
 
30
Posts
14
Years
  • Seen Jul 27, 2012
Find a PC on AMap, select the Nurse's sprite, and record what offset her script is and work from there.

Alright this isn't getting anywhere.
I heard about this whole poke center thing where they're tied to fly blocks and something, and this engine I put in changed the way the whole thing works.

I need a template for the engine hack.
 

Kaith

Hacker of Fire
49
Posts
12
Years
Alright this isn't getting anywhere.
I heard about this whole poke center thing where they're tied to fly blocks and something, and this engine I put in changed the way the whole thing works.

I need a template for the engine hack.

I'm pretty sure you and I are in the same boat here. I applied a patch to fire red that did the exact same thing. I'm working on rewriting the Nurse Joy script right now and so far it works perfect until I get to the line that says: I've restored your Pokemon to full health. Then the screen goes haywire for awhile.

I pulled this script from a clean Fire Red and repointed everything, and I can't seem to figure out where I went wrong. (If it's a tiny error please forgive me scripting gods! I am still a newbie when it comes to scripting!)

Spoiler:
 

Jean LaFlame

French chic ♪
6
Posts
12
Years
  • Seen Jun 20, 2012
Well, I'm not sure this goes here...
I'd want to know what the spritebehave command is. What does it exactly do?
Thank you in advance.
 
29
Posts
15
Years
  • Seen Feb 10, 2013
Ugh I hate to ask two questions in one day, but I'm not very good at applymovements and this has me stumped :(

Script:
Spoiler:


Now, I have another sprite somewhere else that sets the flag so flags are not an issue, my problem is that after the NPC moves off the screen my character is still locked. Other guys are still animated and stuff, the game hasn't frozen, but none of my buttons do anything. I know that it's a problem with waitmovement 0x0, because when I remove that line he disappears right away, which is the line below waitmovement, and then I can move.

AFAIK the script is correct, no compilation errors, and he actually moves, my character's just locked.

EDIT:
Alright, after a VERY long time of just sitting there, a menu appears on the top left of my screen with the options BUY and QUIT. My controls are still locked and the game appears to be frozen, but not crashing.
 
Last edited:
90
Posts
11
Years
  • Seen Aug 21, 2013
When you click yes it unlocks and it doesn't tell you the rest unless you talk to it again.
Spoiler:
 
Last edited:

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
Ugh I hate to ask two questions in one day, but I'm not very good at applymovements and this has me stumped :(

Script:
Spoiler:


Now, I have another sprite somewhere else that sets the flag so flags are not an issue, my problem is that after the NPC moves off the screen my character is still locked. Other guys are still animated and stuff, the game hasn't frozen, but none of my buttons do anything. I know that it's a problem with waitmovement 0x0, because when I remove that line he disappears right away, which is the line below waitmovement, and then I can move.

AFAIK the script is correct, no compilation errors, and he actually moves, my character's just locked.

EDIT:
Alright, after a VERY long time of just sitting there, a menu appears on the top left of my screen with the options BUY and QUIT. My controls are still locked and the game appears to be frozen, but not crashing.

You forgot the "waitmovement" command after your "applymovement" command.

Code:
...
applymovement 0xF @movements
[COLOR="Blue"]waitmovement 0xF[/COLOR]
hidesprite 0xF
...

When you click yes it unlocks and it doesn't tell you the rest unless you talk to it again.
Spoiler:

You forgot the command "compare lastresult" command after your "message (type number 5)"
Also... I don't understand why you have a "clearflag" command under your "#org @done" address...

Code:
...
msgbox @sign 0x5
compare lastresult 0x1
if 0x0 goto @no
setflag 0x200
goto @done
end

#org @no
release
end

...
 
90
Posts
11
Years
  • Seen Aug 21, 2013
What things should I look into if I want an event like this?
When you walk into a new area the screen moves down a bit to show some people beating this guy up and they run off dropping a few pokeball sprites and they come back to grab 2 of them. o.o I'm looking at diegoisawesome tut atm trying to figure this out.

FR
 
Last edited:

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
What things should I look into if I want an event like this?
When you walk into a new area the screen moves down a bit to show some people beating this guy up and they run off dropping a few pokeball sprites and they come back to grab 2 of them. o.o I'm looking at diegoisawesome tut atm trying to figure this out.
For moving the screen, you need to use applymovement on camera (if I remember correctly it's 0x7F).
And then everything else is easily done with applymovement.
 

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Honestly hoping someone here can help me.

I'm trying to hack, but I'm horrible at scripting. I've read, like, 90 different tutorials, and the one thing I can't comprehend are flags.

So, here's my script. It's used to prevent the player from leaving the town until he/she goes to see the Professor. When the player steps on it, though, it just freezes the player, and you can't do anything but quit.

So, here's the script.

Code:
'---------------
#org 0x800027
lock
checkflag 0x1000
if 0x1 goto 0x880003A
clearflag 0x1000
release
end

'---------------
#org 0x80003A
pause 0x30
msgbox 0x8800058 MSG_NORMAL '"[player]: Wait a minute!\pI can't ..."
applymovement MOVE_PLAYER 0x88000E8
waitmovement 0xFF
setflag 0x1000
release
end


'---------
' Strings
'---------
#org 0x800058
= [player]: Wait a minute!\pI can't leave just yet!\pI need to go check with Professor\nOak. Mom said he needed me for\lsomething important.\pI better go[.]


'-----------
' Movements
'-----------
#org 0x8000E8
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

That's the script as it is now. AFAIK, there's nothing wrong with it. I assumed it had something to do with the map script, so I added this as a map script:

Code:
'---------------
#org 0x8000EA
checkflag 0x1001
if 0x0 goto 0x88000F5
end

'---------------
#org 0x8000F5
setflag 0x1000
end

The first script doesn't work no matter what; having the map script doesn't seem to do anything. I haven't edited the inside of any of the houses yet, but it should work just fine because I'm starting with flags at 1000. Is there any reason that this script isn't working right?
 
29
Posts
15
Years
  • Seen Feb 10, 2013


You forgot the "waitmovement" command after your "applymovement" command.

Sorry, I was loading my script (So I'd have the version with pointers and before compilation. When I decompile it doesn't really do anything :/

I did have waitmovement 0x0, it didn't work. Then I thought I might need it to be 0xF, since that was my sprite's event number. It still doesn't work, not sure why.

Can anyone help me with this?

Here's the compiled version:
Spoiler:



#org 0x800027
lock
checkflag 0x1000
if 0x1 goto 0x880003A
clearflag 0x1000
release
end

Well, first of all, why are you clearing a flag right there? If you check your flag and use goto to go to another section of your script you never get to the clearflag. In other words, if the first checkflag succeeds, it 'teleports' to the next section of the script, but if it fails it does a clearflag, releases, and ends. If it fails, the flag is not set, meaning no reason to clear the flag. Maybe you're trying to say this?

Code:
checkflag 0x1000
if 0x0 goto 0x880003A
clearflag 0x1000

But even then I have no idea why you'd ever want to set that flag anyways, seeing as how it would just set it and clear it as soon as you talked to him again.

After thinking about this again I just realized you could easily do something like this:

Code:
lock
faceplayer
checkflag 0x1000
if 0x1 goto LET_PLAYER_PASS_OR_REMOVE_THE_GUYS_SPRITE
msgbox @sayinstuff 0x6
APPLYOVEMENTS HERE
release
end

Then have some other event somewhere else set flag 0x1000 and you're set!
[/CODE]
 
Last edited:

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Well, first of all, why are you clearing a flag right there? If you check your flag and use goto to go to another section of your script you never get to the clearflag. In other words, if the first checkflag succeeds, it 'teleports' to the next section of the script, but if it fails it does a clearflag, releases, and ends. If it fails, the flag is not set, meaning no reason to clear the flag. Maybe you're trying to say this?

Code:
checkflag 0x1000
if 0x0 goto 0x880003A
clearflag 0x1000

But even then I have no idea why you'd ever want to set that flag anyways, seeing as how it would just set it and clear it as soon as you talked to him again.

After thinking about this again I just realized you could easily do something like this:

Code:
lock
faceplayer
checkflag 0x1000
if 0x1 goto LET_PLAYER_PASS_OR_REMOVE_THE_GUYS_SPRITE
msgbox @sayinstuff 0x6
APPLYOVEMENTS HERE
release
end

Then have some other event somewhere else set flag 0x1000 and you're set!
[/CODE]

Er, I wasn't really using a person, just a script trap. I guess using a person would be better.

So, what you're saying is, I should just program the script without setflag/clearflag stuff, and have another script work all of that out instead?
 
4
Posts
11
Years
  • Age 29
  • USA
  • Seen Jul 14, 2012
hi dude would you please help me i'm making a hack for pokemon ruby and i wanted to make a script using PKSV to allow the pokemon picture to appear while talking to the person like in the hack which is called : Pokemon Ruby Destiny-Life of Guardian i think so and i did every thing right but when i talk to him the pokemon colors appears to different like this/imageshackDOTus/photo/my-images/72/imageerrorDOTpng/
Ill be really happy if you helped and sorry if it was a long message :)
 
Status
Not open for further replies.
Back
Top