ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Spotlights

From ModEnc
Revision as of 19:06, 26 July 2005 by DCoder (talk | contribs) (Some people just can't read INIs in plain text... >_>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Spotlights in TS

Note: This information applies only to Tiberian Sun.

Spotlights in TS. A great visual effect, and simple to edit too.

The spotlight controls available in the INIs are as follows:

SpotlightSpeed=.015
SpotlightMovementRadius=2000
SpotlightLocationRadius=1000
SpotlightAcceleration=.0025
SpotlightAngle=.5
SpotlightRadius= ? (undocumented tag)

Now, many modders get confused by all those radii, angles and stuff. Well, it's easy to comprehend, if you know what an ellipse is. Let me quote: "An ellipse is the locus of points the sum of whose distances from two fixed points, called foci, is a constant."
Confused yet? :) See image:

http://www.1728.com/ellipse.gif source

Now that we know what an ellipse is, let's see how that relates to spotlights and what the controls do.

If you place the spotlight tower in one focus, say f1, and rotate the axis so that axis AB matches the line connecting NE and SW corners of your screen, then the moving spotlight will draw a certain part of the ellipse on the ground.

SpotlightSpeed - obvious, speed of the spotlight. SpotlightMovementRadius - the distance f1O (marked c) (in leptons).

Assuming the light itself is at point A at this moment,

SpotlightLocationRadius - the distance f1A (in leptons).

SpotlightAcceleration - obvious, the (de-)acceleration of the light.

SpotlightAngle - the angle (in radians), which will be drawn before the light stops and draws the same angle in the reverse direction.

SpotlightRadius - not sure, but it appears to control the width of the falling light beam (the blob on the ground remains unchanged, the part between the tower and the ground appeatrs to widen/thinnen according to this, btu the effect is incomplete and yields nothing useful whatsoever.


The spotlight starts drawing from point B, and goes through C, A, D and back to B. Note, the spotlights which are preplaced on maps can be rotated to face another direction. Then the axis f1f2 will also rotate to be in the smae line with AB.

Common Questions

Q: How do I make the light rotate in a circle instead of an ellipse?

A: Since the ellipse irregularity increases along with f1f2, the way to make the light rotate in a perfect circle is... correct, moving the second focus, f2, into the same spot as f1, which means changing the SpotlightMovementRadius to zero.

Q: How do I make the light draw a full circle?

A: The full circle is 360°, or 2*pi (2*3.14 = 6.28) radians. The angle is controlled by SpotlightAngle. Since it asks for a value in radians, you should provide a number close to 6.3 .

Q: How do I make it sound an alarm when an enemy is spotted?

A: You can't make this flawlessly. You can attach a dummy weapon which has a Report=<warning alarm sound> attached, but then the tower will keep firing at the target and ignore other possible enemies around.