1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Freeze Spell

Discussion in 'Triggers & Scripts' started by darkalex13, Dec 29, 2008.

  1. darkalex13

    darkalex13

    Joined:
    Feb 20, 2008
    Messages:
    54
    Resources:
    0
    Resources:
    0
    So the idea is like this, a unit casts breath of frost and the units that are damaged by it will be freezed for 0.5 seconnds, the only problem is that they won't defreeze(I mean unpause)...
    • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
    • Unit Group - Pick every unit in (Units in Rect 012 <gen>) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then actions) else do (Else Actions)
    • If - conditions
    • ((Picked unit) has buff Breath of Frost(freeze)) equal to True
    • Then - Actions
    • Unit - Remove Breath of Frost (freeze) buff from (Picked Unit)
    • Unit - Pause (Picked Unit)
    • Advanced - Create Attach Point - Overhead of (Picked Unit) the Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl effect lasting 0.50 seconds
    • Wait 0.50 seconds
    • Unit - Unpause (Picked Unit)


    What's the problem?
     
  2. PatruX

    PatruX

    Joined:
    May 21, 2006
    Messages:
    175
    Resources:
    1
    Tools:
    1
    Resources:
    1
    You lose (Picked Unit) after wait.
    Tip: Use a local variable.
     
  3. darkalex13

    darkalex13

    Joined:
    Feb 20, 2008
    Messages:
    54
    Resources:
    0
    Resources:
    0
    Damn, but if so I need variable type array and I don't know how to use them, if you could please show me an example...
     
  4. PatruX

    PatruX

    Joined:
    May 21, 2006
    Messages:
    175
    Resources:
    1
    Tools:
    1
    Resources:
    1
    When in the trigger editor press Ctrl+B to bring up the variable editor.
    Add a new variable with the name FreezeGroup and type "Unit Group".

    • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
    • Unit Group - Pick every unit in (Units in Rect 012 <gen>) and do (Actions)
    • Loop - Actions
    • -------- Added this: --------
    • Unit Group - Add (Picked unit) to FreezeGroup
    • If (All Conditions are True) then do (Then actions) else do (Else Actions)
    • If - conditions
    • ((Picked unit) has buff Breath of Frost(freeze)) equal to True
    • Then - Actions
    • Unit - Remove Breath of Frost (freeze) buff from (Picked Unit)
    • Unit - Pause (Picked Unit)
    • Advanced - Create Attach Point - Overhead of (Picked Unit) the Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl effect lasting 0.50 seconds
    • Wait 0.50 seconds
    • Unit - Unpause (Picked Unit)
    • -------- Added this: --------
    • Unit Group - Remove all units from FreezeGroup


    Notice the "Unit Groups", though this is a so called Global Variable and will only work properly as long as multiple heroes aren't casting the spell at the same time.

    And btw, it "leaks". Probably does not matter in this case anyway.
     
  5. darkalex13

    darkalex13

    Joined:
    Feb 20, 2008
    Messages:
    54
    Resources:
    0
    Resources:
    0
    Thanks for the variable stuff, I appreciate it. +rep
     
  6. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,203
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
    • set local unit u = Unit
    • set Unit = Picked unit
    • Unit Group - Pick every unit in (Units in Rect 012 <gen>) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then actions) else do (Else Actions)
    • If - conditions
    • ((Unit) has buff Breath of Frost(freeze)) equal to True
    • Then - Actions
    • Unit - Remove Breath of Frost (freeze) buff from (Unit)
    • Unit - Pause (Unit)
    • Special Effect - Overhead of (Unit) the Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
    • Special Effect - Destroy (Last created) Special effect
    • Wait Gametime - 0.50 seconds
    • Unit - Unpause (Unit)
    • set u = null


    I think it should be something like this, but correct me if i'm wrong by setting "Unit" I'm not sure what is first local or global...
    And btw. you are leaking a location there.
     
  7. Airandius

    Airandius

    Joined:
    Jun 12, 2007
    Messages:
    1,238
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Tutorials:
    1
    Resources:
    3
    Why are you guys being so complicated?
    Btw, avoid waits in custom spells it can bug.

    Just create a dummy for each unit that got hit (loop it?) add slow with 10o% to it. And set duration of that slow to 0.5 seconds. Voala.
     
  8. Zack1996

    Zack1996

    Joined:
    Dec 18, 2007
    Messages:
    1,088
    Resources:
    3
    Models:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Why not just create a periodic trigger that checks every .1 second for any units with a buff (make a Breath of Frost buff, it is just for checking) and create a dummy unit and order it to cast some stun spell on the unit.
     
  9. Airandius

    Airandius

    Joined:
    Jun 12, 2007
    Messages:
    1,238
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Tutorials:
    1
    Resources:
    3
    That's like 10x more complicated then just casting a 100% slow spell with frost buff? xD
    Cmon, stop being complicated!!!! o_O
     
  10. darkalex13

    darkalex13

    Joined:
    Feb 20, 2008
    Messages:
    54
    Resources:
    0
    Resources:
    0
    I had to make another trigger to make the unpause work, because it still didn't work in the end but all that counts is that in the end I managed to get it working the only problem is that the special effect lasts too much...
     
  11. Palaslayer

    Palaslayer

    Joined:
    Jun 16, 2008
    Messages:
    1,779
    Resources:
    66
    Icons:
    62
    Packs:
    1
    Spells:
    2
    Tutorials:
    1
    Resources:
    66
    is there a gui action like set local unit u etc? i think not
     
  12. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,203
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    Its a custom script..
    • trigger
    • Actions
      • Custom script - set local unit u = Unit


    But as far as i know local depends on global and you can only use one local per trigger, this is how it goes for GUI (i think)
     
  13. Palaslayer

    Palaslayer

    Joined:
    Jun 16, 2008
    Messages:
    1,779
    Resources:
    66
    Icons:
    62
    Packs:
    1
    Spells:
    2
    Tutorials:
    1
    Resources:
    66
    the thing is u cant use variables set in custom script with gui actions, sry
     
  14. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,203
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    I hate to do this, but...
     
  15. Soga-

    Soga-

    Joined:
    Jul 20, 2008
    Messages:
    374
    Resources:
    0
    Resources:
    0
    This.

    Ockham's Razor applies.