Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
I am trying to get the below code to work when applying a skill. Enemy casts Venom-> Venom Applies State 4 of Poison Damage and calls the common event AcidResistance(this checks if the player has the skill acid resist, and then applies the state 32 to them)-> PoisonDamage state does <skill damage: 23> in its notetag with use of Theo's Plugin Here to apply constant tick damage, however it will not allow me to change the amount of damage dealt in either the notetag in the skill Venom or the notetag in the state PoisonDamage. I am using Fomar's Passive Skills to essentially apply the Acid Resistance state so that poison ticks will do 40% less damage overall. Any help would be much appreciated.
if $gameActors.actor(1).isStateAffected(32)

{

Math.floor(a.mat*0.5*0.6);

}

else

{

Math.floor(a.mat*0.5);

}
 

Drakkonis

Regular
Regular
Joined
Mar 5, 2021
Messages
267
Reaction score
242
First Language
English
Primarily Uses
RMMZ
If that is exactly how the code appears in your game I would say the issue is that the evaluation isn't in parentheses. It should be:
JavaScript:
if ($gameActors.actor(1).isStateAffected(32))
Though I would imagine in that case you'd be getting an error message when it tried to do what you had written.
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
This is how it all looks currently in engine, if I playtest as is, it gives me 0 for the damage due to the formula box being empty, however, the notetag should be applying the custom formula I think? I could try it in the common event via the script, however if I do that do to 'a' being a local variable, it can't pull that into the script to use for damage calculations. I believe when I swapped the code over from the script to a notetag I forgot to reintroduce the parentheses, though it actually wasn't giving me any runtime errors or anything of that sort regardless if I remember.
 

Attachments

  • current.PNG
    current.PNG
    284.6 KB · Views: 24
  • current2.PNG
    current2.PNG
    276.3 KB · Views: 22
  • current3.PNG
    current3.PNG
    277.4 KB · Views: 18
  • current4.PNG
    current4.PNG
    118.1 KB · Views: 22

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,571
Reaction score
11,032
First Language
English
Primarily Uses
RMMV
You do not have a notetag there. You just have some JavaScript code written in your notes field - that doesn't do anything.

You would need to be using a plugin that lets you create alternate damage calculations in a notetag, and then you'd need to actually have a notetag.

Code:
<Example Notetag>
This is an example notetag format, but you'd have to follow the instructions in the plugin.
</Example Notetag>

What plugin are you using that you think allows you to do this?

P.S. What is the point of saying Math.floor(a.mat*0.5+0.6)? That will only ever increase the damage being done by 0 or 1, depending on whether you're starting with an odd value.

If you wanted to increase how much you're multiplying the magic attack by, you might have intended to do Math.floor(a.mat*(0.5+0.6)), but then there's zero reason to ever do that instead of just saying a.mat*1.1. So...what are you trying to achieve there?
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
You do not have a notetag there. You just have some JavaScript code written in your notes field - that doesn't do anything.

You would need to be using a plugin that lets you create alternate damage calculations in a notetag, and then you'd need to actually have a notetag.

Code:
<Example Notetag>
This is an example notetag format, but you'd have to follow the instructions in the plugin.
</Example Notetag>

What plugin are you using that you think allows you to do this?

P.S. What is the point of saying Math.floor(a.mat*0.5+0.6)? That will only ever increase the damage being done by 0 or 1, depending on whether you're starting with an odd value.

If you wanted to increase how much you're multiplying the magic attack by, you might have intended to do Math.floor(a.mat*(0.5+0.6)), but then there's zero reason to ever do that instead of just saying a.mat*1.1. So...what are you trying to achieve there?
So I was actually unaware that you could not write script/code into the note field to have it do anything without the use of tagging, so thank you for pointing that out. The plugins I am using are Fomar's passive skills plugin(which doesn't necessarily apply here) and Theo's StateDamageUsingSkill plugin, though that only provides me the option of doing <skill damage: 23> in the notes field of a state to copy the damage being dealt by the original skill on repeat, which is unfortunately not what I need exactly.
Also, the Math.floor code you mentioned is a.mat (in this case it was 30) cut in half so 15, and then multiplied by 0.6, essentially cutting it down to 9 damage. This would be the case if the code actually functioned as I would like it to. The end goal here for all of this is to do the following

