Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hey there Ramza, I just had a quick question. I was just wondering if there was anyway to have an actor have a different off hand damage % than the default set in the plug in parameters.

My idea is to have an actor and an item that is "ambidextrous" so they get no penalty from the weapon in the off hand slot. If this isn't doable no big deal at all. I know there isn't any listed code to do that but thought maybe you knew of a script command to over write that or something.=)

(3 edits) (+1)

The boxes for the dual wield modifiers (two-hand, offhand, dual wield damage %) are javascript evals.

This means you can use a ternary operator to make the value one of two values depending on a conditions.

if you put the following in your offhand modifier parameter box, it will increase the offhand damage to 90% if the actor has a state, or if the actor doesn't have the state, 75%.

(this.isStateAffected(X)) ? 0.9 : 0.75

because of the way the plugin uses this formula (this) is the actor. In the above statement, if the actor is affected by state X, his offhand modifier is 90%, but if he isn't, it's the base 75%.

You can also nest these, if you have multiple states that change the penalty (or grant bonuses)

(this.isStateAffected(X)) ? 0.9 : (this.isStateEffected(Y)) ? 0.99 : 0.75

It doesn't have to be a state either, anything on the actor object can be used, such as his name:

(this.actor().name == 'Harold') ? 1.12 : 0.75

Hope this helps.

Awesome this is perfect. Thank you very much for showing me this, You're the best Ramza, keep up the amazing work.