Jump to content

Script Editing Help Thread


Recommended Posts

This thread is for general help with PPRE Scripts. Do not ask for additions to be made to PPRE. We know that PPRE's script compiler has many flaws, so try and bear with us. You can read about the other PPRE business here: http://projectpokemon.org/forums/showthread.php?303-PPRE-Project-Pokemon-s-ROM-Editor.

If you need help for a thread, try and do some of it on your own. This is not a script request thread.

Link to comment
Share on other sites

This isn't necessarily a request to make a script, but can someone tell me how to make a flag, and in a later event, check and see if that flag exists, and if so, do a different action? I tried Setflag 0x[hex], then later do Checkflag 0x[hex] and COMPARELASTRESULT 0x1 func_[number] (by the way, what's the overall difference between 0x0 and 0x1 after the COMPARELASTRESULT?), followed by a function that would execute the desired effect, but it didn't work.

Do I have to edit the Overworlds section in Events, or am I just doing something wrong?

EDIT: Oh, I forgot to mention, I'm talking to a wall that I need the script for.

Link to comment
Share on other sites

==func_1

Setflag 0x123

Message 0x7

Closemsgonkeypress

Releaseall

End

(above was setting the flag, below is checking it)

===scr_11

PlaySound 0x5dc

Lockall

Message 0x2a

Yesnobox 0x800c

If 0x800c 0x1

COMPARELASTRESULT 0x1 func_7

Jump func_8

Releaseall

End

==func_7

Message 0x2c

Closemsgonkeypress

End

==func_8

Checkflag 0x123

COMPARELASTRESULT1 0x1 func_21

Message 0x2b

Closemsgonkeypress

End

==func_21

Message 0x2d

Closemsgonkeypress

End

First, are you sure that you are setting the flag? Does msg 7 actually activate?

Second, for technicality sake, Message 0x2a should be " [question]? \v0200\z0000" (That expects a Yes/ No box to follow)

Third, Message 0x2b will never happen. Using COMPARELASTRESULT1 only will continue the rest of func_8 if you use a killscript in func_21. I would personally use COMPARELASTRESULT there.

Link to comment
Share on other sites

==func_1

Setflag 0x16

Message 0x7

Closemsgonkeypress

Releaseall

End

(above was setting the flag, below is checking it)

===scr_11

PlaySound 0x5dc

Lockall

Message 0x2a

Yesnobox 0x800c

If 0x800c 0x1

COMPARELASTRESULT 0x1 func_7

Jump func_8

Releaseall

End

==func_7

Message 0x2c

Closemsgonkeypress

End

==func_8

Checkflag 0x16

COMPARELASTRESULT 0x1 func_21

Jump func_22

End

==func_21

Message 0x2d

Closemsgonkeypress

End

==func_22

Message 0x2b

Closemsgonkeypress

End

That's what I have now, but it still doesn't work. =/

Link to comment
Share on other sites

==func_1

Setflag 0x16

Message 0x7

Closemsgonkeypress

Releaseall

End

(above was setting the flag, below is checking it)

===scr_11

PlaySound 0x5dc

Lockall

Message 0x2a

Yesnobox 0x800c

If 0x800c 0x1

COMPARELASTRESULT 0x1 func_7

Jump func_8

Releaseall

End

==func_7

Message 0x2c

Closemsgonkeypress

Killscript

End

==func_8

Checkflag 0x16

COMPARELASTRESULT 0x1 func_21

Jump func_22

End

==func_21

Message 0x2d

Closemsgonkeypress

Killscript

End

==func_22

Message 0x2b

Closemsgonkeypress

Killscript

End

That's my new script, but it still only gives me the func_22 output. =/

Link to comment
Share on other sites

===scr_3

PlaySound 0x5dc

Lockall

Message 0x6

Yesnobox 0x800c

If 0x800c 0x1

COMPARELASTRESULT 0x1 func_0

Jump func_1

Releaseall

End

==func_0

Message 0x8

Closemsgonkeypress

Releaseall

End

==func_1

Setflag 0x136

Message 0x7

Closemsgonkeypress

Releaseall

End

(above was setting the flag, below is checking it)

===scr_11

PlaySound 0x5dc

Lockall

Message 0x2a

Yesnobox 0x800c

If 0x800c 0x1

COMPARELASTRESULT 0x1 func_7

Jump func_8

Releaseall

End

==func_7

Message 0x2c

