Dawsmead

Villager
Member
Joined
Mar 22, 2023
Messages
22
Reaction score
2
First Language
English
Primarily Uses
RMMZ
I'm making a skill called "melee" that may trigger a counterattack. I'd like this skill to have different effects when used by different actors, so I'm trying to achieve this by common event. A dummy skill called "melee" triggers a common event that basically does this:

1. Check if actor "has a bayonet" (stored in a variable). If he does, force action skill #1 (has a chance to stun) actor on enemy; if not, force action skill #2 (without the stun).

2. Check if target enemy is stunned. if enemy is stunned, do nothing; if enemy is not stunned, force action skill #3 (counter attack) enemy on actor.

The problem is that it seems the engine checks if enemy is stunned (from step 2) BEFORE the "force action" skill #1 from step 1. So it always returns "not stunned" in the second if statement, and the enemy can always counterattack, even if skill #1 in step 1 stuns the enemy.

I'm using Visustella's core engine and battle core plug-in, so it maybe caused by the "action sequence" changes? Any idea how I can resolve this? Thanks in advance!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,918
Reaction score
6,724
First Language
English
Primarily Uses
RMMV
Welcome! As a general bit of logic, it's difficult-to-impossible for other people to troubleshoot for you if you don't provide screenshots of what you have. We're guessing and presuming based on the words you used, when code not working correctly can come down to a tiny detail. Or maybe your logic in your event isn't the same as how you wrote it.

So always post screenshots, they're worth a thousand words.

The problem is that it seems the engine checks if enemy is stunned (from step 2) BEFORE the "force action" skill #1 from step 1.
This is correct. Everything that's a part of your first skill is going to resolve before the queued force action happens.

I'm trying to achieve this by common event. A dummy skill called "melee" triggers a common event
This is not a great way to go about implementing this.

You should implement all of this within one skill. Either:
- Put it all in your Melee skill via action sequences and have all the conditional checks in there
or
- Put an Attack Skill Trait on the bayonet to replace which skill is being used when the player selects Attack, go from there

If you need more help, please include pictures for us to reference.
 

Dawsmead

Villager
Member
Joined
Mar 22, 2023
Messages
22
Reaction score
2
First Language
English
Primarily Uses
RMMZ
This is not a great way to go about implementing this.

You should implement all of this within one skill. Either:
- Put it all in your Melee skill via action sequences and have all the conditional checks in there
Really appreciate your help! I rewrote the if statements into one single action sequence and it seems to work!

The reason I was using a dummy skill is that I want the skill to hit different number of times based on the weapon equipped. For example, if actor "has a bayonet" he will hit 3 times, and if not he will only hit once. I want the 3 hits to register simultaneously so I'm using the <Repeat Hits: 3> tag from Battle Core. It seems that if I put both note tags in one skill like this:

<Repeat Hits: 3>
<Custom Action Sequence>

the "repeat hits" tag will not activate, and the skill only hits once.

I also couldn't find a function to change "repeat hits" in the common event using plug-in functions. So I had to start with a dummy skill with <Custom Action Sequence> note tag, and then force action different skills with different "repeat hits" note tags.

Is there a way to change the number of repeat hits in the common event? Or maybe use a variable in the "repeat hits" note tag (something like <Repeat Hits: $gameVariables.value(1)>)?
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,038
Reaction score
16,850
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.

 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,918
Reaction score
6,724
First Language
English
Primarily Uses
RMMV
The reason I was using a dummy skill is that I want the skill to hit different number of times based on the weapon equipped...Is there a way to change the number of repeat hits in the common event? Or maybe use a variable in the "repeat hits" note tag
Similar to above, I'd suggest you just ignore that and program it into your action sequence.

Conditional Branch -> have the bayonet equipped
-action effect
-action effect
 

Dawsmead

Villager
Member
Joined
Mar 22, 2023
Messages
22
Reaction score
2
First Language
English
Primarily Uses
RMMZ
Similar to above, I'd suggest you just ignore that and program it into your action sequence.

Conditional Branch -> have the bayonet equipped
-action effect
-action effect
...I did not know you can just repeat the action effect function like that. I ended up putting the "action effect" part in a loop and it works perfectly for multi hits. Thanks!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,918
Reaction score
6,724
First Language
English
Primarily Uses
RMMV
The action sequences commands are the commands. They do whatever you say in the order you say it.

You can put things in an order that doesn't make sense and doesn't do what you want, but there's no rule like "you can only do this here" or "you can only do this once."
 

Dawsmead

Villager
Member
Joined
Mar 22, 2023
Messages
22
Reaction score
2
First Language
English
Primarily Uses
RMMZ
You can put things in an order that doesn't make sense and doesn't do what you want, but there's no rule like "you can only do this here" or "you can only do this once."
Speaking of "doesn't do what you want"...

I was making this skill that [deals damage and applies state 17] to [every enemy without state 11] (see screenshot). It did not work after much tinkering, the skill damages every enemy and doesn't apply state 17 to anyone. so I just assumed that you can't move stuff around or use if statements in the action sequence.

Is this also achievable using action sequence? Thanks!

1679618178277.png
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,918
Reaction score
6,724
First Language
English
Primarily Uses
RMMV
I think you want to take that out of the action sequence. Use the Battle Core targeting notetags to target all enemies that don't have the state, then all you have to do is damage and apply the state to all targets (which you can do with the default skill settings, never mind action sequences).
 

Dawsmead

Villager
Member
Joined
Mar 22, 2023
Messages
22
Reaction score
2
First Language
English
Primarily Uses
RMMZ
I tried using the targeting tag, and it worked fine when targeting enemies with a certain state, but when I use the filter() function to check for NOT having a state, it crashed the game for some reason...

Update: nvm figured out the problem when I was taking a screenshot of the code. I was using

.filter(enemy => enemy.!isStateAffected(11))

But it should be

.filter(enemy => !enemy.isStateAffected(11))

My lack of understanding in basic Java operators has failed me again.

Thank you so much for pointing me at the right direction!
 

Latest Threads

Latest Posts

Latest Profile Posts

Damn. We’ve gotten so close to 0 reports, 0 approvals a few times over the past couple weeks. Does it matter? No. Is it realistic. No? Do I rely on your reports and want everyone to keep posting. Yes. Do I 100% games? …sigh… Yes.

Ah yes, all three of my moods all at once.
Here's a tutorial I did on how I made my Leonardo A.I.-assisted artworks for my game's recent update. :rhappy:

Disclaimer: This is meant to be a band-aid solution for people like me who aren't good artists or don't have the financial means to hire an amazing artist. If you have the means, please buy commissions and support your fav artists.:yhappy:

Found some expired fireworks in garbage today. I wonder if they still work.

Forum statistics

Threads
131,754
Messages
1,222,989
Members
173,514
Latest member
opossumtotal
Top