hexef
(Novice) On forum: 05/12/2014
 Message edited by: hexef 12/21/2014 22:41:33
Messages: 26
|
The title of the thread was supposed to be "How to INCREASE the health of npcs",sorry for the typo
Anyway,I figured out how to make my friendly companions tougher,sort of.
Here is how I did it:in xr_motivator.script file,go to
function motivator_binder:hit_callback(obj, amount, local_direction, who, bone_index)
If you want your current companion to be tougher,like in my case,this is a good example on how to do it:
Inside this function,at the beginning of it,type the following code:
if is_companion(self.object:id() and amount < 0.3) then
self.object.health = 10
xr_sound.set_sound(self.object, nil)
stop_play_sound(self.object)
end
-- is_companion is the function to check whether the npc is my companion or not (that highly depends on the companion mod you are using,the function name could be something else) and amount means how much damage the npc must take(in percentage of his health) in order to be able to regenerate to full health in an instant.In our example,if the npc takes 30% damage from the last hit,then he will regenerate but if he takes more than 30% (amount>0.3) then he will not regenerate or maybe die .If you remove the amount part of the code,he will be invincible
I hope this information will help our fellow stalkers who suffered from their dead comrades.
Happy hunting with your buffed up squadmate ! Be careful though,The Zone doesn't like wanderers in groups,one wrong step and She will spill Her wrath on you |