Dawsmead

Villager
Member
Joined
Mar 22, 2023
Messages
21
Reaction score
1
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,835
Reaction score
6,644
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
21
Reaction score
1
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,012
Reaction score
16,826
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,835
Reaction score
6,644
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
21
Reaction score
1
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,835
Reaction score
6,644
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
21
Reaction score
1
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,835
Reaction score
6,644
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
21
Reaction score
1
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

Someone in a facebook group just corrected something I said, by saying exactly what I said. The mind boggles.
Less than 20 tiles remain in Inside_B that I need some kind of analogue of in my in custom Inside_B, and a whole 39 tiles that I didn't use and can thus make my own custom tiles or my own flavors of from other tile sheets.


Chapters advancing demonstration.
Main character roey will be revived after chapter 7, so the animations will be different after it
The title of the main characters will be ascended to celestial as well as wings and rings.
Next Up. The 2nd floor of the Western Academy!

Base:
Map012.png

With a little parallax magic *:



WestAcademyFl2.png


Anything you'd add?
BUwvmx.png


Introducing a new and exciting challenge mode!! Is our demo too easy? Did you get a rare pull and want to show off on stream? Please talk to the mysterious 2nd announcer who has 6 additional challenges PER ROUND! As a game developer, I struggled to complete some of the stage 2 challenges, so I hope you tactics fans have a blast!

Forum statistics

Threads
131,643
Messages
1,221,838
Members
173,385
Latest member
VoidKass1
Top