Enemy Applies Venom->Adds DoT-> Checks if Player has the Poison resistance trait-> if yes modify damage to be 40% less than it normal -> if no, carry on doing the DoT as normal.

Due to the pay wall attached to using a majority of visustella's plugins(namely the DamageCore) I do not know how I would use the plugins that are free to carry out the formulas and everything that I want to do. I've looked into the SkillsStatesCore and I know it can do custom damage over time formula, but if I am not mistaken I may still be impeded by the lack of the DamageCore plugin.
 

Drakkonis

Regular
Regular
Joined
Mar 5, 2021
Messages
267
Reaction score
242
First Language
English
Primarily Uses
RMMZ
Off the top of my head, I have two suggestions. Without knowing the plugin from Theo more completely, both methods would not use it. Keep in mind I don't know if either method will work without testing all of that myself.

Method 1:
If the state runs a common event each turn, and only affects party members, you could simply have it check everything there.

Method 2:
There's a plugin (Yanfly, I THINK. Made for MV but I've used it in MZ without any issue) that lets you set up a base troop (usually troop 0), and the events in there will be copied to EVERY troop when battle starts. Custom DoT states could function that way, you could run events or code through there to grab any and ALL battle participants, check if they have the venom state, and if they do, check if they have the resistance state, and modulate the damage accordingly. This would be set up to occur every turn.

Results may vary, especially depending on when you want the damage dealt. Method 2 I know for sure will only fire once per turn, and deal damage to all affected parties simultaneously. And if you're using either of the two active battle systems, the timing might be a little weird and somewhat unpredictable. So slower battlers might get hit once per action, where faster battlers might get an extra turn or two per damage tick.

Other than that... I'd suggest finding a plugin that would give you better control over that sort of thing. Again, I don't know Theo's plugin, so I don't know if it has any such options.
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Off the top of my head, I have two suggestions. Without knowing the plugin from Theo more completely, both methods would not use it. Keep in mind I don't know if either method will work without testing all of that myself.

Method 1:
If the state runs a common event each turn, and only affects party members, you could simply have it check everything there.

Method 2:
There's a plugin (Yanfly, I THINK. Made for MV but I've used it in MZ without any issue) that lets you set up a base troop (usually troop 0), and the events in there will be copied to EVERY troop when battle starts. Custom DoT states could function that way, you could run events or code through there to grab any and ALL battle participants, check if they have the venom state, and if they do, check if they have the resistance state, and modulate the damage accordingly. This would be set up to occur every turn.

Results may vary, especially depending on when you want the damage dealt. Method 2 I know for sure will only fire once per turn, and deal damage to all affected parties simultaneously. And if you're using either of the two active battle systems, the timing might be a little weird and somewhat unpredictable. So slower battlers might get hit once per action, where faster battlers might get an extra turn or two per damage tick.

Other than that... I'd suggest finding a plugin that would give you better control over that sort of thing. Again, I don't know Theo's plugin, so I don't know if it has any such options.
So essentially, what I am trying to create is an instance of blue magic to be learnable by the player character. For instance, upon taking 50 ticks of poison damage, the player will then unlock Acid Resist I, which provides them a 40% damage resistance to all further ticks of poison damage after the battle in which they unlocked the skill(or during if I can code that). Enemies themselves wouldn't have access to it in most cases, however if by any and all participants you mean including ally units, that very well may work. The only thing Theo's plugin does is allow me to add a notetag to a singular state to function as a DoT, and it does not work on states not initially called by the skill itself. If I could find a plugin that works with MZ for it that would be great, although I am wondering if it might be worth it to try and make my own plugin for it.

