Home   Help Search Login Register  

Author Topic: ammo crates  (Read 537 times)

0 Members and 1 Guest are viewing this topic.

minimilo

  • Guest
ammo crates
« on: 19 Jul 2004, 20:49:13 »
i can take and give soldiers weapons by using a trigger and removeallweapons ect, but it dosent work for crates, and ive tride addweaponscargo, can some1 tell me what to do step by step, cheers :'(

DBR_ONIX

  • Guest
Re:ammo crates
« Reply #1 on: 19 Jul 2004, 21:22:23 »
Not sure exactly
But you use
this addweaponscargo ["M16",5]

That would add 5 m16s to the crate :)
- Ben

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:ammo crates
« Reply #2 on: 19 Jul 2004, 23:29:17 »
Only if the line was in the init field of the crate.  

If you put the name of the ammo crate instead of 'this' then you could use the instruction in a trigger.
« Last Edit: 19 Jul 2004, 23:29:40 by THobson »

SilentHunter_764

  • Guest
Re:ammo crates
« Reply #3 on: 20 Jul 2004, 08:12:33 »
more info plz?

i've been wondering how to get soliders to take weapons from a crate without me telling em to, but how do you make them do it without help?

plz help

also, how do you make a solider start with a certain weapon?

E.G. US solider with a M-21
silenthunter_764

j-man

  • Guest
Re:ammo crates
« Reply #4 on: 20 Jul 2004, 08:42:05 »
Quote
also, how do you make a solider start with a certain weapon?

put in the units init field:

this addmagazine "M21"; this addmagazine "M21"; this addmagazine "M21"; this addmagazine "M21"; this addmagazine "M21"; this addweapon "M21"

EDIT
Oh ya, check THobson's post below about removing the previous weapons/magazines.

Quote
i've been wondering how to get soliders to take weapons from a crate without me telling em to, but how do you make them do it without help?

through scripting:

Code: [Select]
soldier domove (getpos ammocrate)

#loop
~0.5
?(soldier distance ammocrate < 2) goto "takeammo"
goto "loop"

#takeammo
soldier action ["take weapon",ammocrate,0,0,ak47]
~0.1

soldier addmagazine "AK47"
soldier addmagazine "AK47"
soldier addmagazine "AK47"
soldier addmagazine "AK47"
soldier addmagazine "AK47"

exit

this will make the soldier (named "soldier") walk up to a crate (name "ammocrate") and take 5 AK47 magazines. All you need to do is find some way of checking if a unit is low on ammo and then executing the above script.
« Last Edit: 20 Jul 2004, 08:56:29 by j-man »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:ammo crates
« Reply #5 on: 20 Jul 2004, 08:48:23 »
No idea on the first.  Edit - ah see above, it was posted while I was writing.

On the second.  In the init field of the unit you need to remove the weapons/magazines he has by default.  See:
removeAllWeapons unit
unit removeMagazines weaponName
unit removeMagazine weaponName
unit removeWeapon weaponName

Then add weapons and magazines individually.  See:
unit addMagazine weaponName
unit addWeapon weaponName

Note each magazine needs its own instruction.  Take care not to give him more than he can carry of any given type, or to give him any invalid combinations.






« Last Edit: 20 Jul 2004, 09:04:43 by THobson »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:ammo crates
« Reply #6 on: 20 Jul 2004, 10:31:23 »
and make sure its magazines before weapons so it is auto loaded at the start...
Proud Member of the Volunteer Commando Battalion