• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Can there be deleted PATROL COMMAND? {can the Patrol command be deleted?}

Status
Not open for further replies.
Level 7
Joined
May 6, 2008
Messages
284
ohhh my goDDD this is pwning tutorial and it works 100% easy no need to think what to do :D to do this i would give that guy +rep but his not in hiwe :( so i will give you this +rep for finding this thanks man
 
Level 9
Joined
Jul 3, 2008
Messages
495
Won't work if you use attack(move) on a destructable obejct

EDIT

Now I have retriggered the system, so it only use one trigger now + its possible to attack destructable with the command "Attack(move)".

Event:
JASS:
call TriggerRegisterAnyUnitEventBJ( gg_trg_YOURTRIGGER, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_YOURTRIGGER, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
Action:
JASS:
    local unit         u1 = GetTriggerUnit()
    local unit         u2 = GetOrderTargetUnit()
    local integer      i = GetIssuedOrderId()
    local location     l = GetOrderPointLoc()
    local destructable d = GetOrderTargetDestructable()
    
    if i == 851986 then
        if u2 != null then                                  
            call IssueTargetOrder(u1,"attack",u2)               // Attack Unit
        elseif d != null then                               
             call IssueTargetDestructableOrder(u1,"attack",d)   // Attack Destructable
        elseif l != null then                               
            call IssuePointOrderLoc(u1,"attack",l)              // Attack Move To
        endif
    endif
    
    if i == 851990 then                                         // Move
        call IssuePointOrderLoc(u1,"smart",l)
    endif
    
    call RemoveLocation(l)
    set u1 = null
    set u2 = null
    set d = null
    set l = null

Or just test the attached map ;)
 

Attachments

  • RemovePatrol-Retriggered.w3x
    18.3 KB · Views: 117
Last edited:
Level 9
Joined
Apr 5, 2008
Messages
529
Great job, =]

However, when you target a widget the script tries to remove a null location, which results in a thread crash, meaning the handles won't be nullified. Here's a fixed version which also replaces the unnecessary BJ.


JASS:
function Trig_CommandSystem_Actions takes nothing returns nothing
    local unit         u1 = GetTriggerUnit()
    local unit         u2 = GetOrderTargetUnit()
    local integer      i = GetIssuedOrderId()
    local location     l = GetOrderPointLoc()
    local destructable d = GetOrderTargetDestructable()
    
    if i == 851986 then
        if u2 != null then                                  
            call IssueTargetOrder(u1,"attack",u2)               // Attack Unit
        elseif d != null then                               
             call IssueTargetOrder( u1, "attack", d )           // Attack Destructable
        elseif l != null then                               
            call IssuePointOrderLoc(u1,"attack",l)              // Attack Move To
            call RemoveLocation(l)
        endif
    endif
    
    if i == 851990 then                                         // Move
        call IssuePointOrderLoc(u1,"smart",l)
        call RemoveLocation(l)
    endif
    
    set u1 = null
    set u2 = null
    set d = null
    set l = null
endfunction

//===========================================================================
function InitTrig_CommandSystem takes nothing returns nothing
    set gg_trg_CommandSystem = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_CommandSystem, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_CommandSystem, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerAddAction( gg_trg_CommandSystem, function Trig_CommandSystem_Actions )
endfunction
 
Level 9
Joined
Jul 3, 2008
Messages
495
It's very simpel. You hide the attack icon with object editor. There is something called "Combat 1 - Show UI" set that to false. Then you import two .txt documents, that change the position and description for patrol and move.

Now you just need to trigger move to act like attack, and patrol to act like move. Download map, and see.
 
Level 7
Joined
May 6, 2008
Messages
284
Great job, =]

However, when you target a widget the script tries to remove a null location, which results in a thread crash, meaning the handles won't be nullified. Here's a fixed version which also replaces the unnecessary BJ.


JASS:
function Trig_CommandSystem_Actions takes nothing returns nothing
    local unit         u1 = GetTriggerUnit()
    local unit         u2 = GetOrderTargetUnit()
    local integer      i = GetIssuedOrderId()
    local location     l = GetOrderPointLoc()
    local destructable d = GetOrderTargetDestructable()
    
    if i == 851986 then
        if u2 != null then                                  
            call IssueTargetOrder(u1,"attack",u2)               // Attack Unit
        elseif d != null then                               
             call IssueTargetOrder( u1, "attack", d )           // Attack Destructable
        elseif l != null then                               
            call IssuePointOrderLoc(u1,"attack",l)              // Attack Move To
            call RemoveLocation(l)
        endif
    endif
    
    if i == 851990 then                                         // Move
        call IssuePointOrderLoc(u1,"smart",l)
        call RemoveLocation(l)
    endif
    
    set u1 = null
    set u2 = null
    set d = null
    set l = null
endfunction

//===========================================================================
function InitTrig_CommandSystem takes nothing returns nothing
    set gg_trg_CommandSystem = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_CommandSystem, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_CommandSystem, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerAddAction( gg_trg_CommandSystem, function Trig_CommandSystem_Actions )
endfunction


CAN i have this on map?
 
Status
Not open for further replies.
Top