If I were to attach a common event to the poisondamage and acid resist states, could I adjust damage and do a DoT formula with a script? Namely with if statements and a for loop?

Also, I am using turn based, and not active battle due to it being easier to create something functional in turn based. The damage would only be dealt after every turn, sort of like poison in pokemon
 

Attachments

  • Theo_StateDamageUsingSkill.js
    5.5 KB · Views: 3

Drakkonis

Regular
Regular
Joined
Mar 5, 2021
Messages
267
Reaction score
242
First Language
English
Primarily Uses
RMMZ
Well, for grabbing all participants, that was in case you wanted some enemies to be naturally already resistant to the damage. If you're not going to have something like that, that's less work to do.

Basically the grabbing all participants was so that you wouldn't need to check to see if X member was in the party before checking everything, you would instead check, say party member 1, no matter WHO that was. Same for enemy battlers. Without plugins, you'd only have to check a max of 4 party members and 8 enemies. If you're handy with JS you could even code a loop for that.

As for the plugin... if I'm seeing it right, it wants a skill to add a state, which will then point to another skill for the actual damage. So you'd essentially need two venom skills. One to apply the poison state, the other that will actually do the damage. So the first one would be the one the enemy actually uses, and all it will do is apply the state (unless you want any other immediate damage dealt by the skill), and then check to see if any battler has the resistance skill and add that state too. The second is one that no battler actually knows, and it's damage box would have your calculation code. You'd have to compress it into a single line, but it should be doable.
Then in the common event triggered by the second skill(I'd suggest checking to see if the plugin fully uses the second skill rather than just borrowing its damage. Maybe stick a message in the common event that only gets seen if it works the way we're assuming), check all members of the party for the state (the ones that can learn the resistance, anyway), and increment a variable tied to them. Then when the count hits your threshold, have that actor learn the resistance skill. Probably achieve this by setting a switch for the actors or just keep checking that the tick variable is above the proper threshold.

You may have to tweak it a bit to make sure that the resistance state only triggers once. It's possible that it also won't increment the resistance variables properly on turns where the poison state wears off. I'm not sure how that stuff is timed.

I hope I'm reading that right. Theo's coding style is remarkably compact, but that also makes it a little difficult to legibly parse. And I'm not all THAT familiar with those parts of the engine's combat code anyway.

Of course you could always attempt to code your own plugin, but that depends on your skill with JS and your familiarity with how the MZ engine works.

Kinda rambly, I hope I made ANY sort of sense. I've been out of the game a bit and haven't tested ANYTHING I've told you, since I've never needed to try to do this kind of thing.

Obviously this is easiest if only one character in the entire game can learn this. The more characters that can learn it, the more complex it might become, depending on various factors in your gameplan.
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Well, for grabbing all participants, that was in case you wanted some enemies to be naturally already resistant to the damage. If you're not going to have something like that, that's less work to do.

Basically the grabbing all participants was so that you wouldn't need to check to see if X member was in the party before checking everything, you would instead check, say party member 1, no matter WHO that was. Same for enemy battlers. Without plugins, you'd only have to check a max of 4 party members and 8 enemies. If you're handy with JS you could even code a loop for that.

As for the plugin... if I'm seeing it right, it wants a skill to add a state, which will then point to another skill for the actual damage. So you'd essentially need two venom skills. One to apply the poison state, the other that will actually do the damage. So the first one would be the one the enemy actually uses, and all it will do is apply the state (unless you want any other immediate damage dealt by the skill), and then check to see if any battler has the resistance skill and add that state too. The second is one that no battler actually knows, and it's damage box would have your calculation code. You'd have to compress it into a single line, but it should be doable.
Then in the common event triggered by the second skill(I'd suggest checking to see if the plugin fully uses the second skill rather than just borrowing its damage. Maybe stick a message in the common event that only gets seen if it works the way we're assuming), check all members of the party for the state (the ones that can learn the resistance, anyway), and increment a variable tied to them. Then when the count hits your threshold, have that actor learn the resistance skill. Probably achieve this by setting a switch for the actors or just keep checking that the tick variable is above the proper threshold.

