Jump to content

Recommended Posts

LIsten for the event "onattackother".

 

inst:ListenForEvent("onattackother",function(inst,data)

    print(data.target) --puts prefab name to log.txt

end)

 

Note that this happens before the damage is calculated, so you can simply adjust the damage value in the function.

LIsten for the event "onattackother".

 

inst:ListenForEvent("onattackother",function(inst,data)

    print(data.target) --puts prefab name to log.txt

end)

 

Note that this happens before the damage is calculated, so you can simply adjust the damage value in the function.

It is but, as does the definition of damage within the "inst: ListenForEvent (" onattackother "function (inst, date)"?

It is but, as does the definition of damage within the "inst: ListenForEvent (" onattackother "function (inst, date)"?

 

I beg your pardon? I assume you ask for this:

 

local damage_mult = 1

 

if data.target:HasTag("monster") or data.target.prefab == "pigman" then

  damage_mult = 1.5

end

inst.components.combat.damagemultiplier = damage_mult

I beg your pardon? I assume you ask for this:

 

local damage_mult = 1

 

if data.target:HasTag("monster") or data.target.prefab == "pigman" then

  damage_mult = 1.5

end

inst.components.combat.damagemultiplier = damage_mult

Thank you so much. It worked perfectly.

 

Do you happen to have a site to recommend where I can see the functions already implemented like the one you helped me?

Thank you so much. It worked perfectly.

 

Do you happen to have a site to recommend where I can see the functions already implemented like the one you helped me?

 

The link to the AP Idocs in his signature is a pretty useful site.

 

http://dontstarveapi.marcosaviles.com/

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...