Rotating Searchlight

scubazoo

Member
Reaction score
1
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)
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



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
 

scubazoo

Member
Reaction score
1
Would it work if I set the unit position to the position of an actor instead, and then rotate the actor? I have not the slightest idea how to do this though, I just saw that setting the variable as an actor instead as an option, and then I think it is possible to rotate the actor. Or, would it work to set the unit position to a point in front of the unit, and then make the point to look at certain angles, and define these angles as an array, while making the point hesitate, or wait, say 2 game seconds, before continuing the rotation in the next angle? Not sure how to trigger this either. Or, could the position the light is facing be instead attached to a dummy unit which rotates? Any help appreciated.
 

scubazoo

Member
Reaction score
1
I have been trying random things. Actually, I have a new trigger, which does what i want it to to a degree; the unit(lamp rotates, and reveals an area, however, the area it reveals is much smaller than the area intended. I am not sure how to have a constant amount of area revealed. Unlike the flashlight trigger, which grows to its complete area and remains constant, the trigger for the lamp never reaches the length or width of the same amount of area and instead only reveals a small portion.

Heres the rotating lamp trigger:
Trigger:
  • flashlight rotating
    • Events
      • Game - Map initialization
    • Local Variables
      • counter 2 = 0.0 &lt;Real&gt;
      • flashlight length 2 = 10 &lt;Integer&gt;
      • flashlight initial size 2 = 1.25 &lt;Real&gt;
      • flashlight expanding size 2 = 0.25 &lt;Real&gt;
      • unit facing angle 2 = 0.0 &lt;Real&gt;
      • unit position 2 = No Point &lt;Point&gt;
    • Conditions
    • Actions
      • Unit - Create 1 dummy for player 1 at Point 001 facing 360.0 degrees (No Options)
      • Variable - Set unit position 2 = ((Position of (Last created unit)) offset by (0.0, 0.0))
      • Variable - Set unit facing angle 2 = (Facing of (Last created unit))
      • Visibility - Reveal (Region((unit position 2 offset by counter 2 towards unit facing angle 2 degrees), (flashlight initial size 2 + (counter 2 * flashlight expanding size 2)))) for player 1 for 0.0125 seconds and Do Not check cliff level
      • Unit - Make (Last created unit) face 270.0 over 3.0 seconds
      • General - Wait 1.0 Game Time seconds
      • Unit - Make (Last created unit) face 360.0 over 3.0 seconds
      • General - Wait 1.0 Game Time seconds
      • Unit - Make (Last created unit) face 270.0 over 3.0 seconds


So this creates an invisible unit which rotates and projects light in the direction it faces, dispelling the darkness, which refills newly unlit areas as the unit continues to rotate. However, it doesn't reveal the proper area as I have stated above. Furthermore, because this unit is placed at a point near the lamp doodad, and is not the lamp itself, their movements are not synchronized. Is there a way to make a unit, with the model art of the rotating doodad? I would like to use variation 2 of the floodlight doodad, which is a prop. And then, once I have this unit, would it be possible to establish a direction for the direction in which the lamp light is facing? This seems difficult because I do not know if there is a way to attach an actor(not really sure what to attach though either way) to the direction in which the lamp light faces. Thanks for looking.

EDIT: Actually, it isn't rotating, it shines light once, and then stops. I have also tried adding more instances of the visibility reveal region action, such as after the make unit face angle action, and wait action but to no avail.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top