OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 22 Mar 2005, 18:44:11
-
Hi all,
Is there a way to make AI take more shots to kill? Say, if you shoot him in the chest, theres blood and everything, but he takes 5 or so more shots to kill?
I'm trying to do it to make key squad members stay alive longer. ;)
Thanks.
-
i've never tryed this but you could try something like
Loon setdamage 0
goto loop ~ 1
The syntax is no doubt wrong, but should give you a start. Hope that helps.
GI-YO
-
alternatively, use an event handler for the loons. slightly quicker. so for example,
this addeventhandler ["hit", _this setdamage 0]
in the init field should make the ai loon in question unkillable, although i seem to recall this being unhelpful when it came to explosions.
-
No good for what he said, that will make him totally unkillable (Almost). Luckally I was making the worlds most interesting mission (and still am) And it consisted of a boss that you had to kill, here is what you may want to try just put [unitname] exec "Nameofscript.sqs"
_unit = _this select 0
_reduction = 5
#loop
_dmg = getdammage _unit
@(getdammage _unit != _dmg)
_dmggvn = getdammage boss - _dmg
_dmgamount = (_dmggvn * (1 / 5))
_dmgfinal = _dmg + _dmgamount
_unit setdammage _dammagefinal
?(getdammage boss >= 0.8):_unit setdammage 1
goto"reset"
For more health change the reduction number, the higher the number the more health.
Currently he will take a fifth of defualt dammage so hes pretty tough.
Or, if you want a more basic script try this:
_unit = _this select 0
_lives = 5
#reset
_dmg = getdammage _unit
@(getdammage _unit != _dmg)
_unit setdammage 0
_lives = _lives - 1
?(_lives <= 0):hint"Hes outa Lives!";exit
goto"reset"This script he will have EXZACTLY five lives, so he will take 5 times as many hits.
-
Thanks for the replys ;)
I'll try those ideas, and post back if I have any problems ;D
-
If you wanted something to simulate a bullet proof vest, take a look at this topic (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=14454;start=0).
Although you may not survive even one hit if it is to your head, it does keep you alive long enough to try to get out of the line of fire, If you do not, then the next thing you know you are getting a bird's eye view of the battle. ;)
Wadmann
-
anyone knows if it is possible to asing a unit via init or sometihing else to "setdammage -1" or lesss? this maybe will help... but i dont thing it worsk... :p
please respond!!
thanks
-
You want something like this.
http://www.ofpec.com/editors/resource_view.php?id=239
-
Aha, thanks. I'll use that script ;)
@Flauta
Unforunatly, setdamage -1 doesn't work.
In fact, it has a very different outcome.
It makes the AI and player have really HD guns ;D
-
How about a damaged EH -
this addeventhandler ["dammaged", _this setdamage (getDammage _this * 0.5)]
This should (?) reduce any non-lethal damage to a character by 50%. It won't save him from a head shot but it should stop him being picked apart by multiple hits.
roni
-
Actually that could even reduce your dammage when you get hit. Because it will be reducing your ENTIRE dammage by half, not just the dammage given, there the unit will almost be invincable.