New to scripting so please go easy on me
I was able to use snYpir tougher units script by using the OFP mission editor, init line. Question, if I wan to apply this all units in the game, do I have to add [this,2] exec "toughunit.sqs" to the init box in the ofp mission editor for all units ? too time consuming and too much work. Is there a way to apply this script globally ? I would like to make infantry much toughter to simulate some effect of cover.
Thanks,
Lamerlot
This script allows you make units in the game harder to kill. This is done by reducing the damage taken by a unit during the game.
A call to this script would typically be made in the init field of a guy who you want to make tougher.
It is called as follows:
[name of object, damage factor] exec "toughunit.sqs"
the name of the object would be 'this' if u are using the call in an init field of an object.
the damage factor is the divisor for the damage taken. if this value is 2, for example, the dude will be twice as tough (damage will be halved). this allows you to have different levels of toughness for different soldiers if you want. Don't forget that this script will work for any object, not just soldiers.
so, a typical call to this script would be:
[this,2] exec "toughunit.sqs"
In the script file itself, if you look at the top of the file you can see a section with variables that you can change. These are described below.
_pause = 0.5
This sets the time interval between loops. Should be less than one.
_damageFactor = _this select 1
By default, the damage factor is set by the second parameter in the call to the script. If you wanted to make all units who run this script have the same damage factor you could change this value.
_noResurrection = false
If you change this line to true a unit will die as soon as it's damage is greater than one. So if a huge explosion instantly kills a unit, the damage will not be reduced and the unit will stay dead. If this value is false (default) the damage will be halved even if the unit is dead, effectively bringing the unit back to life.
NOTE
Although this script will make the player tougher if this is used, the player unit cannot be brought back to life. So if the player suffers heavy damage, the mission will end even though it will appear the player is alive.