• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Lightning effect not appearing, but you can hear the sound [REFORGED]

Status
Not open for further replies.
Level 12
Joined
Feb 5, 2018
Messages
521
  • Rhazok Abyss Bringer
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rhazok, Abyss Bringer
    • Actions
      • Set VariableSet TempDamage = 350.00
      • Set VariableSet TempAoe = 225.00
      • -------- --------
      • Set VariableSet TempCaster = (Triggering unit)
      • Set VariableSet Temp_Loc = (Target point of ability being cast)
      • -------- --------
      • Special Effect - Create a special effect at Temp_Loc using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Set VariableSet Temp_SFX = (Last created special effect)
      • Special Effect - Set Color of Temp_SFX to r: 155, g: 255, b: 155
      • Special Effect - Set Scale of Temp_SFX to 2.50
      • Special Effect - Destroy Temp_SFX
      • -------- --------
      • Set VariableSet Temp_Group = (Units within TempAoe of Temp_Loc.)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of TempCaster).) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
            • Then - Actions
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Temp_Group.
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TempTarget = (Picked unit)
          • Set VariableSet Temp_Loc2 = (Position of TempTarget)
          • Unit - Cause TempCaster to damage TempTarget, dealing TempDamage damage of attack type Spells and damage type Magic
          • -------- --------
          • Trigger - Run Rhazok Lightning <gen> (ignoring conditions)
      • -------- --------
      • Custom script: call RemoveLocation (udg_Temp_Loc)
      • Custom script: call RemoveLocation (udg_Temp_Loc2)
      • Custom script: call DestroyGroup (udg_Temp_Group)

  • Rhazok Lightning
    • Events
    • Conditions
    • Actions
      • Custom script: local lightning udg_Temp_Lightning
      • Custom script: set udg_Temp_Lightning = AddLightningEx("CLBP", true , GetLocationX(udg_Temp_Loc), GetLocationY(udg_Temp_Loc), GetLocationZ(udg_Temp_Loc) + 70, GetLocationX(udg_Temp_Loc2), GetLocationY(udg_Temp_Loc2), GetLocationZ(udg_Temp_Loc2) + 70)
      • Wait 0.25 seconds
      • Lightning - Destroy Temp_Lightning
      • Custom script: set udg_Temp_Lightning = null

I tried to debug this for some time now == I removed the location clean ups, to see if the lightning ran too slow to actually create the effect before the locations are removed.

Originially the lightning triggers were on the initial trigger, but it didn't work either.

Funny that I have spell that I got help from here, with the exact same lightning trigger (different variables) that works. :D
 
Level 24
Joined
Jun 26, 2020
Messages
1,850
1) In no one of that triggers is an action to create a lightning.
2) The part of
  • Custom script: local lightning udg_Temp_Lightning
I don't know nearly nothing about JASS but I have understood udg indicates a global variable and you are assinging to a local variable and local variable and global variable are diferent things.
 
Level 12
Joined
Feb 5, 2018
Messages
521
It's called shadowing a global. It turns the global into local.

And there is action to create ligthning.

As stated above, I have another spell that uses a similiar system.

I was testing this further and it has something to do with locations. It does not always get the position of all units and sometimes only one.
 
Level 12
Joined
Feb 5, 2018
Messages
521
Have you tried this in classic mode?

No, not yet.

But I have working spell with the same method, i'll post it here.

The whole map is created on reforged.

