OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Djoker on 14 Feb 2004, 11:44:13
-
hi,
i have this mission where 2 civilians ride a car with some weapons and ammo. i've ordered to get out somewhere. when they get out they have to take weapons and ammo from their car. this doesn't work
i've used this script:
_manone = _this select 0
_mantwo = _this select 1
_vehicle = _this select 2
_manone SetBehaviour "careless"
_mantwo SetBehaviour "careless"
_manone MoveInDriver _vehicle
_mantwo MoveInCargo _vehicle
_vehicle AddWeaponCargo ["ak47",2]
_vehicle AddMagazineCargo ["ak47",12]
_vehicle AddWeaponCargo ["kozlice",2]
_vehicle AddWeaponCargo ["kozliceball",12]
_vehicle AddWeaponCargo ["kozliceshell",6]
#check
? not(_manone in _vehicle): goto "getammo"
? not(_mantwo in _vehicle): goto "getammo"
;this is the part i'm stuck.
#getammo
_manone action ["take weapon",_vehicle,"ak47",1]
_manone action ["take magazine",_vehicle,"ak47",6]
_manone action ["reload","ak47"]
_mantwo action ["take weapon",_vehicle,"ak47",1]
_mantwo action ["take magazine",_vehicle,"ak47",6]
_mantwo action ["reload","ak47"]
help would do me good :P
-
Hi,
Wouldnt it be easier for you to add teh weapons and magaznes to the civies instead of using :-
_manone action ["take weapon",_vehicle,"ak47",1]
but instead use
[i]nameofcivie[/i] addweapon "ak47" and then add the mags?
Rhys
-
but i find it cooler if they take the weapons and ammo from the car.
like they have weapons and ammo in their trunk.
-
What do you mean, "it doesn't work?" How do you know? What happens?
-
There you go:
_manone = _this select 0
_mantwo = _this select 1
_vehicle = _this select 2
_manone SetBehaviour "careless"
_mantwo SetBehaviour "careless"
_manone MoveInDriver _vehicle
_mantwo MoveInCargo _vehicle
_vehicle AddWeaponCargo ["ak47",2]
_vehicle AddMagazineCargo ["ak47",20]
_vehicle AddWeaponCargo ["kozlice",2]
_vehicle AddMagazineCargo ["kozliceball",12]
_vehicle AddMagazineCargo ["kozliceshell",6]
#check
@ not (_manone in _vehicle) and not (_mantwo in _vehicle)
#getammo
_manone action ["take weapon",_vehicle,0,0,"ak47"]
_manone playmove "CombatReloadMagazine"
_mantwo action ["take weapon",_vehicle,0,0,"ak47"]
_mantwo playmove "CombatReloadMagazine"
When they take the weapon, they'll automatically take as much ammo as they can, so you either let them take 10 mags each or don't add any ammo to the car and add the mags manually, like so:
_manone = _this select 0
_mantwo = _this select 1
_vehicle = _this select 2
_manone SetBehaviour "careless"
_mantwo SetBehaviour "careless"
_manone MoveInDriver _vehicle
_mantwo MoveInCargo _vehicle
_vehicle AddWeaponCargo ["ak47",2]
_vehicle AddWeaponCargo ["kozlice",2]
_vehicle AddMagazineCargo ["kozliceball",12]
_vehicle AddMagazineCargo ["kozliceshell",6]
#check
@ not (_manone in _vehicle) and not (_mantwo in _vehicle)
#getammo
_manone addmagazine "ak47"
_manone addmagazine "ak47"
_manone addmagazine "ak47"
_manone addmagazine "ak47"
_manone addmagazine "ak47"
_manone addmagazine "ak47"
_manone action ["take weapon",_vehicle,0,0,"ak47"]
_manone playmove "CombatReloadMagazine"
_mantwo addmagazine "ak47"
_mantwo addmagazine "ak47"
_mantwo addmagazine "ak47"
_mantwo addmagazine "ak47"
_mantwo addmagazine "ak47"
_mantwo addmagazine "ak47"
_mantwo action ["take weapon",_vehicle,0,0,"ak47"]
_mantwo playmove "CombatReloadMagazine"
Btw, the reload action doesn't work.
-
maybe you could have the guys "take" the weapons by doing the ~unit addweapon "weapon"~ in conjunction with a switch move......you could make a small and simple script for it. If you add pick up and relaoding animations, it could look as good as you want.......