Unctrollable Unit but stil owned

DiFm

New Member
Reaction score
35
I want a unit that stays the same ownership but the owner cant move or give him any order at all i also need the unit to not be stunned/holded. Anyone got any ideas how to do this?

Thanks in advance
 

Lyle.

New Member
Reaction score
32
Why exactly do you want it to remain under the ownership of the owner?

Otherwise you could set up a system which adds the units into a unit group, gives control away and keeps the team color of the owner. Then you could check if the unit is in the unit group whenever you need to see who owns the unit.
 

simonake

New Member
Reaction score
72
2 method, first one might be what you would prefer.
1. Add the unit the 'Locust' ability.
or
2. Give the unit ward classification.
 

DiFm

New Member
Reaction score
35
first one will still go around auto attacking ppl. It will still go around autoattacking people. how do the second method work? can the unit still walk and the unit gets attacked by units?
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You need to make it a ward so the only possible order is Smart
Then make a trigger that will make the unit stop (or attack-move, like in castle fight if that what you want) when ordered "smart"
 

DiFm

New Member
Reaction score
35
Well the problem is i want the unit to follow another units orders. whatever he is ordered the other unit does. so if he is in the middle of walk to a spot and he uses smart he stops and ends the current order he had.
 

komapatient

New Member
Reaction score
10
2 method, first one might be what you would prefer.
1. Add the unit the 'Locust' ability.
or
2. Give the unit ward classification.

I just tried this via "Add Ability" but I couldn't select Locust... How would I do that?!

This is an interesting question - I was asking this myself because I once wanted to add an ability to units to auto run home ignoring all targets and being unaware to orders until it reaches 'home'. So I guess I will give ward classification a try when I have some time!

Offtopic:
Simonake..... your Icon sucks.. Team Rocket is so much more win then Ash ;D
 

DiFm

New Member
Reaction score
35
WHy doesnt it work to do like this?

Make PLayer Blue treat player neutral hostile as an ally with shared vision?
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Then just use my method and make both units stop when the uncontrollable one is order "smart"
 

simonake

New Member
Reaction score
72
I just tried this via "Add Ability" but I couldn't select Locust... How would I do that?!

This ability cannot be added by GUI triggers, it's not in the list. You have to use the object editor or jass as this function:
JASS:
call UnitAddAbility( wichunit, 'Aloc')
 

DiFm

New Member
Reaction score
35
a unit is ordered an order.




pause unit
unpause unit


are you saying he will resume the order he was doing be4 the order that triggered the event?
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Try a system that issues an order and stores it whenever you call a custom "issue order" function. Then, create a trigger that detects when a smart order is issued, and re-issue the attached order.

Here's a system I made for you:

JASS:
library OrderLock initializer Init uses PUI

private struct Data
    //! runtextmacro PUI()

    static group g = CreateGroup()
    static trigger t = CreateTrigger()
    
    unit whichUnit
    
    string order
    
    widget wTar
    location lTar
    real xTar
    real yTar
    
    static method clear takes unit which returns nothing
        local Data d = Data[which]
        if d != 0 then
            set d.order = null
            set d.wTar = null
            if d.lTar != null then
                call RemoveLocation(d.lTar)
            endif
            set d.lTar = null
            set d.xTar = 0
            set d.yTar = 0
        endif
    endmethod
    
    static method create takes unit which returns Data
        local Data d = Data[which]
        if d == 0 then
            set d = Data.allocate()
            set Data[which] = d
            set d.xTar = 0
            set d.yTar = 0
        endif
        call GroupAddUnit(Data.g,which)
        return d
    endmethod
endstruct

public function AddUnit takes unit whichUnit returns nothing
    //Unit will not take any orders
    call GroupAddUnit(Data.g,whichUnit)
endfunction

public function ClearUnit takes unit whichUnit returns nothing
    //Unit will allow control again
    call Data.clear(whichUnit)
    call GroupRemoveUnit(Data.g,whichUnit)
endfunction

public function IssuePtOrderLoc takes unit whichUnit, string order, location where returns nothing
    local Data d
    call Data.clear(whichUnit)
    set d = Data.create(whichUnit)
    set d.order = order
    set d.lTar = where
    call IssuePointOrderLoc(whichUnit,order,where)
endfunction

