Enemy death after using it's skill

Shinma

Lurker
Veteran
Joined
Dec 29, 2012
Messages
756
Reaction score
341
First Language
English
Primarily Uses
RMMV
Hey guys, I am having a little bit of difficulty creating a skill. I am essentially trying to make a skill similar to what the bombs in Final Fantasy has, where the enemy blows up, killing itself and damaging the players.

I have tried several ways, including adding a.add_state(1)to the damage formula. While this does  seem to kill the enemy, it leaves it battle on the screen.

Any suggestions?
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
Just put:

a.hp -= a.hp; damage_formulaas the formula and it should kill the attacker as the skill is used.
 
Last edited by a moderator:

Shinma

Lurker
Veteran
Joined
Dec 29, 2012
Messages
756
Reaction score
341
First Language
English
Primarily Uses
RMMV
How odd, similar to above, that works but the battler remains on the battlefield.
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
What scripts are you using, that shouldn't be happening. (what about killing them normally?)
 

Shinma

Lurker
Veteran
Joined
Dec 29, 2012
Messages
756
Reaction score
341
First Language
English
Primarily Uses
RMMV
The only script I have running is Wortana's Multiple Fog script.

If I kill it normally the battler fades away as normal. However, if I let it use the "burst" skill (enemy bursts leaving a chance to poison the party and killing the enemy) then the enemy dies, is no longer selectable in battle, but the battler remains.

Start of fight:



Slime using Burst:



Slime unable to be selected, but Swamp Rat is:



End of battle, Swamp Rat battler is gone, Slime battler remains:

 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
The only script I have running is Wortana's Multiple Fog script.

If I kill it normally the battler fades away as normal. However, if I let it use the "burst" skill (enemy bursts leaving a chance to poison the party and killing the enemy) then the enemy dies, is no longer selectable in battle, but the battler remains.
Hmm... comment retracted. Apparently this is actually a base game bug and I just assumed it was something else because a battle script I'm using already fixes it, but in a base unaltered game it does exactly as you've described. (I'm not sure which script I have that fixes this, however. My first thought was yanfly's battle script but it still does it with that one alone.)

Ok, a fix that I actually tested to work is as follows: Create the skill and have only the actual damage processing in your formula box. Have it also call a common event that turns on a switch. Go to the troop event of any troops that include this enemy and have a page set to a span of 'turn' and the conditional that 'switch[switch_id] is on' and have that event kill off the enemy that uses that skill and turn off the switch. (in the event that you have a troop with multiple enemies with said skill, add: a.add_state[state_u_r_not_using] to the formula and perform a conditional check for which enemy has said state to determine who to kill. I just use the troop event because it's easier than doing 8 conditional checks because you know already exactly which enemies will possibly use the skill.) Hope I helped this time.
 
Last edited by a moderator:

Shinma

Lurker
Veteran
Joined
Dec 29, 2012
Messages
756
Reaction score
341
First Language
English
Primarily Uses
RMMV
Alas, no luck:

Event Screen (Burst skill calls the common event Burst, which in turn turns on the switch Burst Switch)



Switch is turned in (I added Yanfly's Extended Debugging Tools script to ensure):



It kills off the enemy like it should, because I can no longer select it in the next round, but it leaves the battler still. I guess I am going to have to find a script for it if I want to use it.
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
Don't use a conditional branch in the battle event for the switch. You see the box that says 'Condition: Turn number 0'? change that condition to show that the switch is on instead, a conditional branch in the event would only be used for checking multiple enemies to see which one has the dummy state in a troop where you have more than one enemy with the 'burst' skill. The way you have it set up it will check for the switch being on only on turn 0 (which is before anyone can have any chance to choose an action) changing that to: switch[0002] is on will make the event activate whenever the switch is turned on, but if you have more than one with the skill again make sure you set span to 'turn' so that it can occur more than once. (also make sure at the end of that event you turn the switch off, otherwise after using the skill once all enemies with the burst skill will instantly die at the beginning of each battle.)

Edit: actually lower the enemies hp by it's max amount (or 999999 is what I tested) I'm not sure what is going on with actually applying the death state but it doesn't seem that it works like it should.
 
Last edited by a moderator:

Shinma

Lurker
Veteran
Joined
Dec 29, 2012
Messages
756
Reaction score
341
First Language
English
Primarily Uses
RMMV
Yay. That worked. Thank you VERY much, Alexander!
 

Fynmorph

Villager
Member
Joined
Oct 9, 2015
Messages
16
Reaction score
2
First Language
FRENCH
Primarily Uses
I found a workaround for this. (since i am also working on a kamikaze enemy). Without having to use switches.

In your damage formula, you can put a.perform_collapse_effect to force the collapse effect.

So personally i have :
"a.hp -= 5;a.perform_collapse_effect;5"
which deals 5 damages to itself and the party.

(I'm letting future people know if they stumble upon this thread like I did).
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
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'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top