Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Luck Stat, dafuk?
userjosh704
post Oct 15 2012, 08:48 AM
Post #1


I win.
Group Icon

Group: Revolutionary
Posts: 119
Type: Writer
RM Skill: Masterful




I was hoping for some new stats in the next RPGmakers - M.Def and Luck specifically. THIS luck stat is useless. I was hoping for a miscellaneous stat which I could use to influence different things like critical hit rate/evasion/second wind/counterattack rate/monster item drop rate/etc. Can someone give me some ideas and tips for this stat?

Also, what's the deal with the counterattack ability? How come it's actually phys.evade and counterattack simultaneously?


edit: in the scripting section Game_Battler, line 486-490 it says
QUOTE
#--------------------------------------------------------------------------
# * Calculate Critical Rate of Skill/Item
#--------------------------------------------------------------------------
def item_cri(user, item)
item.damage.critical ? user.cri * (1 - cev) : 0


can I edit this to
item.damage.critical ? user.luk * (1 - luk) : to make critical hits influenced by luck?

This post has been edited by userjosh704: Oct 15 2012, 08:55 AM


__________________________


Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Night_Runner
post Oct 15 2012, 11:27 PM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,520
Type: Scripter
RM Skill: Undisclosed




CODE
  #--------------------------------------------------------------------------
  # * Calculate Critical Rate of Skill/Item
  #--------------------------------------------------------------------------
  def item_cri(user, item)
    item.damage.critical ? user.luk.to_f / (self.luk+ user.luk).to_f : 0
  end


The code will generate a random number between 0 - 1, and if the number returned by item_cri is greater than that random number, then the item will be a critical.
What I've done is taken the percentage of the item user's luck compared to the defender's luck.
So if the user's luck is double the defender's luck, you have double the chance of getting a critical (compared to the chance of not getting a critical)

Keep in mind the item has to be able to do critical damage, otherwise it's kinda pointless...

Technically you're supposed to use the luk_effect_rate function when using the luck variable, but it didn't seem appropriate for this... I'll let you play around with it happy.gif


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 07:23 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker