Help with some instant death moves

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
11
Reaction score
1
First Language
English
Primarily Uses
RM2k3
I have a problem with calculating some instant death-type skills in rpgmaker mv.

Simply put, I want to utilize spells with a similar mechanic as Light and Dark from the Persona series. Instead of run-of the mill instant death, i want it to be instant death that is element-based. So that some enemies resist or block the instant death effect like they would damage from a normal element. I don't want it to be something that deals damage like simply coding it "b.hp" or anything.

Additionally, I always really liked the Fear Status + Ghastly Wail instant kill combo (A skill that targets all foes and instantly kills enemies afflicted with fear). So i've been trying to code a similar concept, to no avail.

Could anyone potentially throw some ideas/script concepts that could achieve these? I've checked in other servers/forums and cannot find an ask that adequately answers this concept concisely.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
Note that for instant death skills it's often better to simply add state 1 (death state) rather than deal "a lot" of damage. That's because the target may resist flat damage (element rate or pdr/mdr traits). :kaoswt:

For a Ghastly Wail sort of thing, could try this in the skill formula box:
Code:
if (b.isStateAffected(123)) b.addState(1); 20
I.e. "if the target is affected by state 123 [fear], add state 1 [death] to them; then deal 20 damage regardless" (edit as needed). I imagine a similar idea could apply to other skills of this type.

If you don't want to use the formula box (e.g. it's a skill that does no damage and you don't want the "0" damage popup to appear), you could have a look at a plugin like Yanfly's Skill Core: it offers notetags where you can enter formulae to apply at various stages of a skill's execution (e.g. before/after the damage phase).
 

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
11
Reaction score
1
First Language
English
Primarily Uses
RM2k3
Note that for instant death skills it's often better to simply add state 1 (death state) rather than deal "a lot" of damage. That's because the target may resist flat damage (element rate or pdr/mdr traits). :kaoswt:

For a Ghastly Wail sort of thing, could try this in the skill formula box:
Code:
if (b.isStateAffected(123)) b.addState(1); 20
I.e. "if the target is affected by state 123 [fear], add state 1 [death] to them; then deal 20 damage regardless" (edit as needed). I imagine a similar idea could apply to other skills of this type.

If you don't want to use the formula box (e.g. it's a skill that does no damage and you don't want the "0" damage popup to appear), you could have a look at a plugin like Yanfly's Skill Core: it offers notetags where you can enter formulae to apply at various stages of a skill's execution (e.g. before/after the damage phase).
Thank you for the response!
I've tried your recommendations, but the skill simply applies the 20 damage, regardless of the fear state. It also doesn't seem to register the instant death portion in any way.

IDK maybe I'm just messing it up. I've tried variants on it but I'm still coming up short.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Tried modifying it to this?

Code:
if (b.isStateAffected(123)) {b.addState(1)}; 20
It would also be helpful if you could actually type out the ones you've tried so that we can help in finding the problem..
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
Like Engr. Adiktuzmiko says, it could be helpful if you actually copy+paste the stuff you've tried. I've used the approach I suggested and it's worked OK for me. Did you remember to replace "123" with the ID of your fear state? :)
 

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
11
Reaction score
1
First Language
English
Primarily Uses
RM2k3
i used the code and i did in fact replace the very clearly indicated variables that needed replaced. :LZSgrin:
im not a total idiot as to assume i can plug a code in without editing a very clearly placed stand-in number :LZSlol:
the code suggested doesn't work, as i stated, except in the fact it deals low damage regardless of status, which isn't the intended effect since its supposed to kill outright or not do anything at all.

As for the codes I've tested, I've tried a large variety of them. In the formula box, note tags, in-tandem with each other, in tandem with auto/global passives and the likes. I really don't feel like making a massive text dump of code. Besides, I doubt anyone will suggest what i was doing since even though i can write code semi-decent i feel like i took some odd liberties with what i had.

i'll keep at it but if anyone has any ideas on what type of code would work properly itd be a great help.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
First: making mistakes and being "an idiot" are entirely different things. I'm not trying to be condescending, I'm trying to be as inoffensively precise with my technical instructions to a complete stranger as possible. Hope your day improves! :kaoswt:

