• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.
Game: FIRERED
Type: On map start - 02 Validates values etc

Whenever I use "on map start" scripts I get an error at the end of the script where it displays a message box with some kind of error. The rest of the script works fine.

Note - This is only occuring on certain maps although there is nothing at all unique about the maps, and the scripts work fine on other maps! It is definitely not the script itself causing the error.

See attachment for image of error!
 
Game: FR, patched with the FR hacked engine patch.

How would I make a cutable tree? I set the sprite with no script yet since I'm not sure. Is it just a setflag to make it cut? I don't care much for the animation or much text. I just want to either cut, or say you don't have cut.
 
I am not sure whether this belongs here, but I might as well ask anyway...
I'm looking for a way to use the setmaptile command on the tile I'm standing on. Like, I step on a tile with an event and POOF! (<.< no other way to say this I guess -.-) It changes into another tile. Like a "setcurrentmaptile" command.
Anyone?

Try using something like this:

Code:
getplayerpos 0x4050 0x4051
setmaptile 0x4050 0x4051 0xXXXX 0xXX
special 0x8E
 
Game: FR, patched with the FR hacked engine patch.

How would I make a cutable tree? I set the sprite with no script yet since I'm not sure. Is it just a setflag to make it cut? I don't care much for the animation or much text. I just want to either cut, or say you don't have cut.

Just open up a NORMAL Fire Red version, and take the old cut script out, and compile it to the new ROM.
 
Just open up a NORMAL Fire Red version, and take the old cut script out, and compile it to the new ROM.

Oh, haha, right. ok thanks :) I actually concidered that, but then forgot to do it. So I came back to the project like "oh nos! I has to fix it!"
 
Thanks, it worked like a charm!
Now that I got this working, I got another question, hurr durr.
Is there also something like a 'getdirectionplayerisfacing' command? Or else, a way to make the player return to where he was before he moved?
What I'm trying to do is replace Surf with 'fdreeze shoes' which turns water into ice when you walk on it. But if the player goes onto the water without the shoes he falls into it and goes back to where he was before he stepped into the water. So, if he's facing right, he warps to the left, et cetera.
So, is there a command like that?
 
Ok guys, I want to make sure ALL trainers and gym leaders will be avaliable to fight again after the game is beaten, adding to the replay value of the game, offering new starters and such. I would like to know 2 things:
Game: FR with the FR hacked patch.

Is there a way to reset all trainers/gyms in a short way after the elite four are defeated? I Know I'd have to do a lot of settrainer flags for them to be rebattled, but is there a way to do all in one code or in a shorter code? Because thats a lot of trainers to set flags for... If not thats fine, just wondering so I can save time. I was hopeing to find out before I did the trainer battles so I don't miss any script I need and have to fix it later.
But in case there isn't, I could just set a script tile on the floor to be walked on that resets all trainers as long as they're set in the script right? Thats how I'd go about doing it?


And is there a way to give an egg that has a random pokemon in it? My FR game is going to consist of all FR and G/S pokemon, if there is a random give egg script, would it give a random egg of just whats available in game? Or would it be from a 3 gen games? (if there is a random egg option anyway..) I was thinking of doing something like this for the new starters, but if need be I can offer a bunch of multiple choice questions to give a "random" egg.

Thanks guys, you've been extreamly helpfull. :D
 
Hi, I've got this weird problem :S
Game: Jpan's Hacked Fire Red Engine
I inserted a simple talking script. However, when I talk to the person no messagebox appears... It does face the player, locks and releases and all (even the 'ping' sound of talking) but it doesn't show any text.

In the original Fire Red ROM it all worked perfectly fine. I used to make more complicated scripts and it worked.

This is the script: (very simple of course)
#dynamic 0x16159C
#org @start
lock
faceplayer
msgbox @oink 0x6
release
end

#org @oink
= Oink, oink!
 
Hi, I've got this weird problem :S
Game: Jpan's Hacked Fire Red Engine
I inserted a simple talking script. However, when I talk to the person no messagebox appears... It does face the player, locks and releases and all (even the 'ping' sound of talking) but it doesn't show any text.

In the original Fire Red ROM it all worked perfectly fine. I used to make more complicated scripts and it worked.

This is the script: (very simple of course)

Hmmm... That IS weird.. It works for me, I use the FR engine too. Maybe try removing the offset, and replace it with a new one.. maybe its in a weird place so it loads funny.
EDIT: Wait, is there a space after the =?
 
which command will I use to move the camera?

Code:
special 0x113     ' releases the camera, as in prepares the camera        
applymovement 0x7F @move_camera1      ' 0x7F is the 'event' number for the camera
waitmovement 0x0      ' perfect pause command (you can use any pause command)
special 0x114      ' locks the camera's last location

