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.
  • 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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top