Attack State Function

Hey there!

I was wondering... We have a trait such this one:
1666721359203.png


How can we manipulate it through scripts and or variables though?
Is there any function I could return to manipulate it?

i.e: displaying my chance to apply Bleeding on my menu; increasing my chance based on my atk; etc

Appreciate your time reading.

Best
I'm not sure if anyone has made a Dynamic Traits plugin for MZ (or if any of the MV ones will work either natively or via FOSSIL), but that's something to look at.

If you get a variable chance to apply it, you could use Eli's Global Text to reference it in your menu.

It might be easier to take it out of an Attack State trait and use notetags from VisuStella Battle Core in your skills to apply it after a skill is resolved using whatever code formula you want.
You could also use the damage formula to do this. My javascript is not so good, but I've seen similar situations pass by on the fora frequently, so it shouldn't be too hard to find the right formula.

Another option is to do it trough common events triggered by the skill. In this case you can do something like this:

Variable X random 1 ~ 100
If X is lower than or equal to casters ATK → Apply state to target
If X is higher than casters ATK → Do nothing

In this case casters ATK is equal to the chance in % to apply the state.

This is a bit of a work around and might not be as smooth as a plugin or a damage formula solution, but it works.
I'm not sure if anyone has made a Dynamic Traits plugin for MZ (or if any of the MV ones will work either natively or via FOSSIL), but that's something to look at.

If you get a variable chance to apply it, you could use Eli's Global Text to reference it in your menu.

It might be easier to take it out of an Attack State trait and use notetags from VisuStella Battle Core in your skills to apply it after a skill is resolved using whatever code formula you want.

Well, I have been using notetags from battle core indeed but I mean, if there's a trait only for that purpose I thought it would has attached as well a function.

Unfortunately I can't find anything related to Dynamic Traits for MZ though...

You could also use the damage formula to do this. My javascript is not so good, but I've seen similar situations pass by on the fora frequently, so it shouldn't be too hard to find the right formula.

Another option is to do it trough common events triggered by the skill. In this case you can do something like this:

Variable X random 1 ~ 100
If X is lower than or equal to casters ATK → Apply state to target
If X is higher than casters ATK → Do nothing

In this case casters ATK is equal to the chance in % to apply the state.

This is a bit of a work around and might not be as smooth as a plugin or a damage formula solution, but it works.

I can't really use damage formulas nor common events because this situation above was only one from a few... There's like 100 stuff happening from this trait 🙁

But I appreciate your idea, though. If it was something singular I'd definetly think of something around it.

Best
Unfortunately I can't find anything related to Dynamic Traits for MZ though...
No, you'd have to do the legwork. You'd check out the plugins (I know of one by Shaz and one by Galv, both for MV), and see if they work. If they don't, check out Project FOSSIL and see if that works.

But honestly, I can't think of a reason for you to go through any of that when this is so simple to implement with notetags.
No, you'd have to do the legwork. You'd check out the plugins (I know of one by Shaz and one by Galv, both for MV), and see if they work. If they don't, check out Project FOSSIL and see if that works.

But honestly, I can't think of a reason for you to go through any of that when this is so simple to implement with notetags.
That might require a rework then.

I am right now only using Math.random() <= 0.01 let's say.
I will probably need to:
Create a custom parameter -> Change that parameter through variables -> use that as a condition check inside a <JS Pre-Damage as User> kind of notetag.

That might solve it but I was just wondering if there were any functions to return this inside the engine xD
That might solve it but I was just wondering if there were any functions to return this inside the engine
I'm confused about what you're asking. What is "this" that you want a function to return? If you have an Attack State trait, yes, you can easily get the percent chance associated with that trait.

But you're talking about changing that during gameplay, which is not easily done. You'd have to use the plugins I mentioned above and insert code someplace to define how that is changing.

At that point, it would be just as much typing and fewer plugins to do the same calculations in your state notetags or wherever.

Create a custom parameter -> Change that parameter through variables -> use that as a condition check inside a <JS Pre-Damage as User> kind of notetag.
Sure? I'm not sure what "change that parameter through variables" means.

For example, if you want to have a 1% chance to apply bleeding plus 1% for every 10 points of ATK, it's simply:
Code:
if (Math.randomInt(100)<1+(user.atk/10))
    target.addState(bleeding_id);
and that's your entire notetag.

If you need more specific help, then you'll need to be more specific about exactly what you want to do - I still don't know exactly how you want this to work. But it does seem like you're making this more complicated in your head than it needs to be 😉
That's fine 🙂
What I did:
- Created a custom parameter which is influenced by a variable and actor atk.
- Used that custom parameter inside a condition.
- Now I can use it everywhere and manipulate it through setValue variable commands as well.

Appreciate your help though!
You were really helpful!

Original thread: https://forums.rpgmakerweb.com/threads/attack-state-function.152235/