You may have to tweak it a bit to make sure that the resistance state only triggers once. It's possible that it also won't increment the resistance variables properly on turns where the poison state wears off. I'm not sure how that stuff is timed.

I hope I'm reading that right. Theo's coding style is remarkably compact, but that also makes it a little difficult to legibly parse. And I'm not all THAT familiar with those parts of the engine's combat code anyway.

Of course you could always attempt to code your own plugin, but that depends on your skill with JS and your familiarity with how the MZ engine works.

Kinda rambly, I hope I made ANY sort of sense. I've been out of the game a bit and haven't tested ANYTHING I've told you, since I've never needed to try to do this kind of thing.

Obviously this is easiest if only one character in the entire game can learn this. The more characters that can learn it, the more complex it might become, depending on various factors in your gameplan.
When I read the syntax with it, it was Skill->AddState(the one that has a notetag of <skill damage: IDofSkill>) but then it only applies to that original state. If I could trigger a second skill via the existence of the acid resist state that may work.

So in theory, the concept is Venom->AddState -> check for acid resistance state -> if acid resist state, apply skill tied to that -> if no acid resist, call 2nd skill normally? And yeah I noticed for what it does, it's quite little code. I know when i was testing to see if I could have multiple states calling the first skill, it would only work for the original state, so when i removed the first state applied in script, it would no longer do damage even when being called properly.

What do you think would be the way I would call for a 2nd skill proc based upon a state? Because I know there is the option of addSkill, but that only adds it, it doesn't execute it. Also, thank you for your time and responses, I appreciate the help and feedback
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Well, for grabbing all participants, that was in case you wanted some enemies to be naturally already resistant to the damage. If you're not going to have something like that, that's less work to do.

Basically the grabbing all participants was so that you wouldn't need to check to see if X member was in the party before checking everything, you would instead check, say party member 1, no matter WHO that was. Same for enemy battlers. Without plugins, you'd only have to check a max of 4 party members and 8 enemies. If you're handy with JS you could even code a loop for that.

As for the plugin... if I'm seeing it right, it wants a skill to add a state, which will then point to another skill for the actual damage. So you'd essentially need two venom skills. One to apply the poison state, the other that will actually do the damage. So the first one would be the one the enemy actually uses, and all it will do is apply the state (unless you want any other immediate damage dealt by the skill), and then check to see if any battler has the resistance skill and add that state too. The second is one that no battler actually knows, and it's damage box would have your calculation code. You'd have to compress it into a single line, but it should be doable.
Then in the common event triggered by the second skill(I'd suggest checking to see if the plugin fully uses the second skill rather than just borrowing its damage. Maybe stick a message in the common event that only gets seen if it works the way we're assuming), check all members of the party for the state (the ones that can learn the resistance, anyway), and increment a variable tied to them. Then when the count hits your threshold, have that actor learn the resistance skill. Probably achieve this by setting a switch for the actors or just keep checking that the tick variable is above the proper threshold.

You may have to tweak it a bit to make sure that the resistance state only triggers once. It's possible that it also won't increment the resistance variables properly on turns where the poison state wears off. I'm not sure how that stuff is timed.

I hope I'm reading that right. Theo's coding style is remarkably compact, but that also makes it a little difficult to legibly parse. And I'm not all THAT familiar with those parts of the engine's combat code anyway.

Of course you could always attempt to code your own plugin, but that depends on your skill with JS and your familiarity with how the MZ engine works.

Kinda rambly, I hope I made ANY sort of sense. I've been out of the game a bit and haven't tested ANYTHING I've told you, since I've never needed to try to do this kind of thing.