This is made by @Uncle

  • Lightning Link
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Link (Text not done)
    • Actions
      • -------- Index --------
      • Set VariableSet LL_Index = (LL_Index + 1)
      • Set VariableSet LL_Loop = (LL_Loop + 1)
      • -------- - --------
      • -------- Caster --------
      • Set VariableSet LL_Caster[LL_Index] = (Triggering unit)
      • Set VariableSet LL_Loc1 = (Position of LL_Caster[LL_Index])
      • -------- - --------
      • -------- Time --------
      • Set VariableSet LL_Time[LL_Index] = 100.00
      • -------- - --------
      • -------- Damage --------
      • Set VariableSet LL_Damage[LL_Index] = (Real((Level of Lightning Link (Text not done) for LL_Caster[LL_Index])))
      • -------- - --------
      • -------- Unit Group --------
      • Set VariableSet LL_UG[LL_Index] = (Units within 625.00 of LL_Loc1.)
      • Unit Group - Pick every unit in LL_UG[LL_Index] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of LL_Caster[LL_Index]).) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
              • ((Picked unit) is Magic Immune) Equal to False
            • Then - Actions
              • -------- We don't need to do anything here --------
            • Else - Actions
              • -------- This just filters out unwanted units --------
              • Unit Group - Remove (Picked unit) from LL_UG[LL_Index].
      • -------- - --------
      • -------- Clean Up Loc Leak --------
      • Custom script: call RemoveLocation (udg_LL_Loc1)
      • -------- - --------
      • -------- Turn On Timer (If it's off) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LL_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on LL Loop <gen>
        • Else - Actions

  • LL Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LL_Loop) from 1 to LL_Index, do (Actions)
        • Loop - Actions
          • Set VariableSet LL_Time[LL_Loop] = (LL_Time[LL_Loop] - 1.00)
          • Set VariableSet LL_Loc1 = (Position of LL_Caster[LL_Loop])
          • Set VariableSet LL_RemoveFromLoop = False
          • -------- - --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LL_Time[LL_Loop] Greater than 0.00
              • (LL_Caster[LL_Loop] is alive) Equal to True
            • Then - Actions
              • -------- Distance / Damage / Lightning --------
              • Unit Group - Pick every unit in LL_UG[LL_Loop] and do (Actions)
                • Loop - Actions
                  • Set VariableSet LL_Target = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (LL_Target belongs to an enemy of (Owner of LL_Caster[LL_Loop]).) Equal to True
                      • (LL_Target is alive) Equal to True
                    • Then - Actions
                      • Set VariableSet LL_Loc2 = (Position of LL_Target)
                      • Set VariableSet LL_Distance = (Distance between LL_Loc1 and LL_Loc2)
                      • -------- - --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • LL_Distance Less than or equal to 625.00
                        • Then - Actions
                          • -------- Damage / Lightning --------
                          • Unit - Cause LL_Caster[LL_Loop] to damage LL_Target, dealing LL_Damage[LL_Loop] damage of attack type Spells and damage type Magic
                          • Trigger - Run LL Lightning <gen> (ignoring conditions)
                        • Else - Actions
                          • -------- Remove Target / Check If LL_UG Is Empty --------
                          • Unit Group - Remove LL_Target from LL_UG[LL_Loop].
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in LL_UG[LL_Loop]) Equal to 0
                            • Then - Actions
                              • Set VariableSet LL_RemoveFromLoop = True
                            • Else - Actions
                      • -------- - --------
                      • -------- Clean Up Loc Leak --------
                      • Custom script: call RemoveLocation (udg_LL_Loc2)
                    • Else - Actions
                      • -------- Remove Target / Check If LL_UG Is Empty --------
                      • Unit Group - Remove LL_Target from LL_UG[LL_Loop].
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in LL_UG[LL_Loop]) Equal to 0
                        • Then - Actions
                          • Set VariableSet LL_RemoveFromLoop = True
                        • Else - Actions
            • Else - Actions
              • Set VariableSet LL_RemoveFromLoop = True
          • -------- - --------
          • -------- Clean Up Loc Leak --------
          • Custom script: call RemoveLocation (udg_LL_Loc1)
          • -------- - --------
          • -------- Finished - This runs when the Timer expires, or the Caster dies, or all of the Targets die --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LL_RemoveFromLoop Equal to True
            • Then - Actions
              • -------- This is required for Dynamic Indexing to work --------
              • Set VariableSet LL_Caster[LL_Loop] = LL_Caster[LL_Index]
              • Set VariableSet LL_Time[LL_Loop] = LL_Time[LL_Index]
              • Set VariableSet LL_Damage[LL_Loop] = LL_Damage[LL_Index]
              • Unit Group - Remove all units from LL_UG[LL_Loop].
              • Custom script: call DestroyGroup (udg_LL_UG[udg_LL_Loop])
              • Set VariableSet LL_UG[LL_Loop] = LL_UG[LL_Index]
              • -------- - --------
              • Set VariableSet LL_Index = (LL_Index - 1)
              • Set VariableSet LL_Loop = (LL_Loop - 1)
            • Else - Actions
      • -------- - --------
      • -------- Turn Off Timer --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LL_Index Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

  • LL Lightning
    • Events
    • Conditions
    • Actions
      • Custom script: local lightning udg_LL_Lightning
      • Custom script: set udg_LL_Lightning = AddLightningEx("FORK", true , GetLocationX(udg_LL_Loc1), GetLocationY(udg_LL_Loc1), GetLocationZ(udg_LL_Loc1) + 70, GetLocationX(udg_LL_Loc2), GetLocationY(udg_LL_Loc2), GetLocationZ(udg_LL_Loc2) + 70)
      • Wait 0.25 seconds
      • Lightning - Destroy LL_Lightning
      • Custom script: set udg_LL_Lightning = null

Lightning might be a bit buggy with Reforged graphics. Someone reported that vertex tinting of lighting did not work in Reforged graphics mode as well.

This is true, the custom script to move lightning does not work at all.

Also noticed that some special effects sound "leak" and they continue playing after the special effect is destroyed:
Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Abilities\Weapons\Bolt\BoltImpact.mdl
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
Maybe a simple example map showing all these broken assets and mechanics that work fine with classic graphics but break with Reforged graphics might be useful. Especially if multiple people could verify that it is consistently broken with Reforged graphics. I could forward it to Kam for it to be debugged and possibly fixed in a future update.
 
Level 12
Joined
May 16, 2020
Messages
660
Maybe a simple example map showing all these broken assets and mechanics that work fine with classic graphics but break with Reforged graphics might be useful. Especially if multiple people could verify that it is consistently broken with Reforged graphics. I could forward it to Kam for it to be debugged and possibly fixed in a future update.

Can confirm! With reforged graphics:
- Thunder Clap, War Stomp and many thunder sounds loop 3x after the animation with custom spells (not the default spells!). That's why I imported the old graphics where the sound does not loop
- Some Unit Sound Sets seem to be incompatible with some units. Again, when switching to classic graphics this fixes itself
- Lightning effects can be created, but not modified (recolored, moved, made permanent, removed)

All of these errors fix themselves when switching to classic graphics

Other people also reported this:
Sounds associated with effects created by periodic triggers play multiple times
Stomp and Thunder Clap Sounds Play Several Times
 
Last edited:
Status
Not open for further replies.
Top