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

Spotlights: Difference between revisions

From ModEnc
Jump to navigation Jump to search
Some people just can't read INIs in plain text... >_>
 
Blade (talk | contribs)
m added latest YR exe patch and more ways to make light spin in a full circle
Line 1: Line 1:
== Spotlights in TS ==
== Spotlights in TS ==
'' '''Note:''' This information applies only to Tiberian Sun.''
'' '''Note:''' This information applies only to Tiberian Sun or Yuri's Revenge when patched by the [[YR_1.001pd_Status|Rock Patch v1.06]] or higher''


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


The spotlight controls available in the INIs are as follows:
The spotlight controls available in the INIs are as follows:
Line 43: Line 43:


=== Q: How do I make the light draw a full circle? ===
=== 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 <tt>SpotlightAngle</tt>. Since it asks for a value in radians, you should provide a number close to 6.3 .
A: The full circle is 360°, or 2*pi (2*3.14 = 6.28) radians. The angle is controlled by <tt>SpotlightAngle</tt>. Since it asks for a value in radians, you should provide a number close to 6.3 . However you can also use controls on pre-placed spotlight tower buildings to set the type of movement (that used by the rules.ini controls or a constant circle) or create triggers that change the type of movement.


=== Q: How do I make it sound an alarm when an enemy is spotted? ===
=== 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.
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.

Revision as of 23:01, 30 July 2005

Spotlights in TS

Note: This information applies only to Tiberian Sun or Yuri's Revenge when patched by the Rock Patch v1.06 or higher

Spotlights, 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 . However you can also use controls on pre-placed spotlight tower buildings to set the type of movement (that used by the rules.ini controls or a constant circle) or create triggers that change the type of movement.

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.