Hi, I would like to make a trigger with which a rotating searchlight provides an arc of light revealing dark areas. The map is continually black masked, so that when the lamp rotates back, the previously lit area becomes dark again. I have made a trigger which provides an arc of light in the direction in which a unit is facing and a trigger which resumes darkness; these triggers are below.
flashlight trigger(to be lamp light arc)
black mask
Now, I would like to use the doodad for the rotating lamp and attach this light trigger to it and have the arc of light rotate with the lamp as it rotates. How do I do this? I would like to use the variation of the lamp which is rotating, would it be possible to attach this lamp model to a unit or structure, or could the trigger be attached to the doodad itself?
Thanks
flashlight trigger(to be lamp light arc)
Code:
flashlight 2
Events
Timer - Every 0.0125 seconds of Game Time
Local Variables
counter = 0.0 <Real>
flashlight holders = (Any units in (Playable map area) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) <Unit Group>
flashlight length = 9 <Integer>
flashlight initial size = 1.25 <Real>
flashlight expanding size = 0.25 <Real>
unit facing angle = 0.0 <Real>
unit position = No Point <Point>
Conditions
Actions
Unit Group - Pick each unit in flashlight holders and do (Actions)
Actions
Variable - Set unit position = ((Position of (Picked unit)) offset by (0.0, 0.0))
Variable - Set unit facing angle = (Facing of (Picked unit))
General - For each integer counter from 0 to flashlight length with increment 1, do (Actions)
Actions
Visibility - Reveal (Region((unit position offset by counter towards unit facing angle degrees), (flashlight initial size + (counter * flashlight expanding size)))) for player (Owner of (Picked unit)) for 0.0125 seconds and Do Not check cliff level
black mask
Trigger:
- black mask
- Events
- Timer - Every 0.01 seconds of Game Time
- Local Variables
- Conditions
- Actions
- Visibility - Enable Black Mask visibility
- Visibility - Enable Fog Of War visibility
- Visibility - Change visibility for player 1 to Unexplored within (Playable map area) and Do Not check cliff level
- Events
Now, I would like to use the doodad for the rotating lamp and attach this light trigger to it and have the arc of light rotate with the lamp as it rotates. How do I do this? I would like to use the variation of the lamp which is rotating, would it be possible to attach this lamp model to a unit or structure, or could the trigger be attached to the doodad itself?
Thanks