• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Lightning and more lightning!

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2012
Messages
159
Lightning and more lightning! - SOLVED!

SOLVED

Hello guys!

I'm experimenting a bit with lightning. And I can't make this trigger working.

In my map a pillar is holding on to 4 fleeing captives, with a lightning beam for each unit, while they try to flee. The triggers aren't showing any error messages but I can't see the lightnings.
I think I have missed something?

  • Panicked Captives Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PCUnit[1] = Panicked Captive 0047 <gen>
      • Set PCUnit[2] = Panicked Captive 0046 <gen>
      • Set PCUnit[3] = Panicked Captive 0049 <gen>
      • Set PCUnit[4] = Panicked Captive 0048 <gen>
      • Set PCRegion[1] = PanickedCaptive1 <gen>
      • Set PCRegion[2] = PanickedCaptive2 <gen>
      • Set PCRegion[3] = PanickedCaptive3 <gen>
      • Set PCRegion[4] = PanickedCaptive4 <gen>
      • For each (Integer PCI) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit Group - Add PCUnit[PCI] to PC_UG
          • Set PCPP[PCI] = (Center of PCRegion[PCI])
          • Set PCP[PCI] = (Position of PCUnit[PCI])
          • Custom script: set udg_PCL[udg_PCI] = AddLightningEx("DRAM", true, GetLocationX(udg_PCPP[udg_PCI]), GetLocationY(udg_PCPP[udg_PCI]), GetLocationZ(udg_PCPP[udg_PCI]) + 100, GetLocationX(udg_PCP[udg_PCI]), GetLocationY(udg_PCP[udg_PCI]), GetLocationZ(udg_PCP[udg_PCI]) + 70)
          • Set PCRunPoint[PCI] = (PCP[PCI] offset by 500.00 towards (Facing of PCUnit[PCI]) degrees)
          • Unit - Order PCUnit[PCI] to Move To PCRunPoint[PCI]
          • Custom script: call RemoveLocation(udg_PCP[udg_PCI])
          • Custom script: call RemoveLocation(udg_PCRunPoint[udg_PCI])
      • Trigger - Turn on Panicked Captives Loop <gen>
and

  • Panicked Captives Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (All units of PC_UG are dead) Equal to False
        • Then - Actions
          • For each (Integer PCI) from 1 to 4, do (Actions)
            • Loop - Actions
              • Set PCP[PCI] = (Position of PCUnit[PCI])
              • Set PCMP[PCI] = (PCP[PCI] offset by 11.00 towards (Angle from PCP[PCI] to PCPP[PCI]) degrees)
              • Custom script: call SetUnitX(udg_PCUnit[udg_PCI],GetLocationX(udg_PCMP[udg_PCI]))
              • Custom script: call SetUnitY(udg_PCUnit[udg_PCI],GetLocationY(udg_PCMP[udg_PCI]))
              • Custom script: call MoveLightningEx(udg_PCL[udg_PCI], true , GetLocationX(udg_PCPP[udg_PCI]), GetLocationY(udg_PCPP[udg_PCI]), GetLocationZ(udg_PCPP[udg_PCI]) + 100, GetLocationX(udg_PCMP[udg_PCI]), GetLocationY(udg_PCMP[udg_PCI]), GetLocationZ(udg_PCMP[udg_PCI]) + 70)
              • Custom script: call RemoveLocation(udg_PCP[udg_PCI])
              • Custom script: call RemoveLocation(udg_PCMP[udg_PCI])
        • Else - Actions
          • Trigger - Turn off (This trigger)
          • Custom script: call DestroyGroup(udg_PC_UG)
          • Lightning - Destroy PCL[PCI]
          • For each (Integer PCI) from 1 to 4, do (Actions)
            • Loop - Actions
              • Custom script: call RemoveLocation(udg_PCPP[udg_PCI])


Thank you! :)
 
Last edited:
Level 7
Joined
Jul 9, 2012
Messages
159
Does it have to be MUI? :) I'm only using the trigger once as an event.
I can tell that the locations of the points are correct because the units are finely dragged towards the pillars by:
  • Custom script: call SetUnitX(udg_PCUnit[udg_PCI],GetLocationX(udg_PCMP[udg_PCI]))
  • Custom script: call SetUnitY(udg_PCUnit[udg_PCI],GetLocationY(udg_PCMP[udg_PCI]))
 
Status
Not open for further replies.
Top