Battle Event - Check if Actor is Guarding, How?

Status
Not open for further replies.

celadon

Warper
Member
Joined
Jul 19, 2013
Messages
4
Reaction score
0
Primarily Uses
The situation is that I am trying to get an enemy to "wind up" for 4 turns, then, if the party isn't guarding, kill them.

I'm doing this by using an enemy with no attacks, then in the battle event, starting a variable that counts each turn. On turns 1-3 I display a message, then if they aren't guarding on turn 4, I want them all to die, otherwise survive. There are other minor details to this fight but here is where it gets stuck:

No matter what I do, I cannot get the game to recognize that my actors are guarding.

My non-working version is set up in 2 battle event pages,

1 (set to Turn)

-Variable counts to 4 on turn ends, when it hits 4 activates page 2 via a switch

2 (set to Moment)

-switches for each party member turn on, call them "not guarding" switches

-conditionals for each party member checking state 'guard' run

-that conditional will turn off the "not guarding" switch for actors with state 'guard', else nothing

-switch activates to "fire" the killing spell

-conditional check for each "not guarding switch"

-add state 'death' to any actors that are still on

This doesn't work at all, and neither does anything else I've tried. No matter what I do (been fiddling with this event for about ~4 hours) I cannot get the conditionals that check for the guard state to work. Every time, the characters guard, then the guard fades, then the last part triggers and they die, like it's ignoring where I turned off the switches.

I tried downloading Tsukihime Custom Event Variables to track skill usage, but could not get it to work at all. It just didn't store anything in the variables under any circumstance.

Any help or insight into how to track skill usage would be greatly appreciated, thank you.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,358
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
One other option would be to modify the guard skill to call a common event in addition to everything else, adding +1 to a variable and then checking if all battlers guard on the selected turn.

To make it work, you'll have to combine troop events and common events with a counting check, because I don't know the sequence in which the events are called.

1) make a troop event starting turn 0 (condition 0+1*x) that adds a turn count variable +1

2) make the guard skill common event display the turn variable each turn with show text to find out what the number would be on the fourth turn as you want (can be 3, 4 or 5 depending on when troop events are called and how the variable is indexed - that's why you need the display to check). This part of the guard skill event will be erased after everything works.

3) make the guard common event add one to a new variable guardnumber when the correct turn is seen in the number check.

4) make the guard event check the guardnumber on that turn after it's added +1- if it's four then control switch "continue" ON

5) on the next turn, make another troop event active to check the continue switch and kill or survive the actors then.
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
I see the problem now, the GUARD/DEFEND state disappears right before the current turn ends.
So for example you guarded in Turn 3, it will disappear on that turn. So even if you activated it on Turn 4 and add a conditional where the event happens at the end of the turn, the guard state will disappear first. <_<
 
I have some ideas but lemme test it out first.
 
****************************
ALRIGHT, HERE'S THE SOLUTION.
****************************
 
First of all, grab these following ~harmless snippets~
 
Kread's No Log - Allows you to display no log entry when using skills.
Yanfly's Anti-Fail - This allows skills that don't use damage not to display any.

I also recommend that you take the snippet I have over here (at #7), that makes any rating 10 skills 100% USED. This is for Turn #4's succession just in case you have skills that doesn't have any requirement.
 

7.) How can I make the enemy’s priority 10 attack to be the only action he does depending on the condition.

How? Go to Game_Enemy, Line 257. Below rating_max = action_list.collect {|a| a.rating }.max, add this :
rating_max = 12 if rating_max == 10
There’s a very, very small chance it’ll do a priority 9 attack (in fact, haven’t nailed this one at all). It all depends on your battle conditions.
Now if you follow the setup I had below. Any unfortunate soul who is NOT guarding on the 4th Turn will die a very painful, Disgaea type of death.
 
#1 Set-up Two Skills:

 
#2 ENEMY AI


#3 BATTLE TROOPS

 
 
Last edited by a moderator:

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
As long as you only need to use this for one monster at a time (only one monster per battle troope) you can do this with 3 skills and one common event.

Make 3 skills:

Start Countdown

Continue Countdown

Mega Flare!

Using the damage formlua for the first skill, add this:

$game_variables[x] +=1 ; 0

The second skill does the same thing.

The last skill's formula looks like this:

$game_variables[x] = 0 ; b.state?[2] ? 9999 : 0

What this does is use a variable to count your turns.

Once the variable reaches whatever number you want (4 in your case), Mega Death to all who do not have state 2 (guard by default) active.

Now, the next part.

You have to add these skills to the enemy.

Add the 3 skills normally, but make the second one require that variable you are using be higher than 0.

And make the third skill active only when the variable is what you want.  (4)

