• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Time Controll

Status
Not open for further replies.
Level 2
Joined
May 20, 2007
Messages
24
It's my second spell that I did with triggers and I don't know triggers :)
It make every unit stop (all the actions disappear for 5 seconds) but the units animation still continues.
See the trigger (sorry if it's different because my editor is in Russian)
A spell like this is in dota the last war... I need it to stop absolute everything for 5 seconds except the caster.
 

Attachments

  • Trigger.bmp
    146.7 KB · Views: 109
Level 13
Joined
Nov 22, 2006
Messages
1,260
Ah, so the only problem is with the animation? That's easy

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set UnitGroup = (Units in (Playable map area) matching ((Matching unit) Not equal to (Casting unit)))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
          • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
      • Custom script: call DestroyGroup(udg_UnitGroup)
Replace Animate Dead with the spell you have as a time control

You have to create a global variable named UnitGroup of type Unit Group

About the animation still going, you just have to set animation speed to 0%
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
A better way is to scrap the group and do this:

  • Some Trigger
    • Events
      • Unit - a Unit Starts the Effect of an Ability
    • Conditions
      • (Ability Being Cast) Equal to (Some Ability)
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick Every Unit in (Units in Playable Map Area...
        • Loop - Actions
          • Unit - Animation Change (Picked Unit)'s Animation Speed to 0%
          • Unit - Pause (Picked Unit)
 
Last edited by a moderator:
Level 13
Joined
Nov 22, 2006
Messages
1,260
They always told me not to use bj_wantDestroyGroup, and now here it is.......well it's a good way if you're not using the group anymore, you choose :) But it won't be any easier with PurplePoot's way, because you still have to learn my way, since you can't destroy anything else his way

Anyways, scroll to the bj_wantDestroyGroup part (PurplePoot):
http://www.elilz.com/catfaq.php?catchose=Custom Text
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
JASS:
function ForGroupBJ takes group whichGroup, code callback returns nothing
    // If the user wants the group destroyed, remember that fact and clear
    // the flag, in case it is used again in the callback.
    local boolean wantDestroy = bj_wantDestroyGroup
    set bj_wantDestroyGroup = false

    call ForGroup(whichGroup, callback)

    // If the user wants the group destroyed, do so now.
    if (wantDestroy) then
        call DestroyGroup(whichGroup)
    endif
endfunction

As you can see, it checks everything except the DestroyGroup itself no matter what. However,

A) your way still needs DestroyGroup

B) it sets a variable
 
Level 5
Joined
May 27, 2007
Messages
132
here's a suggestion that'll work for 1 player vs computer players. If you want other players or computer players to use it, you'll need to adapt it.

Event:Every 1 seconds of game time
Action: Add (all units in (playable map area)) to group TimeStop
Action: Remove all units belonging to Player 1(red) from Unit Group TimeStop

Event: Ability (Time Stop) is used
Action: Set animation speed for units in TimeStop to 0.00
Action: wait 5 seconds
Action: Run Trigger (Time Restart)

Event: None
Action: Set the animation speed back to whatever the normal speed is
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Uhmm why did you do it like that? Couldn't you just do pick every unit in playable map area once, and not every second? Why did you put "Set the animation speed back to whatever the normal speed is" in another trigger? You still didn't destroy the group
 
Level 5
Joined
May 27, 2007
Messages
132
I was just trying to create an easy GUI trigger system.

So yeah, a few flaws.

The unit group definitely has to be deleted. The every second of game time will ensure that any units added to the map will also be frozen. It can be done either way.
 
Status
Not open for further replies.
Top