[VX Ace] Changing luk_effect_rate(user)

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hello, I have a question, I'd like to change the luk_effect_rate(user) formula in Game_BattlerBase


The idea is making each 2 points of target's luck decrease in 1% the chance of having the state applied. user's luck won't have any effect


Talking with Saathan I THINK I arrived to the conclusion this formula is the correct one, but I really can't stay for sure


def luk_effect_rate(user)
(1.0 - (target.luk/2 * 0.01), 0.0).max
end
end




Is that the proper syntax to make what I want to do? Thank you :)
 
Last edited by a moderator:

Silverskin

Villager
Member
Joined
Jun 21, 2016
Messages
27
Reaction score
11
First Language
English
Primarily Uses
Hey, 


I am learning js myself atm, but I would approach this as follows:


So the original luk effect rate of the user is:

Game_Action.prototype.lukEffectRate = function(target) {
    return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};
You will need 2 cases, one for the probability on actors and one on enemies.


I should think that you can insert an if clause, checking whether the state should be applied to an actor or an enemy

if (this.subject().isActor(){


return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0); //the standard luk effect rate for states on users as you didnt wish anything particular


}


else{


return Math.max(1.0 - (target.luk/2 * 0.01), 0.0); //no idea what this 0.0 at the end means and if you have to delete it, but target.luk/2 means every 2 points = 1, * 0.01 = 1%


}
Hope I could help you and write back if something went wrong with this code!
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hey, 


I am learning js myself atm, but I would approach this as follows:


So the original luk effect rate of the user is:


You will need 2 cases, one for the probability on actors and one on enemies.


I should think that you can insert an if clause, checking whether the state should be applied to an actor or an enemy


Hope I could help you and write back if something went wrong with this code!


I'm not sure but is that JavaScript? Like, for MV? Because I put it was for VX Ace, but I might am reading it wrong and indeed it's for VX ace


In any case, I just want to replace the actual formula with the one I suggested, I won't need to differentiate if is the actor of the enemy who use it because all will be affected with the new formula


But I think I'm getting the idea, it'd be something like this:


def luk_effect_rate(user)
(1.0 - (target.luk/2 * 0.001), 0.0).max #I put the 0.001 because that's how appears in VX Ace original scripting, but I'm not sure if it works like that, it might be 0.01
end
end




Right?
 

Silverskin

Villager
Member
Joined
Jun 21, 2016
Messages
27
Reaction score
11
First Language
English
Primarily Uses
oh, didn't see it was for ace. 


Well, it seems that it was only the math thing to get to your formula. I think, you should cut out the 0 however, because that's how much


the effect rate weigths. *1 => 100% decrease per luk point; *0.1 => 10%; *0.01 => 1% (what you wanted), and *0.001 would be 0.1% (1% per 10 Luk points)


For the rest of it, I think your luk effect rate will work perfectly!
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
oh, didn't see it was for ace. 


Well, it seems that it was only the math thing to get to your formula. I think, you should cut out the 0 however, because that's how much


the effect rate weigths. *1 => 100% decrease per luk point; *0.1 => 10%; *0.01 => 1% (what you wanted), and *0.001 would be 0.1% (1% per 10 Luk points)


For the rest of it, I think your luk effect rate will work perfectly!


I think I'll wait for someone to rectify this, but I think this one is the correct one, thanks by the help

Code:
def luk_effect_rate(user)
    (1.0 - (target.luk/2 * 0.01), 0.0).max
  end
end
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
The syntax looks good. Test it out, and if a luck of 50 makes all 100% status aliments miss, then you did it.


Though, keep in mind this will apply to *anything* that adds a state, whether that state is positive or negative.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
The syntax looks good. Test it out, and if a luck of 50 makes all 100% status aliments miss, then you did it.


Though, keep in mind this will apply to *anything* that adds a state, whether that state is positive or negative.


Actually it should be 200 of luck to have a total states evasion

Mmm interesting, can I make a state evade the luck check? some of them are buffs and you don't want to miss buffs
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Right, 200. And maybe on that note I should get some sleep soon.


As for the other part, not sure. I thought I heard that certain hit skills avoid the luck check, but not sure. Otherwise you may need to edit the code to be able to flag some skills as don't apply the luck check here. Or, just do 999% chance to apply the state (though with 200 luck, and your formula, since the luck modifier is multiplied, and anything times 0 is 0, it will still miss).
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,845
Messages
1,016,961
Members
137,561
Latest member
JaCrispy85
Top