Baseparamcontrol by yanfly(plugin)

I got errors with this formula and don't know why.
I checked multiple times and tweaked in different manner but still not works.
the variables are additional parameters as variable which allow me to implement a scaling addition to base param.
just tell me if something is wrong with this formula..


(base + plus + (if (user.actorId == 1) v[42]*Math.sqrt(v[42]); elsif (user.actorId == 2) (v[52]*Math.sqrt(v[52]))*2/3; elsif (user.actorId == 3) (v[62]*Math.sqrt(v[62]))*4/3; elsif (user.actorId == 4) (v[72]*Math.sqrt(v[72]))*2/3; elsif (user.actorId == 5) (v[82]*Math.sqrt(v[82]))*2/3; elsif (user.actorId == 6) (v[92]*Math.sqrt(v[92]))*2/3; elsif (user.actorId == 7) v[102]*Math.sqrt(v[102]); end)) * paramRate * buffRate + flat
I got errors with this formula and don't know why.
I checked multiple times and tweaked in different manner but still not works.
the variables are additional parameters as variable which allow me to implement a scaling addition to base param.
just tell me if something is wrong with this formula..


(base + plus + (if (user.actorId == 1) v[42]*Math.sqrt(v[42]); elsif (user.actorId == 2) (v[52]*Math.sqrt(v[52]))*2/3; elsif (user.actorId == 3) (v[62]*Math.sqrt(v[62]))*4/3; elsif (user.actorId == 4) (v[72]*Math.sqrt(v[72]))*2/3; elsif (user.actorId == 5) (v[82]*Math.sqrt(v[82]))*2/3; elsif (user.actorId == 6) (v[92]*Math.sqrt(v[92]))*2/3; elsif (user.actorId == 7) v[102]*Math.sqrt(v[102]); end)) * paramRate * buffRate + flat
Well without knowing what the error you're actually getting is, it's gonna be real hard to diagnose this for you. I am immediately seeing that instead of using 'else if' you're using 'elsif' which is incorrect and is likely to cause a problem, though if that is the only problem that is caused I can't be sure.
i found in different posts online that in formula the else if is truncated in elsif, btw in the console there isn't any error, just a warning and a citation of the wrong formula.

edit: even with else if doesn't work. and this is the only error message i get " CUSTOM PARAM FORMULA ERROR"

ok additional error info :
YEP_EventTimerControl.js:387 SyntaxError: Unexpected token if
at Game_Actor.Game_BattlerBase.param (YEP_BaseParamControl.js:681)
at Game_Actor.Game_BattlerBase.param (YEP_StatAllocation.js:859)
at Game_Actor.get (rpg_objects.js:2133)
at Game_Actor.Game_BattlerBase.recoverAll (rpg_objects.js:2621)
at Game_Actor.Game_BattlerBase.recoverAll (YEP_BattleEngineCore.js:3569)
at Game_Actor.initEquips (YEP_EquipCore.js:408)
at Game_Actor.setup (rpg_objects.js:3443)
at Game_Actor.setup (YEP_BaseParamControl.js:1041)
at Game_Actor.setup (YEP_ClassChangeCore.js:586)
at Game_Actor.setup (YEP_X_Subclass.js:793)




EDIT:

I got this error with this formula: (user.actorId() === 1) ? v[41]+1:22

YEP_CoreEngine.js:1098 TypeError: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
at Bitmap.gradientFillRect (rpg_core.js:1289)
at Bitmap.gradientFillRect (YEP_CoreEngine.js:1014)
at Window_MenuStatus.Window_Base.drawGauge (YEP_CoreEngine.js:2418)
at Window_MenuStatus.Window_Base.drawGauge (YEP_SectionedGauges.js:170)
at Window_MenuStatus.Window_Base.drawActorHp (YEP_AbsorptionBarrier.js:1417)
at Window_MenuStatus.Window_Base.drawActorHp (YEP_SkillCore.js:1190)
at Window_MenuStatus.Window_Base.drawActorHp (YEP_X_SkillCostItems.js:903)
at Window_MenuStatus.Window_Base.drawActorHp (YEP_SectionedGauges.js:142)
at Window_MenuStatus.Window_Base.drawActorSimpleStatus (YEP_CoreEngine.js:2478)
at Window_MenuStatus.Window_Base.drawActorSimpleStatus (YEP_JobPoints.js:671)


i tried without variable and it works, so there's a problem with variables used inside this formula inside the yep plugin, if someone knows why just share, thanks

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/baseparamcontrol-by-yanfly-plugin.120968/