How to make Buff Duration depend on stats?

SANTERSAKH

Villager
Member
Joined
Mar 21, 2019
Messages
17
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
Hello everyone, i need a tip.

As default, by skills we can add a buff or debuff with X turns duration. I wanted to set this X dependable on caster's stat (MAT for example). Noticed i can do this via YEP_BuffsStatesCore. There what typed in notes:

<Custom Def Buff Turn>
turn = 1;
turn += user.mat / 25;
</Custom Def Buff Turn>

But in fact, skill adds nothing. What to do? Thanks for advance!
 

JamesRyan

Game Designer
Veteran
Joined
Sep 13, 2014
Messages
696
Reaction score
215
First Language
Vietnamese
Primarily Uses
RMMV
You should not use CAPITAL LETTERS for "stat". And better keep its turn as an integer by using Math.floor or Math.round or Math.ceil (I prefer round).
Code:
<Custom def Buff Turn>
turn = 1 + Math.round(user.mat / 25);
</Custom def Buff Turn>
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[move]JavaScript/Plugin Support[/move]
 

SANTERSAKH

Villager
Member
Joined
Mar 21, 2019
Messages
17
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
You should not use CAPITAL LETTERS for "stat". And better keep its turn as an integer by using Math.floor or Math.round or Math.ceil (I prefer round).
Code:
<Custom def Buff Turn>
turn = 1 + Math.round(user.mat / 25);
</Custom def Buff Turn>
Doesn't work either
 

CaRa_CrAzY

Undefined Custom Title
Veteran
Joined
Jan 19, 2019
Messages
65
Reaction score
27
First Language
Portuguese
Primarily Uses
Other
Any number below 25 will result in zero, thus it will add nothing.

Are you sure you are testing this with an Actor that has mat higher than 25?
 

SANTERSAKH

Villager
Member
Joined
Mar 21, 2019
Messages
17
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
Any number below 25 will result in zero, thus it will add nothing.

Are you sure you are testing this with an Actor that has mat higher than 25?
Sure. I was testing with high leveled actor with above than 100 mat. Even reduced division by 5, but still got nothing.

Maybe a problem lies deeper.
 

SANTERSAKH

Villager
Member
Joined
Mar 21, 2019
Messages
17
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
Consider this as bump, but I want to figure it out.
What exactly I need (plugins, codes) to make it?
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Why not start this over.

But in fact, skill adds nothing. What to do? Thanks for advance!
What exactly did you mean by this?
That the buff stayed at the preset number of turns or that it was never added at all?

If the turns didn't change, consider changimg your formula for testing purposes.

<Custom Def Buff Turn>
turn = 1;
turn += 99
</Custom Def Buff Turn>

And see if that gives 100 turns to the buff.
If it doesnt add the buff at all, there is probably a syntax error somewhere in the formula.
A link to the plugin would help me verify this.
 

SANTERSAKH

Villager
Member
Joined
Mar 21, 2019
Messages
17
Reaction score
1
First Language
Russian
Primarily Uses
RMMV

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Ok. I'll have to look in more detail once I can get to my comp but for now the syntax seem ok. Next test then is to simply give the buff a number and see if it works.
Try:

<Custom Def Buff Turn>
turn = 100;
</Custom Def Buff Turn>

And see if you do indeed get a def buff of 100 turns.
 

SANTERSAKH

Villager
Member
Joined
Mar 21, 2019
Messages
17
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
Ok. I'll have to look in more detail once I can get to my comp but for now the syntax seem ok. Next test then is to simply give the buff a number and see if it works.
Try:

<Custom Def Buff Turn>
turn = 100;
</Custom Def Buff Turn>

And see if you do indeed get a def buff of 100 turns.
Does't work...
Tested even in an empty new project, with BattleEngineCore and BuffsStatesCore
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Did you copy/paste what I suggested?
It looks like the stat has to be lower case to work.

So try it again with this one:

<Custom def Buff Turn>
turn = 100;
</Custom def Buff Turn>

and see.
And remember also that this one is for a defence buff so alter your skill to give that buff.
 

SANTERSAKH

Villager
Member
Joined
Mar 21, 2019
Messages
17
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
Did you copy/paste what I suggested?
It looks like the stat has to be lower case to work.

So try it again with this one:

<Custom def Buff Turn>
turn = 100;
</Custom def Buff Turn>

and see.
And remember also that this one is for a defence buff so alter your skill to give that buff.
Yes I did. Several times
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
797
Reaction score
350
First Language
English
Primarily Uses
N/A
Ok. I'll play around with it when I get time.

EDIT: And by the way, I'm not sure, but I think you need to have the skill actually add the buff via traits before the plugin can change the turns.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top