Finally, you need a Common Event running a Par Proces which will reset the variable to 0 outside of battle.  (In case you kill the monster before he's done charging.)

It sounds more complicated than it is.

Let me know if you need more help and I'll try to assist further.

Good luck!

EDIT:  UGH!!!  Forgot that you can't set monster actions to variables...

You can still use my method, you'll just have to attach states and use those as triggers.
 
Last edited by a moderator:

celadon

Warper
Member
Joined
Jul 19, 2013
Messages
4
Reaction score
0
Primarily Uses
I can't seem to get any of your methods to works guys, I'll address where I'm having trouble with each:

Andar-

When you say 'guard common event', I don't really know what you mean. Tbh I don't really understand common events that well. Also, I couldn't get anything remotely close to that working, but I feel like a guard variable is going to go up whenever someone uses guard, so my party of 4 is going to get it up to 0-4, and I won't know who specifically to kill.

Archeia-

I did exactly what is in your screens, and can't get it to work. It tries to kill them on turn 5, but I crash and get an error with Ace Battle Engine line 688: NoMethodError, undefined method 'forced_action_remove' for Switch:Module. Also, I'm not 100% clear on how your common event is set up.

Maliki79-

This sounds promising, but when you say to do it by attaching states and using them as triggers, you lost me. That sounds like exactly what I've been doing from the start and I know that doesn't work.

Really sorry if I butchered what you guys meant to do, I haven't been using RPG Maker long and have no experience with scripting or programming. Thanks a ton for trying though, hopefully one of you can hold my hand a little harder and I can get this thing running.
 
Last edited by a moderator:

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
ok.

First you need to add 2 states, "Counting" and "Count Done".

Then, in attack 1, alter the formula to this:

a.add_state[x]; $game_variables[y] +=1 ; 0

make x the number of the "Counting" State.

y is the number of the variable you made previously.

Then in the second skill, do this:

if $game_variables[x] < y ; $game_variables[x] +=1 ; else ; a.add_state[z]; end ; 0

x is the same variable from before.

y is the number the variable needs to reach to cause the attack.

z is the number of the "Count Done" State.

And for the last skill, do this:

$game_variables[x] = 0 ; a.remove_state[x1]; a.remove_state[x2] ; b.state?[2] ? 9999 : 0

x1 and x2 are the states you used for this attack.

Now, in the skill set up for the monster make skill 1 normally It has to be a low rated skill like 3.  

Skill 2 is active only while state x1 is on.  Make it's Rating 7.

And make skill 3 active when state x2 is on. It's Rating should be 10.

(What I meant by Triggers was the "Conditions" to make the monster do the attack.

I know I said it was simple before, but this makes it a bit more complicated.

Sorry if my wording is a bit much as I can't do Screenshots right now.

Let me know if you can get this to work with this set up, please.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,358
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
Andar-

When you say 'guard common event', I don't really know what you mean. Tbh I don't really understand common events that well. Also, I couldn't get anything remotely close to that working, but I feel like a guard variable is going to go up whenever someone uses guard, so my party of 4 is going to get it up to 0-4, and I won't know who specifically to kill.
OK, I probably read your original description wrong.

I assumed that you want to make sure that all 4 actors are guarding on the fourth turn, and that if even one of them didn't guard then all four would be killed.

As a result my solution was targeted at counting how many actors are guarding.

As for your question about Common events:

Common events  basically have two basic functions (and a lot of other uses as they're very versatile):

1) adding event functions to skills or states (no trigger)

2) checking the game status by parallel processes in the background

In my description I was using 1). If you add a common event call as a feature to a skill, that common event will get called every time that skill is used.

I would have made such a common event and add it as a feature to the guard skill, and then every time one of the actors uses the guard skill, that common event would be processed, allowing me to set variables or process any event command at that exact time (instead of depending on the timing of the troop events).

My approach of the solution came from the other side compared to the solutions of Archeia and Maliki: Instead of searching for a way to detect the guard state after it was used, I used the guard skill to trigger switches to be checked by the later enemy skill.

Unfortunately, if you want to identify which actor is guarding and which is not, that isn't so simple - as told above I assumed you wanted something different.

I just explained it here because I think you might still be able to use that logic if the other approach by the monsters' skill damage formula doesn't work...
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
Archeia-

I did exactly what is in your screens, and can't get it to work. It tries to kill them on turn 5, but I crash and get an error with Ace Battle Engine line 688: NoMethodError, undefined method 'forced_action_remove' for Switch:Module. Also, I'm not 100% clear on how your common event is set up.
What custom script are you using and why did it break Forced Action?

You could be using a script that directly manipulate turns that's why nothing is working properly. Have you tried the method in a new project?
 
Last edited by a moderator:

celadon

Warper
Member
Joined
Jul 19, 2013
Messages
4
Reaction score
0
Primarily Uses
I actually got this working perfectly by using "b.guard? ?  0 : 99999" in an aoe skill formula, then used the skill every 4 turns. Thanks so much for your effort though guys, I really learned a lot from your posts.

Thanks again,

Michael
 
Last edited by a moderator:

Fomar0153

Arkz
Restaff
Joined
Mar 13, 2012
Messages
1,327
Reaction score
473
First Language
English
Primarily Uses
RMMZ
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,015
Members
137,563
Latest member
MinyakaAeon
Top