HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Negate move order?

02-23-2008, 03:55 PM#1
Bsycho
hi folks,

i want to stop a unit from moving.

so i try following:
- pause triggering unit
- order triggerunit to stop
- unpause triggering unit

i know there are multiple events but i covered them all.
still the trigger seems to have no effect, even though it fires (checked via message)

i already used this in another map and it worked perfectly.
this time its a hero unit, but i dont think thats the issue here.

any ideas what could be mistaken? other ways to prevent movement except removing the ability itself?
02-23-2008, 04:13 PM#2
Troll-Brain
Strange it works fine for me (with an hero or an unit)
02-23-2008, 04:37 PM#3
Bsycho
what if i move the unit instantly to a certain point right after or before i use the above actions, could that have any effect?

ok i just paste the trigger:
Code:
Marker
    Events
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order targeting an object
    Conditions
        (Unit-type of (Triggering unit)) Equal to Portal Marker
    Actions
        Set point_temp[95] = (Target point of issued order)
        -------- Player 1 --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Does (Convert P1 NorthernCaves <gen> to a region) contain point point_temp[95]) Equal to True
                int_campowner[4] Equal to 1
                string_portdest[1] Not equal to northcaves
            Then - Actions
                Set point_temp[96] = (Center of P1 NorthernCaves <gen>)
                Unit - Move (Triggering unit) instantly to point_temp[96]
                Unit Group - Pick every unit in grp_destcircles[1] and do (Actions)
                    Loop - Actions
                        Unit - Change color of (Picked unit) to Black
                Unit - Change color of Northern Caves 0098 <gen> to Red
                Set string_portdest[1] = northcaves
                Game - Display to Player 1 (Red), at offset (0.00, 0.00) the text: Portal Destination:...
            Else - Actions
        Unit - Pause (Triggering unit)
        Unit - Unpause (Triggering unit)
        Unit - Order (Triggering unit) to Stop
        Custom script: call RemoveLocation(udg_point_temp[95])
        Custom script: call RemoveLocation(udg_point_temp[96])

the unit is a portal marker and has very limited space to move, so if the right click targets an object, i believe it should not interfer anyway. (usually i seperate the events)

i appreciate any help
02-23-2008, 04:51 PM#4
moyack
no effect at all.

One question... do you want to block the unit completely??
02-23-2008, 05:00 PM#5
grupoapunte
Did you try to make it hold position?

Collapse JASS:
call IssueImmediateOrder(GetTriggerUnit(), "holdposition")

Alternative solution in case your problem is this:

If the unit is computer controled and you are making it move from one point to the other and the unit goes back to it's start location, then what you have to do is create a AI script and run it for that computer player, im telling you this because i had this problem. Open notepad and copy/paste this:

Collapse JASS:
function main takes nothing returns nothing
    call InitAI()
    call SleepForever()
endfunction

save it as "dummyai.ai"

then on your map you have to import the file and run the script with triggers just one time (i would suggest map initialization) this script:

Collapse JASS:
call StartMeleeAI(Player(X), "war3mapImported\\dummyai.ai")

Put the player number that you want, with this units will be totaly controlable by triggers.

Good Luck
02-23-2008, 05:00 PM#6
Themerion
You might need to stop it in a separate trigger. I know, it sounds odd, but it will probably work.

Trigger:
Do this is your main trigger
Set tempUnit = (Ordered unit)
Trigger - Run Stop Unit <gen> (checking conditions)

Trigger:
Stop Unit
Events
Conditions
Collapse Actions
Unit - Order tempUnit to Stop
02-23-2008, 05:04 PM#7
Bsycho
no, i still want orders able to be issued.

what really bugs me, is that i already used this. i dont get it.

if i return the unit's name it displays correct, the trigger itself fires also (checking via messages).

edit: thanks i will take a look, the unit is still player controlled btw. i tried hold position also, if i remember correctly.
02-23-2008, 05:08 PM#8
grupoapunte
if you try the AI thing you will be able to issue orders without problems, but as i said, use that only if the unit is controled by a computer player
02-24-2008, 01:16 AM#9
Salbrismind
If you don't want the unit to even move then just change its movement speed in the object editor to 0.
02-24-2008, 10:41 AM#10
Troll-Brain
you do that :
Trigger:
Unit - Pause (Triggering unit)
Unit - Unpause (Triggering unit)
Unit - Order (Triggering unit) to Stop

instead of that :

Trigger:
Unit - Pause (Triggering unit)
Unit - Order (Triggering unit) to Stop
Unit - Unpause (Triggering unit)

If the unit had an immediate order before she get the point/widget target order, and you want to keep it you can use that :
Collapse JASS:
call IssueImmediateOrderById ( GetTriggerUnit() , 851973)
instead of order to stop