Home   Help Search Login Register  

Author Topic: Probability of presence  (Read 952 times)

0 Members and 1 Guest are viewing this topic.

Offline Yasirotta

  • Members
  • *
Probability of presence
« 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.
« Last Edit: 14 Jul 2008, 18:36:51 by Yasirotta »

Offline Gcfungus

  • Members
  • *
Re: Probability of presence
« Reply #1 on: 14 Jul 2008, 20:39:44 »
Code: [Select]
[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
Code: (fuelstart.sqs) [Select]
_vehicle = _this select 0
_amount = random 1
_vehicle setfuel _amount
exit
Untested but should work.

For ammo boxes, the init:
Code: [Select]
[this] exec "ammostart.sqs"And the ammostart script
Code: (ammostart.sqs) [Select]
_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]
The object of war is not to die for your country, but to make the other bastard die for his.
~George Patton