HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Removing movment from a unit via trigger.

08-20-2007, 08:04 PM#1
Wraithwynd
Trigger:
Land
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Land
Collapse Actions
Unit - Order (Casting unit) to Stop
Animation - Change (Casting unit) flying height to 250.00 at 30.00
Game - Display to (All players) the text: LANDING: Please wai...
Wait 8.00 seconds
Unit - ???
Player - Enable Unload (Air Transports) for (Owner of (Casting unit))
Player - Enable Load (Goblin Zeppelin) for (Owner of (Casting unit))

The Trigger needs another command or two.

When the unit casts the spell "land" it stops, then proceeds to lower itself to just above the ground. Then it enables load/unload abilities. I want it to have some realistic characteristics. The wait time of 8 seconds is there to give time for the craft to land.

However it moves to load and unload. I want it to not move from its position when either the load/unload ability is selected or when you right click on it with units in the selection.

I do not want it to move until "take off" (another spell) is used - causing the unit to rise into the air and gain speed over a period of time.

At the point where I have Unit - ??? I have tried:

Unit - Set (Casting unit) movement speed to -1.00

and

Animation - Change (Casting unit)'s animation speed to 0.00% of its original speed

I've also tried pause unit - however then the unit will not load/unload.

Hold and stop work, until you right click or use the load/unload at a distance from the unit, then the unit begins to move.

I want it to stay put, I want land units to have to run to it, not it run to meet them. Like going to an airport, you go to the plane the plane does not come to you.

Any suggestions are welcomed.
08-20-2007, 08:07 PM#2
botanic
what abuot making another unit that it replaces with no movement type ;)
08-21-2007, 01:02 AM#3
Nubcookie
Just pause it for 8 seconds.
08-22-2007, 06:24 AM#4
Wraithwynd
Quote:
Originally Posted by botanic
what abuot making another unit that it replaces with no movement type ;)

Will a loaded unit or loaded units shift over the the moving zeppelin?
08-22-2007, 09:41 AM#5
Earth-Fury
Custom Script: call UnitRemoveAbility(udg_NameOfGlobalUnitVariable, 'Amov')
then
Custom Script: call UnitAddAbility(udg_NameOfGlobalUnitVariable, 'Amov')

should work. (removes the move ability)
08-22-2007, 07:19 PM#6
Pyrogasm
I didn't think you could re-add move.
08-22-2007, 09:00 PM#7
Wraithwynd
Quote:
Originally Posted by Earth-Fury
Custom Script: call UnitRemoveAbility(udg_NameOfGlobalUnitVariable, 'Amov')
then
Custom Script: call UnitAddAbility(udg_NameOfGlobalUnitVariable, 'Amov')

should work. (removes the move ability)

Ah.

NameOfGlobalUnitVariable would be what exactly? Do I have to assign a variable to the zeppelins (which are customized units)?

Or would I use a variation of "casting unit" in that trigger?
08-22-2007, 09:13 PM#8
Pyrogasm
You'd do something like this:
Trigger:
Set TheUnitVariable = (Triggering Unit)
Custom Script: call UnitRemoveAbility(udg_TheUnitVariable, 'Amov')
And then this:
Trigger:
Set TheUnitVariable = (Triggering Unit)
Custom Script: call UnitAddAbility(udg_TheUnitVariable, 'Amov')
You could also just do this: Custom Script: call UnitRemoveAbility(GetTriggerUnit(), 'Amov').
08-22-2007, 10:27 PM#9
iNfraNe
Erm, since when can you readd move?
08-22-2007, 10:36 PM#10
Pyrogasm
That's what I wanted to know.
10-04-2007, 06:43 PM#11
Wraithwynd
Sorry it has been so long for my reply.

I tried the Amov custom script and it never worked - the remove part worked, but the adding Amov just did not work.

Tinkering with the trigger and the Zeppelin I finally got something that works.

In my object editor I Made minimum movement speed 1 and maximum 200.

Then I have my land and take off triggers:

Trigger:
Land
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Land
Collapse Actions
Unit - Order (Casting unit) to Stop
Animation - Change (Casting unit) flying height to 250.00 at 30.00
Game - Display to (All players) the text: LANDING: Please wai...
Wait 1.00 seconds
Unit - Set (Casting unit) movement speed to 0.01
Player - Enable Unload (Air Transports) for (Owner of (Casting unit))
Player - Enable Load (Goblin Zeppelin) for (Owner of (Casting unit))

Trigger:
Lift off
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Lift Off
Collapse Actions
Player - Disable Unload (Air Transports) for (Owner of (Casting unit))
Player - Disable Load (Goblin Zeppelin) for (Owner of (Casting unit))
Game - Display to (All players) the text: TAKE OFF
Animation - Change (Casting unit) flying height to 500.00 at 20.00
Unit - Set (Casting unit) movement speed to (Default movement speed of (Triggering unit))

Having set the movement speed so low the Zeppelin just does not move or perhaps it is just moving so slowly as to look like its not moving at all.

I'm just posting this for the edification of others.
10-04-2007, 07:44 PM#12
blu_da_noob
Another solution would be a custom ensnare ability with infinite duration. You could create a dummy to cast it on the zep when it lands and remove the buff for it to lift off. That would have the nice side effect of not allowing slowing abilities to bring units to a halt in your map.
10-04-2007, 08:27 PM#13
Toadcop
once again Night Elf Root ability pawnz ^^ 'Aro1'