Alpha Posted May 12, 2010 Posted May 12, 2010 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.
zowayixx Posted May 12, 2010 Posted May 12, 2010 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.
Alpha Posted May 13, 2010 Author Posted May 13, 2010 ==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.
zowayixx Posted May 13, 2010 Posted May 13, 2010 ==func_1Setflag 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. =/
pichu2001 Posted May 13, 2010 Posted May 13, 2010 I think you must add some Killscript commands, one before func_7 end, and other two before func_21 and func_22 end.
zowayixx Posted May 13, 2010 Posted May 13, 2010 ==func_1Setflag 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. =/
Alpha Posted May 13, 2010 Author Posted May 13, 2010 Unfortunately, you cannot use 0x16 as a flag, because the number is far too low. Flags range from a little below 0x100 to a little above 0x900.
zowayixx Posted May 14, 2010 Posted May 14, 2010 ===scr_3PlaySound 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.
Alex_32571 Posted October 28, 2010 Posted October 28, 2010 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.
KazoWAR Posted November 24, 2010 Posted November 24, 2010 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
Alpha Posted November 24, 2010 Author Posted November 24, 2010 KazoWAR: You are best off using triggers for this. Set a trigger to a certain spot on the map, then execute your script from there. Triggers are listed on the events tab of PPRE.
KazoWAR Posted November 24, 2010 Posted November 24, 2010 Thanks, also for some reason when i add Message 7 in to a function my script seems to freeze on any Applymovement. you have any idea?
dannessicity Posted December 17, 2010 Posted December 17, 2010 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!
Alpha Posted December 17, 2010 Author Posted December 17, 2010 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.
basher11 Posted December 18, 2010 Posted December 18, 2010 alpha, do you know why double battles freeze after battles? (2 on 2 battles)
Alpha Posted December 18, 2010 Author Posted December 18, 2010 alpha, do you know why double battles freeze after battles?(2 on 2 battles) Are you using a script to start the battle? What type of double battle is it? One trainer vs one trainer? or Two trainers vs two trainers?
basher11 Posted December 19, 2010 Posted December 19, 2010 yeah im using a script. 2 trainers vs 2 trainers.
KibaLG8 Posted December 21, 2010 Posted December 21, 2010 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.
Roihu Posted December 21, 2010 Posted December 21, 2010 (edited) 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 December 22, 2010 by Roihu
Mindfreak Posted December 29, 2010 Posted December 29, 2010 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.....)
Roihu Posted December 30, 2010 Posted December 30, 2010 Applymovement 1 mov_8 Is 1 the OW you want to move?
Mindfreak Posted December 30, 2010 Posted December 30, 2010 Applymovement 1 mov_8 Is 1 the OW you want to move? yes cause when I use this he moves perfect... Lockall Faceplayer Applymovement 1 mov_8 Waitmovement Releaseall End
basher11 Posted January 22, 2011 Posted January 22, 2011 sorry, im not the type to bump topics, but i really need this problem fixed. why does 2v2 trainer battles freeze on me at the end? me and lyra vs D/P/P Hero Male + Female.
Roihu Posted January 22, 2011 Posted January 22, 2011 I can't guarantee anything, but can I see the script you're using to start the battle?
basher11 Posted January 22, 2011 Posted January 22, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now