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

Cyclone issue

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
  • Cyclone
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cyclone Main Ability (Item)
    • Actions
      • Unit - Pause (Target unit of ability being cast)
      • Wait 6.00 seconds
      • Unit - Unpause (Target unit of ability being cast)
      • Unit - Remove All buffs from (Target unit of ability being cast)
The unit never comes down from the cyclone even though the duration is 5 seconds. Any idea what the issue is?
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
millzy is correct, it's one of the few that will not. Here's an explanation of what does and doesn't work: Event Response Myths

Is there any particular reason you're doing it this way instead of, like, literally dummy casting cyclone or a storm bolt on the unit with a duration of 6 seconds? If you must do it this way, you'll need to shadow a global variable locally to preserve Target Unit of Ability Being Cast through the wait. Here's a tutorial/demo map on how to do that: local udg_
 
Level 12
Joined
Dec 2, 2016
Messages
733
millzy is correct, it's one of the few that will not. Here's an explanation of what does and doesn't work: Event Response Myths

Is there any particular reason you're doing it this way instead of, like, literally dummy casting cyclone or a storm bolt on the unit with a duration of 6 seconds? If you must do it this way, you'll need to shadow a global variable locally to preserve Target Unit of Ability Being Cast through the wait. Here's a tutorial/demo map on how to do that: local udg_

What would be the difference in having a dummy unit cast the cyclone instead of detecting when the cyclone is used?
The problem is that when my unit gets cycloned he is able to move and blink away while in the air so I need to freeze him for the duration.
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
Okay so this is definitely a side effect of the solution @Aeryn posted in your other thread about Cyclone. Unfortunately you can’t keep the unit on the minimap without getting this behavior as well. Or at least I presume that based on your description here, but I am away from my computer and cannot test.

I would say it’s better to just dummy storm bolt/entangling roots the cycloned unit too. There’s no benefit to dummy casting the cyclone itself (since the item casts it just fine); I thought based on your trigger that the cyclone item ability was actually a ‘blank’ ability with no effect and you were pausing the unit to achieve the effect.
 
Level 12
Joined
Dec 2, 2016
Messages
733
Okay so this is definitely a side effect of the solution @Aeryn posted in your other thread about Cyclone. Unfortunately you can’t keep the unit on the minimap without getting this behavior as well. Or at least I presume that based on your description here, but I am away from my computer and cannot test.

I would say it’s better to just dummy storm bolt/entangling roots the cycloned unit too. There’s no benefit to dummy casting the cyclone itself (since the item casts it just fine); I thought based on your trigger that the cyclone item ability was actually a ‘blank’ ability with no effect and you were pausing the unit to achieve the effect.

Ok thanks, and what I ended up doing is this

  • Cyclone
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cyclone Main Ability (Item)
    • Actions
      • Custom script: local unit udg_local_Unit
      • Set local_Unit = (Target unit of ability being cast)
      • Unit - Pause local_Unit
      • Unit - Unpause local_Unit
      • Custom script: set udg_local_Unit = null
What happens is pauses unit after hes been launched in the air, and after the cyclone duration is finished the rest of the trigger runs unpausing the unit. I thought it was kinda weird, I'd assume that the unpause would happen regardless of the item ability duration. But its working as intended now.
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
There’s no way it’s actually working like that. Triggers don’t just randomly pause in the middle. I have no computer access until late this weekend, but if you upload a test map with this behavior here someone else may be able to look at it.

It sounds dumb to me but my best guess is that Cyclone specifically interacts differently with/manually pauses and in pauses the unit in some way, just based on the fact that removing the hide option didn’t limit the unit’s actions in the first place.
 
Level 12
Joined
Dec 2, 2016
Messages
733
It's weird, the trigger works. Or at least maybe pausing the first time stops the unit from blinking and moving while cycloned even though he's unpaused.

But the unit has a morphing ability that turns it into another unit model. Once this happens if you cyclone him the original bug happens where he can move and blink away while cycloned in the air. But from the start before he uses this transmorg ability he can't move or do anything while cycloned.

What do you think my solutions are here?

Even if I change walkspeed to 0 while in the air, they can still blink since they have a blink ability and I don't think that requires walkspeed to be anything higher than 0.
 
Level 12
Joined
Dec 2, 2016
Messages
733
I don't think that they would be able to blink during cyclone because it's a cc which interrupts spell casting. So something is not right here. Are you sure that cyclone is not a triggered ability, just vanilla cyclone ?

This is the code, but I can't imagine it is affecting this. Just detects if the unit type is matching a certain unit and disables the cyclone if so. But yea it's a vanilla cyclone. While cycloned they can move and blink and the tornado effect follows.


JASS:
library cyclone requires AbilityEvent, libSetup {

function onCyclone() {
    unit uC = GetSpellAbilityUnit();
     
    if (IsVampire(GetSpellTargetUnit())) {
        IssueImmediateOrder(uC, "stop");
        InterfaceError(GetOwningPlayer(uC), "You cannot cyclone vampires!");
    }
    uC = null;
}

private function onInit() {
    AddAbilityPreCastEvent(ID_ABILITY_CYCLONE, onCyclone);

}
}
 
Level 12
Joined
Dec 2, 2016
Messages
733
I ended up doing this

  • Cyclone
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cyclone Main Ability (Item)
    • Actions
      • Custom script: local unit udg_local_Unit
      • Set local_Unit = (Target unit of ability being cast)
      • Unit - Set local_Unit movement speed to 0.00
      • Wait 4.00 seconds
      • Unit - Set local_Unit movement speed to 5.00
      • Custom script: set udg_local_Unit = null
This works for the regular unit, but the units also have a change gender ability that transforms them into another unit.
Screenshot - 0e6188b7bdbcf7cb945b8ff301c90cb1 - Gyazo

Once they transform, while transformed it still works but once they transform back to the original model the trigger stops working and they can blink and move freely while cycloned. Any ideas with this?
 
Status
Not open for further replies.
Top