public function IssueImOrder takes unit whichUnit, string order returns nothing
    local Data d
    call Data.clear(whichUnit)
    set d = Data.create(whichUnit)
    set d.order = order
    call IssueImmediateOrder(whichUnit,order)
endfunction    

public function IssuePtOrder takes unit whichUnit, string order, real x, real y returns nothing
    local Data d
    call Data.clear(whichUnit)
    set d = Data.create(whichUnit)
    set d.order = order
    set d.xTar = x
    set d.yTar = y
    call IssuePointOrder(whichUnit,order,x,y)
endfunction

public function IssueTarOrder takes unit whichUnit, string order, widget targetWidget returns nothing
    local Data d
    call Data.clear(whichUnit)
    set d = Data.create(whichUnit)
    set d.order = order
    set d.wTar = targetWidget
    call IssueTargetOrder(whichUnit,order,targetWidget)
endfunction

public function ReIssueOrder takes unit whichUnit returns nothing
    local Data d
    if IsUnitInGroup(whichUnit,Data.g) == false then
        return
    endif
    set d = Data.create(whichUnit)
    call DisableTrigger(Data.t)
    if d.wTar != null then
        call IssueTargetOrder(whichUnit,d.order,d.wTar)
    elseif d.lTar != null then
        call IssuePointOrderLoc(whichUnit,d.order,d.lTar)
    elseif d.xTar != 0 and d.yTar != 0 then
        call IssuePointOrder(whichUnit,d.order,d.xTar,d.yTar)
    elseif d.order != null then
        call IssueImmediateOrder(whichUnit,d.order)
    else
        call IssueImmediateOrder(whichUnit,"stop")
    endif
    call EnableTrigger(Data.t)
endfunction
    
private function Conditions takes nothing returns boolean
    return IsUnitInGroup(GetTriggerUnit(),Data.g) //and OrderId2String(GetIssuedOrderId()) == "smart"
endfunction

private function Actions takes nothing returns nothing
    call ReIssueOrder(GetTriggerUnit())
endfunction

private function Init takes nothing returns nothing
    call TriggerRegisterAnyUnitEventBJ(Data.t,EVENT_PLAYER_UNIT_ISSUED_ORDER)
    call TriggerAddCondition(Data.t,Condition(function Conditions))
    call TriggerAddAction(Data.t,function Actions)
endfunction

endlibrary


Edit: To use the system, simply replace your normal orders with the system's custom functions. For example, if you want a unit to continue attacking a unit, ignoring any other orders, just use the IssueTarOrder function:

JASS:
call OrderLock_IssueTarOrder(whichUnit,"attack",Target_Unit)


Also, if you only want to ignore "smart" orders (lets say you added ward classification to the unit), just uncomment the line in the private Conditions function.
 

simonake

New Member
Reaction score
72
Why couldn't you add it locust ability and set movement speed to 0?

Offtopic:
Simonake..... your Icon sucks.. Team Rocket is so much more win then Ash ;D

Sorry i dont use to watch pokemon sorry. I don't know what you mean.
 

DiFm

New Member
Reaction score
35
Why couldn't you add it locust ability and set movement speed to 0?

Coz i need to set it back to normal after that.


Nice actually for now I would think it was best if it was ward classification and it checked if a unit has buff and is ordered the smart command.

How would that line look and where should it be put?

+rep :)
 

Genkora

Frog blast the vent core!
Reaction score
92
a unit is ordered an order.




pause unit
unpause unit


are you saying he will resume the order he was doing be4 the order that triggered the event?

the unit will carry on with whatever order it had before being paused.
 

simonake

New Member
Reaction score
72
You can change a unit speed with triggers? Add locust and set movement speed to 0 with a trigger like this one.

Trigger:
  • Actions
    • Unit - Set (wichunit) movement speed to 0.00
    • Custom Script: call UnitAddAbility( wichunit, 'aloc')


You must admit that it's simple.
 

komapatient

New Member
Reaction score
10
Why couldn't you add it locust ability and set movement speed to 0?



Sorry i dont use to watch pokemon sorry. I don't know what you mean.

Sorry, It wasn't meant personal... Team Rocket are the super evil counterparts to Ash, the main protagonist to the series.

If you should ever watch the programme (I don't specially recommend it) you will soon know what I mean ;)
 
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