Jump to content

Recommended Posts

Posted

Hey there people of project pokemon readin g this. Now I was messing around with scripting through PPRE for Gen 4, and my new trainer script worked great thanks to some old forum digging:

[video=youtube;CdAMY1uNJ9w]

HOWEVER now I can infinitely rebattle him when I only want him to be battled once, I'm wondering how to make it only be battled once, I'll put the script at the end of this post:

Lockall

Faceplayer

Message 39

WaitButton

CloseMsgOnKeyPress

TrainerBattle 19 0 1

Message 40

WaitButton

CloseMsgOnKeyPress

Releaseall

End

Posted

You need to decide a way to make the battle inaccessible afterwards.

Alpha suggested using the display flag. When set this flag will remove the sprite. You can set this flag after the battle and it would remove the trainer.

EDIT: I'm attempting to find an example script for you but my notes on my old projects were horrible

EDIT 2: You'll probably want to check if the battle was won or lost ( I do not recall the exact command but you can reference other event battles and copy the script from them) and then upon the condition of winning you can removepeople

If this isn't enough of a help I can try to dig up some example scripts but truth be told I am rusty.

Posted

Ok thanks, that will definatly help with OTHER battles, but really I'm looking for a way to make it like with gym battles where they are still there, but they don't battle you. I'll probably mess around with falkners scripts 'till I get this one right. although that ended up crashing it last time, it's the only thing I have. THanks, Your post helped a lot for later but it's not what I'm looking for right now.

EDIT: I believe that the script part for checking if you won/lost was

CheckTrainerLost 0x800c

If 0x800c 0

CheckLR 1 func_2

I checked protons leave script and it worked... Until I enterd the room again

(protons script is:

Fadescreen 6 1 0 0

Resetscreen

Removepeople 1

Setflag 425

Return 20 0x8004

Fanfare 1538

WaitFanfare 1538

Fadescreen 6 1 1 0

Resetscreen )

I maybe missing to add somehing from his script but I can't put my finger on it

Posted
Ok thanks, that will definatly help with OTHER battles, but really I'm looking for a way to make it like with gym battles where they are still there, but they don't battle you. I'll probably mess around with falkners scripts 'till I get this one right. although that ended up crashing it last time, it's the only thing I have. THanks, Your post helped a lot for later but it's not what I'm looking for right now.

EDIT: I believe that the script part for checking if you won/lost was

CheckTrainerLost 0x800c

If 0x800c 0

CheckLR 1 func_2

I checked protons leave script and it worked... Until I enterd the room again

(protons script is:

Fadescreen 6 1 0 0

Resetscreen

Removepeople 1

Setflag 425

Return 20 0x8004

Fanfare 1538

WaitFanfare 1538

Fadescreen 6 1 1 0

Resetscreen )

I maybe missing to add somehing from his script but I can't put my finger on it

That looks correct for the win/loss portion (though the notation never made any sense for me but I see you are using a newer PPRE than I am...)

As for holding when you exit the room, you are gonna have to use flags. Your situation wouldn't involve the display flags. Instead you will have to assign a flag and have it set or cleared depending on the scenario. The trick with that is making sure either A.) the flag isn't tied to anything else, or B.) using a flag that would go unnoticed if it was reactivated.

Posted

Here's how you use flags....

Scr_1

Lockall

Faceplayer

Checkflag 890 //This number must be altered for other events. It checks if a flag has been set.

CheckLR 1 func_1 //If the flag has been set, go to func_1

<YOUR SCRIPT>

Setflag 890

Releaseall

End

func_1

Message 2 //Display a message like "We already battled before"

Waitbutton

CloseMsgOnKeyPress

Releaseall

End

Also, when using this command...

CheckTrainerLost 0x800c

If 0x800c 0

CheckLR 1 func_2

make sure func_2 contains...

LostGoPc

Releaseall

End

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...