Home   Help Search Login Register  

Author Topic: script able to tell when the team is out of ammo  (Read 449 times)

0 Members and 1 Guest are viewing this topic.

BronzeEagle

  • Guest
script able to tell when the team is out of ammo
« on: 29 Dec 2004, 01:54:04 »
if one of ya'll made this i'd be in business, I'd have my squad automatically move to a designated waypoint where a chopper will pick them up.  

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:script able to tell when the team is out of ammo
« Reply #1 on: 29 Dec 2004, 04:39:47 »
Do you need to know if all units are out of ammo, or just a certain percentage?  For example, you may want them to resupply even if the group's total ammo supply is below 25%.  If you only want to have a check for totally out of ammo, then the script is only several lines long.  The key line of the script would be:

{! someAmmo vehicle _x)} forEach units group _mysquad

A script checking general ammo supply would be a bit more complex.  You would have to see what type of weapon(s) each squad member has and then check the number of shots that are available for each weapon.

Weapons _unit      tells what weapons a unit has
Ammo _weapon     tells how much ammo the unit has for that weapon.

I could do this script if you want.  I can do it this weekend.

BronzeEagle

  • Guest
Re:script able to tell when the team is out of ammo
« Reply #2 on: 29 Dec 2004, 07:45:46 »
no thanks.  

Offline Mud_Spike

  • Contributing Member
  • **
Re:script able to tell when the team is out of ammo
« Reply #3 on: 29 Dec 2004, 19:09:32 »
Code: [Select]
_has_ammo = { someAmmo _x } count units mygrp
player globalchat format ["%1 out of %2 has some ammo left, yep", _has_ammo, count units mygrp]
(SNG)