OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Yasirotta on 14 Jul 2008, 18:14:22
-
I can change probability of presence for units or objects, what is great for making "survivor" mission. However, is there chance to make probability of presence for weapons in ammo crates, or probability of presence for fuel in cars ?
Idea is, that in the map is locations, where could be found vechiles, weapons or equipment. However, would be great if i could make 2 diffrent rules.
Rule 1, Is there anything ? (Probability of presence)
Rule 2, If there is, how much there is ? (Weapons or ammo in box, fuel in car)
And rest, can i create ammo box, where is much weapons, but small change for each ?
In this way, you can find there something... or not. Even for me who is creating this map,
is something to put things tricky :)
EDIT: Also, if you can tell me how to always see health and fuel of vechiles in game when driver.
-
[code]For the first rule, can't you use the probability of presence built into the editor?
For the second rule, you could use this for the fuel:
Put this into the init of the vehicle:
[code][this] exec "fuelstart.sqs"and for the script
_vehicle = _this select 0
_amount = random 1
_vehicle setfuel _amount
exitUntested but should work.
For ammo boxes, the init:
[this] exec "ammostart.sqs"And the ammostart script
_crate = _this select 0
_number = random 1
clearweaponcargo _crate
clearmagazinecargo _crate
_crate addweaponcargo ["M16",5]
_crate addmagazinecargo ["M16",15]
?(_number > 0.2): _crate addweaponcargo ["M21",3]
?(_number > 0.2): _crate addmagazinecargo ["M21",12]
?(_number > 0.4): _crate addweaponcargo ["HK",3]
?(_number > 0.4): _crate addmagazinecargo ["HK",12]
............
// Add more weapons and magazine in the same way
exit
Again untested, but should work.
:)
Hope that helps, -=GC=-Fungus[/code][/code]