Obviously this is easiest if only one character in the entire game can learn this. The more characters that can learn it, the more complex it might become, depending on various factors in your gameplan.
And for now the game will only involve one player character, i may add more in the future but for ease of testing and coding, it will be one.
 

Drakkonis

Regular
Regular
Joined
Mar 5, 2021
Messages
267
Reaction score
242
First Language
English
Primarily Uses
RMMZ
When I read the syntax with it, it was Skill->AddState(the one that has a notetag of <skill damage: IDofSkill>) but then it only applies to that original state. If I could trigger a second skill via the existence of the acid resist state that may work.

So in theory, the concept is Venom->AddState -> check for acid resistance state -> if acid resist state, apply skill tied to that -> if no acid resist, call 2nd skill normally? And yeah I noticed for what it does, it's quite little code. I know when i was testing to see if I could have multiple states calling the first skill, it would only work for the original state, so when i removed the first state applied in script, it would no longer do damage even when being called properly.

What do you think would be the way I would call for a 2nd skill proc based upon a state? Because I know there is the option of addSkill, but that only adds it, it doesn't execute it. Also, thank you for your time and responses, I appreciate the help and feedback
This is why I'd be testing each little piece to make sure I knew what it did do and what it didn't do. I do the same thing while coding. Even little stuff I KNOW will work, I'll still stop, save, and run what I've got to make sure I don't get too far ahead of myself and fail because of something I didn't check hours ago.

First, make sure that you CAN trigger a different skill than the one that caused the initial state. Like I said, run a common even that contains a junk message or something. Or even just a console.log script call. Stick that common event in the 2nd skill, not the first. If you see the message/log, it'll work, and it becomes a case of exactly HOW to do what you need. If not... more brainstorming will be needed. Make sure of what you're working with first.
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Would you happen to know if you can call the execution through a common event? Obviously a junk message would be in order but I have only ever seen a function for adding a skill to a roster and not executing on that skill
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,571
Reaction score
11,032
First Language
English
Primarily Uses
RMMV
So I was actually unaware that you could not write script/code into the note field to have it do anything without the use of tagging, so thank you for pointing that out.
Yes, by default it's exactly what it says - a field to take notes about database entries.
Also, the Math.floor code you mentioned is a.mat (in this case it was 30) cut in half so 15, and then multiplied by 0.6, essentially cutting it down to 9 damage. This would be the case if the code actually functioned as I would like it to.
I misread it as +0.6 instead of *0.6. Still, that's a pointless addition, since the order of multiplication doesn't matter - so it would be simpler to say Math.floor(a.mat*0.3)
Enemy Applies Venom->Adds DoT-> Checks if Player has the Poison resistance trait-> if yes modify damage to be 40% less than it normal -> if no, carry on doing the DoT as normal.
It seems to me you should just use VisuStella's Skills and States Core. In your poison state, you'd put the notetag:
Code:
<JS HP Slip Damage>
damage=Math.floor(user.mat * target.isStateAffected(32) ? 0.3 : 0.5);
</JS HP Slip Damage>
Due to the pay wall attached to using a majority of visustella's plugins(namely the DamageCore) I do not know how I would use the plugins that are free to carry out the formulas and everything that I want to do.
Skills and States is free, what I typed above seems to do exactly what you want. If I misunderstand and you think you need something from Damage Core, please clarify.
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Yes, by default it's exactly what it says - a field to take notes about database entries.

I misread it as +0.6 instead of *0.6. Still, that's a pointless addition, since the order of multiplication doesn't matter - so it would be simpler to say Math.floor(a.mat*0.3)

It seems to me you should just use VisuStella's Skills and States Core. In your poison state, you'd put the notetag:
Code:
<JS HP Slip Damage>
damage=Math.floor(user.mat * target.isStateAffected(32) ? 0.3 : 0.5);
</JS HP Slip Damage>

