First the dummyweapon tag: When it is set the weapon goes through normal aiming and fire procedures but does not create a projectile when fired. It'd exist for scripts to take notice of and do whatever the scripter wants (e.g. spawn a bunch of explosions in the direction of the target). Obviously dummy weapons would still have values for lineofsight, ballistic or beamlaser so the script can get different aim values if you want a weapon that has to aim in front of the enemy or shoot in an arc.
Secondly, a get/set constant ENABLE_WEAPON: Just what the name suggests, a bitfield that determines what weapons are enabled. A disabled weapon is treated as nonexistent by the unit's AI, does not get a target, aim or fire. It could even be removed from the range value listed for the unit. The purpose is simply to allow scripts to notify the engine when a weapon isn't going to fire so Spring doesn't just think the weapon isn't done aiming yet. That way units with weapons that get disabled won't try to keep shooting them at anything. Concrete example: I've got infantry that can be switched between an assault rifle and an anti-air missile launcher. Obviously they can't shoot at planes with the rifle and can't shoot at infantry with the launcher. However they still think they can target those things since they don't know that the other weapon isn't just busy aiming. I'm also limiting ammo so I'd like a unit that's out of ammo to stop engaging enemies at all.
Dummyweapon tag and ENABLE_WEAPON get constant
Moderator: Moderators
Hrmm. I've built dummy weapons of several types and used them in NanoBlobs... you can have a weapon that does no damage, but still has to go through the rest of the motions. I'm not sure how this is differentiated from the NOWEAPON category, really.
As for ENABLE_WEAPON... I'd say +1. You can lock weapons out of their aiming states via their BOS, but that's always been a bit hackish. Better by far to just lock them out've the CAI and COB interpreter, period, and not have the unit perform any transforms.
As for ENABLE_WEAPON... I'd say +1. You can lock weapons out of their aiming states via their BOS, but that's always been a bit hackish. Better by far to just lock them out've the CAI and COB interpreter, period, and not have the unit perform any transforms.