Forged Alliance Forever Forged Alliance Forever Forums 2015-07-24T08:12:24+02:00 /feed.php?f=41&t=10393 2015-07-24T08:12:24+02:00 2015-07-24T08:12:24+02:00 /viewtopic.php?t=10393&p=105438#p105438 <![CDATA[Re: reduce HP method in Unit class?]]> Statistics: Posted by Lionhardt — 24 Jul 2015, 08:12


]]>
2015-07-24T03:37:52+02:00 2015-07-24T03:37:52+02:00 /viewtopic.php?t=10393&p=105427#p105427 <![CDATA[Re: reduce HP method in Unit class?]]>
Code:
unit:SetHealth(instigator, health)

Instigator is a reference to the entity that is making the health modification, can be the unit itself. Health is the value to set the health to.
A unit halving its own health then might be

Code:
local fraction = 0.5
unit:SetHealth(unit, unit:GetHealth() * fraction)

This is a good reference: http://supcom.wikia.com/wiki/LUADOC_1.5.3599

Statistics: Posted by Turkey — 24 Jul 2015, 03:37


]]>
2015-07-24T01:31:36+02:00 2015-07-24T01:31:36+02:00 /viewtopic.php?t=10393&p=105417#p105417 <![CDATA[reduce HP method in Unit class?]]>
Code:
unit:Destroy()
. Is there also a method to deal x amount of damage to a unit? x being ether a percentage or a absolute hp value. I guess there is not... but would be great. Because I'd like to modify that script for my own purposes.

Statistics: Posted by Lionhardt — 24 Jul 2015, 01:31


]]>