• 🏆 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] Real Current Speed problem

Status
Not open for further replies.
Level 4
Joined
May 12, 2008
Messages
49
Hi, I am trying to make a small system, where if you run, you turn invisible, but if you stop moving, you can be spotted.

I have made a spell based on immolation since you can turn that on off quickly.

I use these 3 triggers for it:

Vampiric Speed Cast
  • Vampiric Speed Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Vampiric Speed
    • Actions
      • Unit Group - Add (Casting unit) to VampiricSpeed
      • Unit - Set (Casting unit) movement speed to 500.00
      • Wait 1.00 seconds
      • Wait until (((Casting unit) has buff Vampiric Speed) Equal to False), checking every 1.00 seconds
      • Unit - Remove Permanent Invisibility from (Casting unit)
      • Unit - Set (Casting unit) movement speed to 270.00
      • Unit Group - Remove (Casting unit) from VampiricSpeed
Vampiric Speed Invisibility
  • Vampiric Speed Invisibility
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in VampiricSpeed and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current movement speed of (Picked unit)) Greater than or equal to 400.00
            • Then - Actions
              • Unit - Add Permanent Invisibility to (Picked unit)
              • Game - Display to (All players) the text: Adding invis.
            • Else - Actions
              • Unit - Remove Permanent Invisibility from (Picked unit)
              • Game - Display to (All players) the text: Removing invis.
Speed check
  • Speed check
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String((Current movement speed of Vampire 0000 <gen>)))
The problem is that is only registers the default speed of the unit, not the current one.

My hero has a speed base of 270, 0min 0max.
And every 2 seconds when I'm supposed to get a message telling me what speed my unit has, even if I'm standing still, it fetches me the message 270.000

and if I turn on the Vampiric Speed spell, it says that his speed is 400.000 and then it turns on the invisibility.

Need help :vw_wtf:
 
First of all, your script isn't MUI... meaning it would bug if multiple units use it...

Second, since you used waits, the last three actions of the first trigger won't work...

Third, movespeed is the same whether ur moving or not...

Fourth, if it says 400, it means that you didn't modify the value of max movespeed on the Gameplay -> Gameplay constants...
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I want him to get the system of "IsUnitMoving" ?
Like Bribe did it
If that unit is moving, well, do nothing, if that unit stops (the system detects it), well, just remove the permanent invi from that unit, done
Of course, with the current trigger conditions of the thread starter, it's not MUI, as you've mentioned it

where if you run, you turn invisible, but if you stop moving, you can be spotted.
 
Status
Not open for further replies.
Top