Make units ignore commands

V

vaond

Guest
1. How to make player controlled units ignore commands such as attack/move etc? Units are spawned and set to walk somewhere, but i dont want players to be able to mess with their movements. Also the units must stay under player's control,player's must be able to select them.

2. How to make building automaticly produce units? Also must stay as a player controlled building.

Regards~
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
uhm you want a player to have control of a unit but can't issue any orders? :nuts:
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
Code:
strange trigger
    Events
        Unit - A unit Is issued an order targeting an object
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        Unit - Order (Triggering unit) to Move To (where ever you want))

so this trigger keeps ordering the unit to do what they are supposed to do, ignoring player's commands... if that's what you want
 

saw792

Is known to say things. That is all.
Reaction score
280
I think giving the unit the ward classification will remove the ability to command the unit.
 
V

vaond

Guest
Actually Castle Fight for example has that.

Unit spawns, has attack move to point, ignoring all player issued orders.

That would be what i am after.
 

Diamondeye

New Member
Reaction score
10
@Spawning:
Every (time between Spawns) Seconds, do
Pick every unit of unit-type (Spawning Grounds) and do
Create 1 Spawned Creep for (Owner of picked unit) facing (Random angle)
And
Order (last created unit) to attack move to (center of (whereever units go))​
 
V

vaond

Guest
Yeah thanks got the unit spawning to work, now only to get them ignore player commands.
 

darkbeer

Beer is Good!
Reaction score
84
Code:
strange trigger
    Events
        Unit - A unit Is issued an order targeting an object
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        Unit - Order (Triggering unit) to Move To (where ever you want))

you sure aobut this, im very sure this will crash, due to an infinite loop.

better:
Code:
    Events
        Unit - A unit Is issued an order targeting an object
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        Trigger - Turn off (This Trigger)
        Unit - Order (Triggering unit) to Move To (where ever you want))
        Trigger - Turn on (This Trigger)
 

Dangime

New Member
Reaction score
1
I'd like to know too.

The question posed in this thread is also what I want to know so I am going to bump it.

I would like to have units that belong to the player, but generally ignore commands issued by the player and proceed with trigger based commands only.

For example, note the behavior of castle fight's units. When I made civilization wars I had to use a dummy computer controled player control the spawned units, but would like to avoid having to do this in a new project.

If you know the method used please respond.
 
V

vaond

Guest
What darkbeer posted works for me for now, thanks. You are still able to move units with mouse, which results units basicly staying still if you click spam.

Doesnt matter for me but im still looking for better option ( incase i need it later).
 

Genyuumaru

New Member
Reaction score
15
I would like to know this too.

Reviving the thread (I don't want to use that trigger, it's bad :D).
 

darkbeer

Beer is Good!
Reaction score
84
im not sure thought but i believe in castle fight, as you already know units have the ward clasification and guess the use a periodic timer to move the units:

sth. like this:
Code:
Events- Time Periodic event every 0.03 seconds
Actions - 
   set TempGroup = Units in (Playable map area)
   Unitgroup - Pick units in TempGroup and do actions
        Loop - Actions
            Unit - Issue (Picked unit) to move to TARGET
   CustomScript: call DestroyGroup(TempGroup)

TARGET has to be set at map Initor sth.

dont now if it works,but you can try it out
 

Light Alkmst

New Member
Reaction score
20
Here is what I believe:
You should create the units for the player, and give them whatever order.
Immediately afterwards, pause them. They'll continue their order, and not take any more. The player will still control them, but no buttons will show in the UI. If want them to take further orders from other triggers, have them unpause the unit at the beginning, and pause them again after issuing the new order.
In short, this:

Trigger 1
Create unit
Issue order
Pause unit

Trigger 2
Unpause unit
Issue order
Pause unit
 

Strilanc

Veteran Scripter
Reaction score
42
You need to give them ward classification, and know what their order should be.

When the player issues an order it will always be the "smart" order because they can only use the mouse, so you simply re-order the unit whenever it gets a "smart" order.
 
V

vaond

Guest
Code:
    Events
        Unit - A unit Is issued an order targeting an object
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        Trigger - Turn off (This Trigger)
        Unit - Order (Triggering unit) to Move To (where ever you want))
        Trigger - Turn on (This Trigger)

Aha first problem with this trigger: I want my units to have autocast spells, but now they wont cast them (They try to cast spell but get instantly ordered to move to the location). Any ideas how to make that work? Been fighting with this quite a while now, could be that im just missing something simple.
 
S

Sergej101

Guest
You coudl try removing the issued to a point , make another triger using that to check if unit is casting a spell whit an if.

Dont have time to type it in World editor sadly , so try it , and if nobody wrote it till tomorow ill write a full one

Good luck
 

Leazy

You can change this now in User CP.
Reaction score
50
Code:
    Events
        Unit - A unit Is issued an order targeting an object
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        Trigger - Turn off (This Trigger)
        Unit - Order (Triggering unit) to Move To (where ever you want))
        Trigger - Turn on (This Trigger)

Aha first problem with this trigger: I want my units to have autocast spells, but now they wont cast them (They try to cast spell but get instantly ordered to move to the location). Any ideas how to make that work? Been fighting with this quite a while now, could be that im just missing something simple.

You could just add conditions, like:

Code:
Anti Control System
    Events
        Unit - A unit Is issued an order targeting an object
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order with no target
    Conditions
        (String((Issued order))) Not equal to innefire
        (String((Issued order))) Not equal to heal
        (String((Issued order))) Not equal to invisibility
        (Etc, you get the picture :))
    Actions
        Trigger - Turn off (This trigger)
        Unit - Order (Triggering unit) to Attack-Move To (Center of (Playable map area)) (Or wherever you want)
        Trigger - Turn on (This trigger)

Also, unless you want the owner of the unit to be able to cast the spells on his own, add ward to your units.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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 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