RPG Maker Forums

I need to add some value to an atribute wich i created in Game_Actor when an actor does a simple attack in battle, i found where i need to edit but now i don't know how to get the actor ID wich is executing the action. Any help?



Code:
def item_apply(user, item)
    @result.clear
    @result.used = item_test(user, item)
    @result.missed = (@result.used && rand >= item_hit(user, item))
    @result.evaded = (!@result.missed && rand < item_eva(user, item))
    if @result.hit?
	  if user.actor?
	    if item.id == attack_skill_id # Normal attack
		  [b]$game_party.members[id].myvar += xx[/b] # How do i get the actor id doing this action?
	    else # Skills
	    end
	  end
	  unless item.damage.none?
	    @result.critical = (rand < item_cri(user, item))
	    make_damage_value(user, item)
	    execute_damage(user)
	  end
	  item.effects.each {|effect| item_effect_apply(user, item, effect) }
	  item_user_effect(user, item)
    end
  end
Thanks in advice!

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
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.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,587
Latest member
Usagiis
Top