Skills and States is free, what I typed above seems to do exactly what you want. If I misunderstand and you think you need something from Damage Core, please clarify.
Thank you for the response, and the code snippet, I will look into and test this when I get home tonight. I am actually unsure if I need DamageCore. If I can do the proper notetags and formulae without use of the damagecore plugin that would be awesome. I don't know for sure what all the damagecore provides, though I remember one tutorial with yanfly's plugins in regards to damage over time required it. I appreciate you taking the time to respond and help. I am still learning this engine and the intricacies of it from scratch. Also, yeah the redundancy of multiplying 0.5 by 0.6 is definitely not needed, i just did that because it was quicker for me to jot down and to give exact context as to what would be happening and easier processing in someone's head.

I hope your day is going well, I will give an update on how it goes once I can test tonight.
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Yes, by default it's exactly what it says - a field to take notes about database entries.

I misread it as +0.6 instead of *0.6. Still, that's a pointless addition, since the order of multiplication doesn't matter - so it would be simpler to say Math.floor(a.mat*0.3)

It seems to me you should just use VisuStella's Skills and States Core. In your poison state, you'd put the notetag:
Code:
<JS HP Slip Damage>
damage=Math.floor(user.mat * target.isStateAffected(32) ? 0.3 : 0.5);
</JS HP Slip Damage>

Skills and States is free, what I typed above seems to do exactly what you want. If I misunderstand and you think you need something from Damage Core, please clarify.
I will be editing this comment to attach files to ask for more clarity on my conundrum but as of current, the code you provided does not seem to be parsing any issues in the console, however I am noticing that I am not seeing any tick damage. I may be putting the code in the wrong sections or I may be messing something up that could be seen as a pretty simple rookie mistake so I will be adding screenshots on this reply for context. I am seeing about adding a passive condition to my acid resist state as I've noticed replies from you on threads of this nature before when searching, so I figure you likely have good insight on what I should do to handle it. Adding screenshots of the following now, Actor in question, the state to be labelled passive, my common event, the PoisonDamage State, and the Venom skill.

Edit: added screenshots, the poison damage note only has code broken for the purposes of reading, because I haven't checked if word wrap is available for notes. With the way the event is right now I don't really need to call it, but I was trying to see if it would output to the log(which it didn't from what I saw, unless I am looking in the wrong location)
Edit2: added plugins screenshot just incase.
 

Attachments

  • actor.PNG
    actor.PNG
    217 KB · Views: 4
  • acidresState.PNG
    acidresState.PNG
    295.9 KB · Views: 5
  • commonForCheckingIfWorking.PNG
    commonForCheckingIfWorking.PNG
    115.2 KB · Views: 5
  • likelyRedundantButAdding.PNG
    likelyRedundantButAdding.PNG
    261.2 KB · Views: 4
  • venom.PNG
    venom.PNG
    268.8 KB · Views: 4
  • poisonDamage.PNG
    poisonDamage.PNG
    293 KB · Views: 4
  • plugins.PNG
    plugins.PNG
    183.9 KB · Views: 5
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,571
Reaction score
11,032
First Language
English
Primarily Uses
RMMV
That's a bunch of screenshots.

So, some things.

- Your Acid Resist I skill is not only redundant, but broken. The Effects of a skill only take effect when the skill is used. If it isn't used in combat (I don't know if your actors actually have the Passive skill category, and execute those skills, but it's oddly named if they do!), then they don't do anything. The only ways to have passive skills are to either use code in other places that checks whether they've learned that skill, or have the skill bestow a passive state (which you've already put directly onto your actor).

- condition=user.isLearnedSkill(231) should be the correct code for your passive state. If that's actually what you have there right now, that could be why it's not working, as that partial line of code won't be returning true. A more typical way to do this is to not have any condition in your passive state, and move the passive state notetag out of your actor and into the skill.

-- The console log in the event won't work because passive states aren't picked up by event commands. You look for it the correct way in your PoisonDamage code.

I'm not sure why your poisonDamage isn't working. If you replace the equation with something like damage=10; does it do anything? If you put a console.log() in there, does it display anything at the end of the turn?
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
- Your Acid Resist I skill is not only redundant, but broken. The Effects of a skill only take effect when the skill is used. If it isn't used in combat (I don't know if your actors actually have the Passive skill category, and execute those skills, but it's oddly named if they do!), then they don't do anything. The only ways to have passive skills are to either use code in other places that checks whether they've learned that skill, or have the skill bestow a passive state (which you've already put directly onto your actor).
Testing the rest of what you've suggested now, and I was waiting to finish the passive condition until I got your input because I had forgotten the syntax needed to check for the skill. The passive skill category shows up on the player's character menu and I can turn the skill on and off, though I don't believe it does much else other than that, so I definitely can see it as being redundant, it's more so just a way for the future player to know that they've unlocked a new passive skill, or I guess you could consider it more so a trait, however I don't know if I could implement a passive trait that would provide the desired effect. Here's the plugin specifically if you are curious about the documentation at all. Fomar's Passive Skills
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
- condition=user.isLearnedSkill(231) should be the correct code for your passive state. If that's actually what you have there right now, that could be why it's not working, as that partial line of code won't be returning true. A more typical way to do this is to not have any condition in your passive state, and move the passive state notetag out of your actor and into the skill.

I am actually seeing the passive now in the character window, and the damage worked when set to a flat 10 and it does in fact see it and output to console! Also, I just want to say that I appreciate you taking the time to help me out and respond to me, it means a lot to me, so thank you very much.

Edit 1: Just checked with the formula proposed earlier and it does not work, but a flat number does. Though, it is still printing to the console. damage=Math.floor(user.mat * target.states().includes($dataStates[32]) ? 0.3 : 0.5);

Edit 2: Alright so I just did some testing and rearranging of the statement and I found that the following actually works:
damage=target.states().includes($dataStates[32]) ? Math.floor(user.mat * 0.3) : Math.floor(user.mat * 0.5);
Which I believe is the case because it was likely trying to multiply the casters magic attack by a piece of code with a NULL integer, due to it being classified as a string, so it was just the placement of the original calculation. Regardless, this actually completely solves the issue that has been plaguing my mind for the past several days.

Thank you so very much for all your help! I appreciate it a ton. I want to iterate that again.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,571
Reaction score
11,032
First Language
English
Primarily Uses
RMMV
Which I believe is the case because it was likely trying to multiply the casters magic attack by a piece of code with a NULL integer, due to it being classified as a string, so it was just the placement of the original calculation.
That's odd, I don't see anything there that would be classified as a string. But I'm glad it's working for you!
 

Xarnic

Villager
Member
Joined
Jan 29, 2022
Messages
28
Reaction score
5
First Language
English
Primarily Uses
RMMZ
That's odd, I don't see anything there that would be classified as a string. But I'm glad it's working for you!
I actually don't know for sure what it would be considered? What would a pointer classify target.states().includes($dataStates[32]) as? Would it be pointing to a NULL value? It's all based upon how it's stored likely and I imagine it didn't know for sure what to do so it probably took the damage calc as damage=; with no arguments available for it to output. Which... makes me wonder how that didn't throw any runtime errors and give me any indicators in console.

Of course on my end this is all just conjecture and guesswork as I don't know how JS classifies these things when they are defined in the realm of math and numerical value.
 

Latest Threads

Latest Posts

Latest Profile Posts

Driving to Florida today to spend a week like we did last year. Looks like it will just be me and the Mrs. But she sleeps a lot longer than me so I will still have time to work on my Game Jam project. :stickytongue:
I think I have an unhealthy obsession with ornamentation... :kaoswt:

alice_frame_leaves.png
Pixel art is TOO hard
Respect the basic tilesets... ...
Making the next dungeon look more "dungeon" with traps, switch etc...
Harder than I thought it would...

Forum statistics

Threads
136,677
Messages
1,268,673
Members
180,383
Latest member
DaveMcLion
Top