Also, when you move the camera to a certain place, you need to return it back to its original place once you finish. As in, do another setup of the camera movement, but in the opposite direction of the first one. And the movements are similar to the normal ones, which you can find them in any tutorial.

Do not kill me if this is wrong, since I have been scripting for 1 week only.
 
Hmmm... That IS weird.. It works for me, I use the FR engine too. Maybe try removing the offset, and replace it with a new one.. maybe its in a weird place so it loads funny.
EDIT: Wait, is there a space after the =?

There is a space after the "=". XSE checked that.

When I open the script in A-map, the following loads:
(I replaced the script with the default script from diegoisawesome's tutorial)
'-----------------------
#org 0x161875
lock
faceplayer
msgbox 0x81615B3 '"Hi.\nMy name is Diego."
release
end


'---------
' Strings
'---------
#org 0x1615B3
= Hi.\nMy name is Diego.
As you can see the offset after "msgbox" is 0x81615B3 instead of the real offset "0x1615B3". Replacing the offset or deleting the "8" doesn't work. When I compile and check it, the "8" is back again...
Is this supposed to happen? I don't think so, but maybe I'm wrong. It does actually explain the problem...
 
^ If you decompile any script in the ROM, you will find that this is normal. I do not know why, but maybe it is calling an offset, which as you may have noticed needs an '8', in the ROM that is holding the text strings(?). Wait for good hackers to answer you.
 
How would I script the following: (I know the commands for the text, but I think I have it in the wrong order). Secondly, what type of event would it be in Advancemap?
1. Pokeball on the table.
2. Press 'A' on pokeball, oak asks: So it's Chikorita that you want?
3. You say no, script ends.
4. You say yes, Oak says: Then it's yours! Take good care of it!
5. Fanfare plays and text that says "\v\h01 recieved the Chikorita from Oak!"
6. The sprite disappears and the event is not accessible anymore.
 
Yeah I've seen that 8 appear, its normal as far as I can tell. I don't know why it isn't working, looks perfect. So yeah wait for a good hacker to answer this. :( I'm not good enough, haha. But I figured I'd try since it is an easy script. But this problem makes no sence to me, it should work. Thats why I figured maybe there was an offset problem.. Good luck though.
 
There is a space after the "=". XSE checked that.

When I open the script in A-map, the following loads:
(I replaced the script with the default script from diegoisawesome's tutorial)

As you can see the offset after "msgbox" is 0x81615B3 instead of the real offset "0x1615B3". Replacing the offset or deleting the "8" doesn't work. When I compile and check it, the "8" is back again...
Is this supposed to happen? I don't think so, but maybe I'm wrong. It does actually explain the problem...
What Ficher said is true.
And adding to that, you could decompile and change it to something like:
Spoiler:

MSG_FACE is automatic lock and faceplayer. Or you could just use a 0x4 boxset, which is the same thing.
Code:
msgbox @pointer 0x4
 
What Ficher said is true.
And adding to that, you could decompile and change it to something like:
Spoiler:

MSG_FACE is automatic lock and faceplayer. Or you could just use a 0x4 boxset, which is the same thing.
Code:
msgbox @pointer 0x4

Well thanks everyone for your help. I have been able to fix it somehow. I took a look at the scripts in the original FireRed ROM, and there was this command 'callstd 0x2' after the msgbox-line. I don't know what 'callstd 0x2' exactly means, but it did let the messagescript work.
So, eventually, I wrote this as (temporate) script:
#dynamic 0x161895
#org @start
msgbox @clefairy 0x4
callstd 0x2
end

#org @clefairy
= CLEFAIRY came from the moon.\nThat's what the rumor is.\pThey appeared after MOON STONES\nfell on MT. MOON.
So, just like Binary said, I used the 0x4 command. And besides that the callstd 0x2... So, what is it actually I'm using? ^_^'
 
You don't need to worry about that 8 ;) You can view it as... well... signal that the msgbox is working ;)

How would I script the following: (I know the commands for the text, but I think I have it in the wrong order). Secondly, what type of event would it be in Advancemap?
1. Pokeball on the table.
2. Press 'A' on pokeball, oak asks: So it's Chikorita that you want?
3. You say no, script ends.
4. You say yes, Oak says: Then it's yours! Take good care of it!
5. Fanfare plays and text that says "\v\h01 recieved the Chikorita from Oak!"
6. The sprite disappears and the event is not accessible anymore.
1. Put pokeball's sprite on table with A-Map
Now onto the script
Spoiler:


I haven't scripted longer scripts in a while so it might not be really correct...
 
Status
Not open for further replies.
Back
Top