How do I restrain unit's ability to move and patrol?

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
How do I restrain unit's ability to move and patrol?

because when I use the trigger:

Events
Unit - A unit Is issued an order targeting a point
Conditions
(Issued order) Equal to (Order(move))
Actions
Unit - Order (Ordered unit) to Stop
------------
the outcome of this makes the warcraft crash.

oh yeah. i also have another trigger with its event:

Unit - A unit Is issued an order with no target

but its a different trigger.
------------

any idea on how i can restrain move and patrol order without crashing?

any help would be appreciated

thank you.

problem: answered.
 

darkbeer

Beer is Good!
Reaction score
84
Code:
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Issued order) Equal to (Order(move))
Actions
Trigger - Disable Trigger XX / XX is the trigger with the Order - with no target event
Unit - Order (Ordered unit) to Stop
Trigger enable Trigger XX

would be a way
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
The solution didnt work. both on right click on ground and issue-ing the move order.

details:

I attached a "game-auto-text timed" to see if the trigger works, and it works.

*if i issue the units to stop, the auto text got shown also\trigger runs also
*units doesnt stop when i used the move order or right click ground.

*I did set up the condition (Issued order) Equal to (Order(move))


any more solution to this problem?
thanks for the effort.
 

darkbeer

Beer is Good!
Reaction score
84
sure you disabled the right trigger??

you need to disable the one which is executed when your unit gets the stop order,
--> the trigger with the [Unit is issued an order with no target] event

show that trigger as well please, the one above shouldnt give any problems alone
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
Triggers:
TRIGGER #1

Horizontal Defender 1
Events
Unit - A unit Is issued an order with no target
Conditions
And - All (Conditions) are true
Conditions
((Owner of (Ordered unit)) Equal to Player 1 (Red)) or ((Owner of (Ordered unit)) Equal to Player 6 (Orange))
(1st Horizontal Defender <gen> contains (Ordered unit)) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Issued order) Equal to (Order(holdposition))
Then - Actions
Set Target_Dest[(Player number of (Owner of (Ordered unit)))] = (Position of (Ordered unit))
Set TempX[(Player number of (Owner of (Ordered unit)))] = (X of Target_Dest[(Player number of (Owner of (Ordered unit)))])
Set TempX[(Player number of (Owner of (Ordered unit)))] = (TempX[(Player number of (Owner of (Ordered unit)))] + Move_Distance)
If (TempX[(Player number of (Owner of (Ordered unit)))] Greater than (Max X of 1st Horizontal Defender <gen>)) then do (Set TempX[(Player number of (Owner of (Ordered unit)))] = (Max X of 1st Horizontal Defender <gen>)) else do (Do nothing)
Set Target_Dest[(Player number of (Owner of (Ordered unit)))] = (Point(TempX[(Player number of (Owner of (Ordered unit)))], (Center Y of 1st Horizontal Defender <gen>)))
Unit - Make (Ordered unit) face Target_Dest[(Player number of (Owner of (Ordered unit)))] over 0.00 seconds
Unit - Order (Ordered unit) to Move To Target_Dest[(Player number of (Owner of (Ordered unit)))]
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Issued order) Equal to (Order(stop))
Then - Actions
Set Target_Dest[(Player number of (Owner of (Ordered unit)))] = (Position of (Ordered unit))
Set TempX[(Player number of (Owner of (Ordered unit)))] = (X of Target_Dest[(Player number of (Owner of (Ordered unit)))])
Set TempX[(Player number of (Owner of (Ordered unit)))] = (TempX[(Player number of (Owner of (Ordered unit)))] - Move_Distance)
If (TempX[(Player number of (Owner of (Ordered unit)))] Less than (Min X of 1st Horizontal Defender <gen>)) then do (Set TempX[(Player number of (Owner of (Ordered unit)))] = (Min X of 1st Horizontal Defender <gen>)) else do (Do nothing)
Set Target_Dest[(Player number of (Owner of (Ordered unit)))] = (Point(TempX[(Player number of (Owner of (Ordered unit)))], (Center Y of 1st Horizontal Defender <gen>)))
Unit - Make (Ordered unit) face Target_Dest[(Player number of (Owner of (Ordered unit)))] over 0.00 seconds
Unit - Order (Ordered unit) to Move To Target_Dest[(Player number of (Owner of (Ordered unit)))]
Else - Actions
Do nothing


TRIGGER #2

Trigger OFF
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Issued order) Equal to (Order(move))
Actions
Game - Display to (All players) the text: Testing
Trigger - Turn off Horizontal Defender 1 <gen>
Unit - Order (Ordered unit) to Stop
Trigger - Turn on Horizontal Defender 1 <gen>



Those are the Triggers.

the variables are.

Move_Distance = REAL = 192
Target_Dest = Point Array(10) = None
TempX = Real Array(10) = None
 

Alphabet

New Member
Reaction score
12
To make the unit stop, pause it, then order it to stop and then unpause it. For some reason it doesn't work to just order it to stop.

And in case you'd like also to disable the right-click move, make the conditions like this:
Code:
Conditions
    Or - Any (Conditions) are true
        Conditions
            (Issued order) Equal to (Order(move))
            (Issued order) Equal to (Order(smart))
However, as far as I know, this won't disable moving through ordering the unit to attack (a unit or a point) nor ordering the unit to patrol. In case you need to disable them also, add orders attack and patrol to the conditions and the event 'Unit is issued an order targeting an object' (which is also required for disabling movement targeting units).
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
Is that so.....bummer.


Again, Thanks for the Replies. I really appreciate it.

problems: answered.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
It causes an infinite loop.
Because the event fires when a unit is issued an order.
And in the trigger you are giving a unit an order.

Do you see what is going on?

EDIT: Sorry didn't read the triggers properly xD
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top