OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: StonedSoldier on 23 Jan 2004, 14:55:54

Title: Unit Take Weapon
Post by: StonedSoldier on 23 Jan 2004, 14:55:54
in the mission there are two soldiers called m60gunner and man

when m60gunner is dead is it possible for man to run to him and take his M60.
Title: Re:Unit Take Weapon
Post by: headshot_snipe on 23 Jan 2004, 15:07:24
look in the command ref

http://www.ofpec.com/editors/comref.php

there should be a command called resupply, or you can use the action command to pick a weapon, because i think, not sure though, that when a unit is dead then the AI has the action in the action tab... you might wanna create a script with like, if unit is 50 meters away then go and pick up the m60 or whateva you want.
Title: Re:Unit Take Weapon
Post by: StonedSoldier on 23 Jan 2004, 15:27:03
i was wondering if theres a way for a unit to detect the nearest weapon and take it,

if it helps im making a P.O.W mission and when the fighting starts im wanting a couple of P.O.Ws to run to the nearest corpse and take its main weapon.
Title: Re:Unit Take Weapon
Post by: Unnamed on 23 Jan 2004, 17:05:39
LCD Posted this in the "Time for action" thread:

Quote
name : take weapon
Description : makes unit take weapon from dead body
Syntax : object action ["take weapon",Body,0,0,weapon]
Example : LCD action ["take weapon",toadlife,0,0,primaryweapon toadlife]
Example : LCD action  ["take weapon",deadman,0,0,"m16"]
Notes: 1) u need 2 make da unit get close 2 da body, or it wil take da weapon from very far distance
2) as much as i know changing da nums in da syntax dont change nythin
Title: Re:Unit Take Weapon
Post by: LCD on 24 Jan 2004, 00:40:43
yar

som1 qouted me ;)

yar yar yar

 ;D (shamless spam ::))

LCD OUT