Greetings,
Planck, if you did that, the resistance would always fire at him, whether he had a weapon or not!
Milwot, you may want to try the canFire command in conjunction with setCaptive. I haven't actuaaly tried it myself, but in theory you could use it to check if your civilian is able to fire (i.e. has weapon and ammo), and then set setCaptive to false.Sorry, that's completely wrong. According to the COMREF, it only checks for damage, not ammo (and so should always return true for a living soldier).Instead, you could use the hasWeapon command to see if he has a specific weapon. Unfortunately, AFAIK, you cannot use the command to check if the unit has any weapon, just for a specific one. However, if there is only one weapon that the civilian can pick up, (say AK74), you could check for that weapon:
? civ1 hasWeapon "AK74": civ1 setCaptive false.
Here's the COMREF entry:
unit hasWeapon weaponName
Operand types:
unit: Object
weaponName: String
Type of returned value:
Boolean
Description:
Check if unit has given weapon.
Example:
player hasWeapon "M16"
-Supreme Commander PsyWarrior
-Psychic Productions Studios