Second: we asked for you to show us exactly what you entered because your issue might be a typo, it might be simple ignorance of code restrictions (e.g. don't use leading zeroes on integers), it might be a plugin conflict, etc. Even one or two examples might have helped. Since you're the one seeking help, you can expect to have to put in more effort. :kaoslp:

Third: since you have now clearly specified that you want the skill to be strictly kill-or-fail, I would suggest Yanfly's Skill Core (to avoid the 0 damage popup thing I mentioned). I don't know if you've already tried it, but I will very precisely outline my approach (obviously you don't have to follow this exact process).
  1. Create a new project.
  2. Download and import the Skill Core plugin: http://www.yanfly.moe/wiki/Skill_Core_(YEP)
  3. Open the Database and:
    • On the States tab, create a new state in slot 11, named Fear.
    • On the Skills tab, create a new skill in slot 11, named Ghastly Wail.
  4. Edit the new skill:
    • Set its Scope to All Enemies, and
    • Add the following to its notebox:
      Code:
      <After Eval>
      if (b.isStateAffected(11)) b.addState(1);
      </After Eval>
  5. Go to the Actors tab and add a trait to Harold: Skill > Add Skill > Ghastly Wail.
  6. Close the Database and save the project.
  7. Re-open the Database, go to the Troops tab, and start a battle test with the default settings.
    Have Harold use Ghastly Wail: it should have no effect since the enemies are not affected by Fear.
  8. End the battle test, then for the first troop event page of troop 1:
    • Change its condition to Turn 0
    • Add the following command to the event:
      ◆Change Enemy State:Entire Troop, + Fear
  9. Start another battle test with the default settings.
    This time the enemies are all affected by Fear and should die if Harold uses the Ghastly Wail skill.
Again, this solution works for me. If it doesn't work for you, it might be due to a plugin conflict; I've seen a lot of people have problems with Yanfly's Damage Core, for example. In the Plugin Manager, try turning off all your plugins (Ctrl+A, right-click > Turn OFF) except Skill Core, save your project, then test. :kaophew:

