HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

unit - disable movement but allow turning

09-29-2007, 06:37 AM#1
Brent
hi, how do you allow a unit to turn but disable other movement?

i'm trying to make a tower that always faces the unit it's attacking.
i've tried a trigger that periodically changes the facing of the tower:
Trigger:
Untitled Trigger 001
Collapse Events
Time - Every 0.04 seconds of game time
Collapse Conditions
(Distance between (Position of attackedunit) and (Position of attackingunit)) Less than (Current acquisition range of attackingunit)
Collapse Actions
Unit - Move attackingunit instantly to (Position of attackingunit), facing (Position of attackedunit)
this is not ideal since the tower cannot attack (since it's constantly being moved)
any help is appreciated thanks
09-29-2007, 06:54 AM#2
Pyrogasm
This would set its facing:
Trigger:
Collapse Events
Time - Every 0.04 seconds of game time
Conditions
Collapse Actions
set TempPoint = (Position of attackedunit)
set TempPoint2 = (Position of attackingunit)
Collapse If (All conditions are true) then do (Then actions) else do (else actions)
Collapse If - Conditions
(Distance between TempPoint and TempPoint2) Less than (Current acquisition range of attackingunit)
Collapse Then - Actions
Custom script: call SetUnitFacing(udg_attackingunit, AngleBetweenPoints(udg_TempPoint2, udg_TempPoint))
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)
But this trigger might turn only its top turret area:
Trigger:
Collapse Events
Time - Every 0.04 seconds of game time
Conditions
Collapse Actions
set TempPoint = (Position of attackedunit)
set TempPoint2 = (Position of attackingunit)
Collapse If (All conditions are true) then do (Then actions) else do (else actions)
Collapse If - Conditions
(Distance between TempPoint and TempPoint2) Less than (Current acquisition range of attackingunit)
Collapse Then - Actions
Custom script: call SetUnitLookAt(udg_attackingunit, udg_attackedunit, "turret", 0, 0, 0)
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)
Or you could try fooling with the "Animation - Lock Body Part Facing" action to get a result.


As for your first question, try going into gameplay constants and setting "Movement - Unit Speed - Minimum" to 0 and then creating an ability based off of endurance aura that gives a -1000% movement speed bonus. After that, create a new spell based off of "spell book" and have it's only spell (change the min/maximum spells to 1 for the spellbook) be the spell you just created. Then, (in the Object Editor) give that spellbook ability to any unit you want to not be able to move but still be able to turn. Last, set up the following simple trigger:
Trigger:
Collapse Events
Map Initialization
Conditions
Collapse Actions
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Player - Disable YOUR SPELLBOOK ABILITY for (Picked Player)
09-29-2007, 08:19 AM#3
botanic
if a unit is issued an order targeting a point then told to stop dont they turn but not move?

event
unit issued order targeting a point
condition
= the tower thing
action
order triggering unit to stop

as for attacking maby an phoenix fire ability if this stops it from attacking...
09-29-2007, 10:27 AM#4
Brent
Quote:
Originally Posted by Pyrogasm
As for your first question, try going into gameplay constants and setting "Movement - Unit Speed - Minimum" to 0 and then creating an ability based off of endurance aura that gives a -1000% movement speed bonus. After that, create a new spell based off of "spell book" and have it's only spell (change the min/maximum spells to 1 for the spellbook) be the spell you just created. Then, (in the Object Editor) give that spellbook ability to any unit you want to not be able to move but still be able to turn. Last, set up the following simple trigger:
Trigger:
Collapse Events
Map Initialization
Conditions
Collapse Actions
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Player - Disable YOUR SPELLBOOK ABILITY for (Picked Player)
I tried something similar to this with a unit with base move speed of 1 and an unholy aura of -1000. i could still tell it was moving, even if at an extremely slow rate.
if i set the base move speed to 0, i lose the move button from the command card, which i need for the unit to be able to turn.
09-29-2007, 10:40 AM#5
Weyrling
You set Minimum move speed, in game constants, to 0, so the -1000 unholy aura reduces move speed to 0.
09-29-2007, 11:46 AM#6
Brent
yeah, I did that. in game constants the minimum move speed is 0, and "Movement - Speed Minimum" in the unit's properties is 0 as well.
the units movespeed still appears to be 1
09-29-2007, 12:06 PM#7
Toadcop
suck Tc pawnz... i just had this problem and solved it.
simple add Night Elf "Root" ability (check the "can turn" flag) and tada thats all =) and you can trick a bit with it.
09-29-2007, 12:43 PM#8
Brent
Quote:
Originally Posted by Toadcop
suck Tc pawnz... i just had this problem and solved it.
simple add Night Elf "Root" ability (check the "can turn" flag) and tada thats all =) and you can trick a bit with it.
i did as you said and used the root ability within a disabled spellbook.
works brilliantly, thanks everyone.