SMOOTHBOI06'S PROFILE
Search
Filter
[RMMV] Need help with making the Level 5 Death Skill from FF5
author=coelocanthSkill just deals 1 damage but does'nt kill any actors.
set the damage to a flat 1, it'll do 1hp damage and/or kill
At this point i just kinda already gave up on making this skill.
[RMMV] Need help with making the Level 5 Death Skill from FF5
author=coelocanth
That probably means your actor's hp has been set to a strange value (like infinity or Not A Number), which could be a problem with a damage formula.

I really don't know whats wrong with skill at this point since i tried reordering my plugins, which did nothing, and changing the damage type, which just causes the skill to just not do anything. Im at a loss of what to do here.
[RMMV] Need help with making the Level 5 Death Skill from FF5
author=coelocanth
Right, so change addstate to addState and it should work.
The red text is called a stack trace.
The first line is the actual error "TypeError: b.addstate is not a function".
The rest of it is showing all the function calls that led to that error happening. When debugging more complex problems than this, it would help understand what happened.
The underlined text shows the file and line number (they are also clickable links)
The second error about isDevToolsOpen is an incompatibility of Yanfly's plugin with MV 1.6.1 and can be solved by updating those plugins. It's mostly harmless though, it just means the wrong error is displayed on the screen when the game crashed, but you can find the right error using the dev tools as you just did.
Ok so this is kinda weird....
After fixing the code and testing the skill, this error message popped up.

Since it said i needed to update the core engine, i went to yanfly's site and downloaded the free plugins and replaced them. Now after i did that, this message popped up:

[RMMV] Need help with making the Level 5 Death Skill from FF5
author=coelocanth
Press F12 to open the dev tools window in test play to see the error properly in the console tab.
I think I typoed addState as addstate.
The console window should show you that with something like "addstate is not a function"

Hopefully this is a good enough picture
[RMMV] Need help with making the Level 5 Death Skill from FF5
author=coelocanth
Because you're using Yanfly plugins, it's actually easier.
Use YEP_SkillCore plugin and put this in your skill's note box:For the damage formula itself, I'd suggest this:
<Post-Damage Eval>
if(b.level % 5 == 0) {
b.addstate(1);
}
</Post-Damage Eval>but you could also just leave it blank if you prefer.
(b.level % 5 == 0) ? 9999 : 0
A skill that does no damage may show a miss or "there was no effect on goblin"
Another consideration is that the "addState" function is unconditional - your level 5 death spell will kill people even if they have death resist accessories equipped.
To account for resistances, you should instead use "itemEffectAddState", like this:
<Post-Damage Eval>
if(b.level % 5 == 0) {
this.itemEffectAddState(target, {
code: Game_Action.EFFECT_ADD_STATE,
dataId: 1, // dataId is the state number (0 for "normal attack" to use weapon states)
value1: 1, // value1 is the normalized chance to apply the state (1 = 100%)
value2: 0 // value2 is not used for states
});
b.addstate(1);
}
</Post-Damage Eval>
In this case it's a bit more complicated as you're building the data structure which would be in the database entry for the skill in code.
And finally for people with more of a coder mindset, I think an elegant way would be to make custom hit chances on skills.
This function in Game_Action could be overridden:
Game_Action.prototype.itemHit = function(target) {
if (this.isPhysical()) {
return this.item().successRate * 0.01 * this.subject().hit;
} else {
return this.item().successRate * 0.01;
}
};
And since it has both the target as a an argument and the user as this.subject(), a custom hit chance could be written that takes levels into account.
Then the skill in the database could just have "add state: death 100%", but a custom hit chance in the notes like this:In that case, the skill would miss anyone whose level isn't divisible by 5, and hit if it is (with the death state being added only to targets that were hit)
<custom success rate>
b.level % 5 == 0 ? 1 : 0
</custom success rate>
Wow! never knew i could make the skill in all those ways. Anyway i tried to use the first way with the <Post-Damage Eval>
if(b.level % 5 == 0) {
b.addstate(1);
}
</Post-Damage Eval> But i get this error screen whenever the enemy uses this skill]
[RMMV] Need help with making the Level 5 Death Skill from FF5
author=MarrendSo once again it did'nt work.
Yeah, something is definitely wrong if that formula won't even work on an instance of `Game_Actor`. Which absolutely has a `level` attribute as part of MV's native code.
Does MV have a debug mode? I know you can access a debug window while in a test-play with F12 in MZ, so, I kinda think MV might have something similar. I guess I'm just curious about what's going on with the formula. Where, and how, it's messing up.
I suppose another way to write it could be...if (b.level % 5 === 0) { b.addState(1); };
...like so, but, I've doubts that would make any kind of difference considering the success rate so far. Lemme also try dropping a line about this on our Discord channel to see if we can't get another eye on this.
I started getting curious and tried making the skill on a new project and tested it, and it worked there. So ther must be something wrong with my project.
EDIT: Apparently the Yanfly battle engine core plugin was the reason why it didnt work. Which is not good cosidering most of the stuff i want to do with my game revolves around it.
[RMMV] Need help with making the Level 5 Death Skill from FF5
author=Marrend
For what it's worth, I opened an MZ project that included an enemy level feature/plugin, and made a skill with...
b.level % 5 === 0 ? b.addState(1) : 0;
...that damage formula to see how it fared. My first test was against a group of level 1 critters. It did nothing. My next test was against a group of level 5 guys. The skill wiped the board. The third test was in a mixed group of a level 13 guy and a level 15 guy. The level 13 was fine, the level 15 guy died.
Saying that, I don't have MV to delve further into the differences between what's whatever is going on in my project versus why it could be failing in yours. Just to be sure, though, did you test it against both an inappropriate enemy and an appropriate enemy?
The new code still wont work. At first i gave it to the enemy to test what it would do to a level 5 actor and a level 1 actor and it did nothing. then i tried the same with the new code and still nothing happened. Since you made this code in MZ im assuming it probably wont work the same way it did in MV.
[RMMV] Need help with making the Level 5 Death Skill from FF5
author=Marrend
I think you're on the right track with the formula, but, `addState` won't work by itself. The function you're looking for needs an instance of `Game_Battler` to work, and the `state_id` to apply needs to be in parentheses. So, probably more like...
b.level % 5 === 0 ? b.addState(1) : 0;
...this, instead.
i put the code in and it still doesnt do anything.
[RMMV] Need help with making the Level 5 Death Skill from FF5

If you dont know what the skill does in the original game, Level 5 Death instantly kills any and all targets whose level is a multiple of 5. So if an Actor is Level 10, 15, 20, 25, 30, 35, 40, 45, etc. They would instantly be defeated. The skill can also be used by the player as a Blue Magic spell. I am also replicating this via Yanfly's Skill Core plugin and using the Blue Magic code from here: http://www.yanfly.moe/wiki/Blue_Magic_(MV_Plugin_Tips_%26_Tricks).
Since the player can use this skill, enemies will also have levels via Yanfly's Enemy Levels plugin. The skill will work the same way when used on enemies, so if a player uses LV 5 Death and any enemy the player is fighting is Level 10, 15, 20, 25, 30, 35, 40 And so on, the enemy will instantly be defeated. and if they aren't , they wont be affected by the skill.
This is how i set up the skill.
Unfortunatly, the skill doesn't work on actors who have levels that are multiples of 5, So im sure im doing somthing wrong. Any help fixing this would be appreciated.














