The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: bum199 on May 24, 2011, 05:20:38 AM

Title: is there a way to get a characters death to trigger abort battle?
Post by: bum199 on May 24, 2011, 05:20:38 AM
Hello i am trying to figure something out in rmxp. I'm using gubids tactical battle system and i know how to set it so if one actor dies its a failure.  But i want it to resuslt in failure if someone else dies.  Not if they both die ine the battle or what i mean is they wouldnt both have to die to trigger it..  But either of them could trigger it.  i don't really know what i'm doing and would appreciate help. i thought maybe there was  a way for the death of a character to trigger abort battle but i dont know how to set that up.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: pacdiggity on May 24, 2011, 09:10:49 AM
1. Set a variable to each of the characters' HP through the control variables command.
2. Set a conditional branch in your battles to check if any of the variables are equal to 0.
3. Inside the conditionals make the command to exit the battle. Make sure the event is parallel process running whenever a battle is happening. An easy way to do this is have a parallel process common event running with a switch trigger that you activate whenever a battle is happening, and turn off when it ends.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: bum199 on May 24, 2011, 09:20:09 AM
sorry for my noobishness but  how would i do that?
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: pacdiggity on May 24, 2011, 09:26:21 AM
Go into the database and open up the common event tab. Make a new one, and make it 'Parallel Process' and set the switch trigger to one that you haven't used yet. In event commands, you'll see the control variable option on the first page. Go into it, and set 1 variable to equal each actor's HP. There is an option for this. This means if you have 4 actors, you'll need 4 variables.
Next, make a conditional branch (also on the first page in event commands) to check if one of the variables is equal to 0. That option is the second one on the first page of the conditional selections. Uncheck the else box, you won't be needing it. Inside the branch, run an 'Abort Battle' or 'Gameover' command as you deem fit. Make a branch for each of the variables.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: bum199 on May 24, 2011, 09:30:13 AM
i think i understood all that except how to set variables to hp and how to check the variable after that.advice would be appreciated.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: pacdiggity on May 24, 2011, 09:41:52 AM
I have attached an example to help you figure it out. This is the control variables window.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: bum199 on May 24, 2011, 09:50:26 AM
ok when i check if the variables are eqal to 0 do i chck constant or variable? i think i understand now
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: pacdiggity on May 24, 2011, 09:54:06 AM
Constant.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: bum199 on May 24, 2011, 09:59:53 AM
apparently i set the branches up wrong i think.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: pacdiggity on May 24, 2011, 10:13:57 AM
It should be set up:
@>Conditional Branch: Variable [XXXX: Actor HP] == 0
    @>Abort Battle
    @>
:  Branch End

If you're having trouble setting up the branch itself, there's another attachment.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: bum199 on May 24, 2011, 10:28:14 AM
is this all supposed to be on one event page? i have it split up in 2 right now
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: pacdiggity on May 24, 2011, 10:35:13 AM
One page, common event, parallel process. You'd have to activate it by turning on the trigger switch though. The reason you need a parallel process is because you want to constantly update all of your HP variables.
Title: Re: is there a way to get a characters death to trigger abort battle?
Post by: bum199 on May 24, 2011, 06:59:19 PM
i have no idea what im doing wrong. it still takes both actors deaths. heres a screen of the event maybe that shows what im doing wrong. i can post the common event pic too if you like. never mind i found  a way.

[attachment deleted by admin]