• 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.

Adding ability when unit is standing still

Status
Not open for further replies.
Level 13
Joined
Sep 14, 2008
Messages
1,408
Uuuh hard -.-

you need to trigger this I think (there might be a solution with the nightelf invisble thing but i don't know how to do that...)


I would do it like this:

Variables: Position = Position. XD

Event: Time - Every 0.2 sec of gametime
Action:
If(Position of "YourUnit" == "Position")
Then: Add "yourAbility" to "YourUnit"
Else: Remove "yourAbility" from "yourUnit"

Set Position = Position of "YourUnit"
 
Level 10
Joined
Nov 5, 2008
Messages
536
Uuuh hard -.-

you need to trigger this I think (there might be a solution with the nightelf invisble thing but i don't know how to do that...)


I would do it like this:

Variables: Position = Position. XD

Event: Time - Every 0.2 sec of gametime
Action:
If(Position of "YourUnit" == "Position")
Then: Add "yourAbility" to "YourUnit"
Else: Remove "yourAbility" from "yourUnit"

Set Position = Position of "YourUnit"

Thanks for your answear. I can also add that the ability I need this for is "Recieve gathered resources." When the unit stands still, lumber can be recieved to the unit, but when the unit moves, workers can NOT leave their lumber to it.
 
Level 10
Joined
Nov 5, 2008
Messages
536
I try to build this trigger in the trigger editor, but I can not find how to do this part:


Action:
If(Position of "YourUnit" == "Position")


What do I choose so I can set these settings?
 
Level 10
Joined
Nov 5, 2008
Messages
536
I would do it like this:

Variables: Position = Position. XD

Event: Time - Every 0.2 sec of gametime
Action:
If(Position of "YourUnit" == "Position")
Then: Add "yourAbility" to "YourUnit"
Else: Remove "yourAbility" from "yourUnit"

Set Position = Position of "YourUnit"

What type of variable is the variable?
 
Level 10
Joined
Nov 5, 2008
Messages
536
  • Variables: Position = Position.
  • Event: Time - Every 0.2 sec of gametime
  • Action:
  • If(Position of "YourUnit" == "Position")
  • Then: Add "yourAbility" to "YourUnit"
  • Else: Remove "yourAbility" from "yourUnit"
  • Set Position = Position of "YourUnit"


I have choosed If/Then/Else, but what do I select to create ("Position of "YourUnit" == "Postion")?
 
Actually have this:

  • Move1
  • Events
    • Time - Every 0.06 seconds of game-time
  • Conditions
  • Actions
    • Set Point1 = (Position of (Your unit))
  • Move2
  • Events
    • Time - Every 0.08 seconds of game-time
  • Conditions
  • Actions
    • Set Point2 = (Position of (Your unit))
    • If/ Then/ Else
      • If (Conditions)
        • (Distance between Point2 and Point1) Equal to 0
      • Then (Actions)
        • Unit - Add Ability to (Your unit)
      • Else (Actions)
        • Unit - Remove Ability from (Your unit)
    • Custom script: call RemoveLocation (udg_Point2)
    • Custom script: call RemoveLocation (udg_Point1)
 
Level 10
Joined
Nov 5, 2008
Messages
536
Thanks for your trigger! When the unit stands still, I want the ability to be added to the unit after the unit have been still for a couple of seconds. Can I do that by changing the Event - Time to for example 5 seconds?
 
Status
Not open for further replies.
Top