Closemsgonkeypress

End

==func_8

Checkflag 0x136

COMPARELASTRESULT 0x1 func_21

Message 0x2b

Closemsgonkeypress

End

==func_21

Message 0x2d

Closemsgonkeypress

End

That's my code at the moment.

Link to comment
Share on other sites

  • 5 months later...

I have a few questions in scripting. It seems that PPRE has been updated since the last posts have been answered.

1. How are flags formatted now? I noticed the "message 0x2d" isn't used, now it's just "message 3" or whatever number. Which is why I'm asking. I'd rather use the new, easier methods.

2. How do yes/no text boxes work? I see Yesnobox above, but can someone explain what's needed to use it?

3. How can a script give or take a Pokemon or item?

I'm scripting HG/SS by the way, if it matters.

Link to comment
Share on other sites

  • 4 weeks later...

I am trying to make a script that is executed when the player is standing in a certain spot, or when they enter the zone/before the zone loads. I tried to look at example scripts from other parts of the game, but my test script is just freezing the game when I enter the zone.

Here is what I have so far just to see if it is ran at the right spot, I made it the first script in the script order. This is in HG if it matters.

(script)
MecScript 
Lockall 
CheckHiroPosition 0x4000 0x4001 
If 0x4000 354
CheckLR 1 func_1
Message 0 
Jump func_2

(func 1)
Message 1 
Releaseall 
End 

(func 2)
Message 2 
Releaseall 
End

Link to comment
Share on other sites

  • 4 weeks later...

First off, I am sorry if this isn't a sticky, or if I put this in the wrong place. (I'm kinda new)

I've been using ppre to edit pokemon diamond. It has worked wonderfully for all the areas I've tried to edit. One thing I've tried to accomplish, and have failed at, is finding the coordinates for a new script. I downloaded a untrimmed rom, and tried to use the LUA script to find these coordinates; but so far it hasn't worked for me. (Note: I downloaded a LUA specifically for pokemon diamond) The 'y' is either at '0' OR 'x/y' are both in the 1000's range. I know this cannot be right. Am I doing something wrong? Is there any other way to find these coordinates? Any help would be gratefully appreciated!

Link to comment
Share on other sites

Well, just pop a SAV file into Pokesav and look at those locations of the character. If you are on the main map (you are able to fly), then it is likely to have coords of over 1000. If you are in a small map, eg, in a building, then the top left is (0,0) and your map is going to have small coordinates.

Link to comment
Share on other sites

I need some help. I added a Dawn OW in SoulSilver. I added a movement after I battle her but she doesn't execute the movement and nothing happens.... I can't even move.:( I deleted the Movement.... so here is what I have for her script:

Lockall

Faceplayer

Message 6

WaitButton

CloseMsgOnKeyPress

TrainerBattle 136 0 1

Message 7

WaitButton

CloseMsgOnKeyPress

Releaseall

End

I just need to add the Movements. Can you tell me where the mov_ goes? Or how to set up the movement? Thanks.:)

Link to comment
Share on other sites

So, I'm trying to edit the name of a trainer with PPRE and... I can't do anything to it. =\

It saves at first and it looks like it saves, but then when I close the window and open it back up, it doesn't change.

Is there a way around this?

Also, how would I start a simple script for a mandatory battle? I can't see to do it with the type of script. You have to talk to the character to initiate the battle.

Edited by Roihu
Link to comment
Share on other sites

  • 2 weeks later...

Lockall

Faceplayer

Applymovement 1 mov_8

Waitmovement

Message 1

Waitbutton

CloseMsgOnKeyPress

Releaseall

End

Does anyone have any idea what is wrong with this?

I'm trying to get the movements to work but everything fails X_X .

(Movements apart works fine so does text apart but I can't seem to combine them.....)

Link to comment
Share on other sites

  • 4 weeks later...

since it's a double battle, there's 2 scripts (one for each trainer)

trainer 1

Lockall 
Faceplayer 
Message 31 
WaitButton 
CloseMsgOnKeyPress 
DoubleBattle 737 735 736 1 
Message 32 
WaitButton 
CloseMsgOnKeyPress 
Releaseall 
End

trainer 2

Lockall 
Faceplayer 
Message 33 
WaitButton 
CloseMsgOnKeyPress 
DoubleBattle 737 736 735 1 
Message 34 
WaitButton 
CloseMsgOnKeyPress 
Releaseall 
End

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...