• 🏆 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!

[Trigger] Another hocus pocus not working

Status
Not open for further replies.
Level 4
Joined
Jan 3, 2013
Messages
69
Hi ppl :grin:, I know Im maybe bothering you too much but i'm taking big steps with this map im doping and im trying to introduce some new cooler than before spells. :thumbs_up:
Well, basically what the spell is about is that the ice giant sacrifices 10% of his current life to summon a block of ice wich deals a quantity based in the amount sacrificed , the damage is per second. It's not really not working, but the issue here is that by the 5th or 7th time casting it creates a devirginizer LAG, anyways here it is
  • Sudden Winter
    • Events
      • Unit - Ice Giant 0019 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sudden Winter
    • Actions
      • Set SW_Real = ((Life of Ice Giant 0019 <gen>) / 10.00)
      • Set SW_Damage[1] = (SW_Real x 0.50)
      • Set SW_Damage[2] = SW_Real
      • Set SW_Damage[3] = (SW_Real x 1.50)
      • Set SW_Damage[4] = (SW_Real x 2.00)
      • Set SW_Damage[5] = (SW_Real x 3.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Percentage life of Ice Giant 0019 <gen>))) Less than or equal to 5
        • Then - Actions
          • Set SuddenWinter = Sudden Winter
          • Set SuddenWinter_Level = (Level of SuddenWinter for Ice Giant 0019 <gen>)
          • Unit - Remove SuddenWinter from Ice Giant 0019 <gen>
          • Unit - Add SuddenWinter to Ice Giant 0019 <gen>
          • Unit - Set level of SuddenWinter for Ice Giant 0019 <gen> to SuddenWinter_Level
          • Game - Display to (All players matching ((Matching player) Equal to (Triggering player))) for 4.00 seconds the text: |c00FFFF00The hero ...
        • Else - Actions
          • Unit - Create 1 Dummy Unit (Sudden Winter) for (Triggering player) at (Target point of ability being cast) facing Default building facing degrees
          • Set SW_Dummy = (Last created unit)
          • Countdown Timer - Start SW_Timer to expire in 0.55 seconds, as a One-shot timer, performing (Animation - Change SW_Dummy's animation speed to 0.00% of its original speed) upon expiration.
          • Unit - Cause SW_Dummy to damage Ice Giant 0019 <gen>, dealing SW_Real damage of attack type Chaos and damage type Universal
          • Unit - Add Inmolación permanente (Sudden Winter) to SW_Dummy
          • Unit - Set level of Inmolación permanente (Sudden Winter) for SW_Dummy to (Level of Sudden Winter for Ice Giant 0019 <gen>)
          • Unit - Add a 14.00 second Generic expiration timer to SW_Dummy
          • Set SW_Point = (Position of SW_Dummy)
          • Trigger - Turn on Sudden Winter Check <gen>
          • Trigger - Turn on Sudden Winter Damage Alt <gen>

  • Sudden Winter Check
    • 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
          • (SW_Dummy is alive) Equal to False
        • Then - Actions
          • Custom script: call RemoveLocation (udg_SW_Point)
          • Custom script: call RemoveRect(udg_SW_Rect)
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Sudden Winter Damage Alt <gen>
          • Environment - Turn (Last created weather effect) Off
        • Else - Actions
          • Set SW_Rect = (Region centered at SW_Point with size (350.00, 350.00))
          • Environment - Create at SW_Rect the weather effect Northrend Snow (Heavy)
          • Environment - Turn (Last created weather effect) On

  • Sudden Winter Damage Alt
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 450.00 of (Position of SW_Dummy) matching ((((Matching unit) belongs to an enemy of (Owner of Ice Giant 0019 <gen>)) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is dead) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Unit - Cause SW_Dummy to damage (Picked unit), dealing SW_Damage[(Level of Sudden Winter for Ice Giant 0019 <gen>)] damage of attack type Spells and damage type Normal
EDIT: Lol okay, I thought that could make it more readable actually, there you go :DD
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
can you post it without all those comments? it ruins the readability completely.

edit: either way,

Leak:
  • Unit - Create 1 Dummy Unit (Sudden Winter) for (Triggering player) at (Target point of ability being cast) facing Default building facing degrees
Also store the giant into a variable in the cast trigger. Then use that variable instead of manually clicking on the unit 5 times.
 
Level 4
Joined
Jan 3, 2013
Messages
69
Thanks! buuut, Does setting the giant to a variable does improves something? or your advice is just for be more practical?
 
Level 4
Joined
Jan 3, 2013
Messages
69
Now that I thnik about it, that timer might be leaking aswell, but the we haven't find yet what makes the DEVIRGINIZER LAG :CC
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Units within 450.00 of (Position of SW_Dummy) matching
Leaks a location.

"Position of SW_Dummy" generates a location which you never remove.

There might be more but that raised alarm bells immediately.

Edit:
Another location leak...
Unit - Create 1 Dummy Unit (Sudden Winter) for (Triggering player) at (Target point of ability being cast) facing Default building facing degrees
"Target point of ability being cast" generates a location which you never remove.

You also leak a lot of environment weather effect (probably source of poor performance). Turning something off is not the same as destroying it. You either need to recycle (use again later) it or destroy it.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Not sure if you can for this case since there appears to be no natives to move weather. You can however destroy it using this native...
JASS:
native RemoveWeatherEffect takes weathereffect whichEffect returns nothing

Which should have a GUI action wrapper which calls this...
JASS:
function RemoveWeatherEffectBJ takes weathereffect whichWeatherEffect returns nothing
    call RemoveWeatherEffect(whichWeatherEffect)
endfunction
Use the action on the weather effect and it will be removed.
 
Level 4
Joined
Jan 3, 2013
Messages
69
So, Additional question, by destroying the weather effect (by storing it in a variable i guess) it turns it automatically off?
 
Status
Not open for further replies.
Top