-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Currently missiles shot by guards are the least subclassed type of CAbstractMissile
, in fact, they use that constructor directly to fire.
What this means is that their range defaults to the hardcoded #define STANDARDMISSILERANGE FIX(100)
found in AvaraDefines.h
.
While other parameters of guards are configurable, like activation by message and range and team variables, the range variable specifically stops being useful after 100 meters. The guard will track and not shoot, because the ray test it uses to decide to fire uses the #define
above and will not hit something outside of that range.
Guards are useful in complex level scripting, as they can be used to glow objects at a frequency, remove scouts from play, or instantly kill a team or player for violating a game rule.
We would like to open up the range of the Guard (and UFO, and Pill, so all RealShooters
) so that they can be used at distance. This will mean adding a new variable shootRange
to the shooter object class, and using that value as the ray test distance instead of 100.
Marked as a good first issue, while messing with level set variables is sort of a pain, there are several example PRs to look at where we have done this previously (TODO look one up and link it here 😅 ) I forgot that @tra added string lookup for variables a long time ago. So really this is as easy as adding a new attribute to CGuardActor and calling this function in Parser
to read shootRange
and populate said attribute.