If you are using the default battle system, an additional message a la "skill had no effect on [enemy]" will be shown. This is because the skill has no effects or formula. You can work around this by creating a new "dummy" state (i.e. one that does nothing) with no icon (so it's invisible to the player) and have your skill add this state with 100% chance. :kaopride:
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
If you only want it to damage if the fear state is not present:

Code:
if (b.isStateAffected(123)) {b.addState(1)};else{20};
If it doesnt work, then you might have a plugin that interferes with it, or maybe you modified state 1 which is a no-no.

Also are you testing this in-game or thru battle test? Do you save the project before testing? These are important because some stuff dont work in battle test, and unless you save the project, testing the game (thru both battle test and normal test) will use the last saved data and not the current one.
 

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
11
Reaction score
1
First Language
English
Primarily Uses
RM2k3
First: making mistakes and being "an idiot" are entirely different things. I'm not trying to be condescending, I'm trying to be as inoffensively precise with my technical instructions to a complete stranger as possible. Hope your day improves! :kaoswt:

Second: we asked for you to show us exactly what you entered because your issue might be a typo, it might be simple ignorance of code restrictions (e.g. don't use leading zeroes on integers), it might be a plugin conflict, etc. Even one or two examples might have helped. Since you're the one seeking help, you can expect to have to put in more effort. :kaoslp:

Third: since you have now clearly specified that you want the skill to be strictly kill-or-fail, I would suggest Yanfly's Skill Core (to avoid the 0 damage popup thing I mentioned). I don't know if you've already tried it, but I will very precisely outline my approach (obviously you don't have to follow this exact process).
  1. Create a new project.
  2. Download and import the Skill Core plugin: http://www.yanfly.moe/wiki/Skill_Core_(YEP)
  3. Open the Database and:
    • On the States tab, create a new state in slot 11, named Fear.
    • On the Skills tab, create a new skill in slot 11, named Ghastly Wail.
  4. Edit the new skill:
    • Set its Scope to All Enemies, and
    • Add the following to its notebox:
      Code:
      <After Eval>
      if (b.isStateAffected(11)) b.addState(1);
      </After Eval>
  5. Go to the Actors tab and add a trait to Harold: Skill > Add Skill > Ghastly Wail.
  6. Close the Database and save the project.
  7. Re-open the Database, go to the Troops tab, and start a battle test with the default settings.
    Have Harold use Ghastly Wail: it should have no effect since the enemies are not affected by Fear.
  8. End the battle test, then for the first troop event page of troop 1:
    • Change its condition to Turn 0
    • Add the following command to the event:
      ◆Change Enemy State:Entire Troop, + Fear
  9. Start another battle test with the default settings.
    This time the enemies are all affected by Fear and should die if Harold uses the Ghastly Wail skill.
Again, this solution works for me. If it doesn't work for you, it might be due to a plugin conflict; I've seen a lot of people have problems with Yanfly's Damage Core, for example. In the Plugin Manager, try turning off all your plugins (Ctrl+A, right-click > Turn OFF) except Skill Core, save your project, then test. :kaophew:

If you are using the default battle system, an additional message a la "skill had no effect on [enemy]" will be shown. This is because the skill has no effects or formula. You can work around this by creating a new "dummy" state (i.e. one that does nothing) with no icon (so it's invisible to the player) and have your skill add this state with 100% chance. :kaopride:
"Putting effort into it" is what I am doing :D i'll try what you are saying, but i am not opening a new game to try all that. it seems like a pointless waste of time. otherwise i am eager to try the code for the clearly worded kill-or-fail skill i specifically asked for help on initially and made very clear. thanks~~~
Ill update with a comment if it doesnt work, since there's an assumption i dont know how to test things by saving the project and testing it in troops or even a premature start.

Also... im not sure why you said all that stuff initially... i wasnt mad, and just because im self-deprecating doesnt mean im being super serious by calling myself an "idiot". relax, this is a simple columnfor an ask, i just wanna see input, not pull peeps' hairs lol XD
again thanks for the info, ill test it, and it certainly isn't offensive... lol.
 

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
11
Reaction score
1
First Language
English
Primarily Uses
RM2k3
Ah, I'm sorry, I forgot to do an update!
Thank you @caethyril for suggesting the Eval manipulations. For some reason, the (add.State) note tag doesn't seem to work no matter how i put it, but the skill works perfectly with the same coding and the "add.State" being switched to this:

<After Eval>
if (b.isStateAffected(12)) b.setHp(0);
else
if (b.isStateAffected(13)) b.setHp(0);
</After Eval>[/code]

Thank you very much for the suggestion :kaoluv:, because it was driving me crazy! Additionally, it triggers instant death from 2 states in the game, instead of just fear. I forgot to ask that but I knew how to do additional tagging in the notes.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,510
Reaction score
992
First Language
EN
Primarily Uses
RMMV
For some reason, the (add.State) note tag doesn't seem to work no matter how i put it, but the skill works perfectly with the same coding and the "add.State" being switched to this...
Oh, it's b.addState(1), not b.add.State(1) or anything (not sure if that was just a forum typo or something you'd tried in the editor). Code is very sensitive to grammar, case, etc. :kaoswt:

If you've got it working now, though, then that's the main thing! Happy RPG Making~ :kaojoy:
 

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
11
Reaction score
1
First Language
English
Primarily Uses
RM2k3
Omg I'm such a dumb noodle. XD I never even noticed I've been doing that... lol anyways I'll test that version out too but either way I really appreciate it. You've helped a ton :D
 

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

Latest Threads

Latest Profile Posts

Expectation: Design/dev a game for the game jam | Reality: "These codes suck, why did I do it this way? lemme fix this. Also what if I add feature xyz because... well, I can."
Did my first script call in an event! :kaopride: It's completely useless and just because I thought it'd be cute if looking at clocks in-game made the character say the real-world time, but it's fully functional scripting and I did it all by myself!
Stream will be going live shortly! I will be playing Resident Evil 3 Remake, and then I will be switching to a session of the Interactive Text Adventure! Feel free to drop by!
Spent all day working on something that ultimately has nothing "flashy" to show at the end of it. But that sense of achievement...
This is on the Amazon page for the FF7 Remake: 'If you get the game early, please think of others and don't spoil it for them. Please don't post videos or screenshots of the game until it is officially on sale on April 10.'

Forum statistics

Threads
95,622
Messages
930,537
Members
125,934
Latest member
Flat_Tire_Games
Top