• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Problem with issuing orders

Status
Not open for further replies.
Level 4
Joined
Jan 5, 2014
Messages
79
Hello, I use this trigger to store an order:
  • Order Adding Point
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Hashtable - Save (String((Issued order))) as IssuedOrder of (Key (Ordered unit)) in KnockbackedUnits
      • Hashtable - Save Handle Of(Point((X of (Target point of issued order)), (Y of (Target point of issued order)))) as TargetPointOrdered of (Key (Ordered unit)) in KnockbackedUnits
      • Hashtable - Save point as TypeOfOrder of (Key (Ordered unit)) in KnockbackedUnits
and this command to issue it in another trigger

  • Custom script: call IssuePointOrderLocBJ( GetEnumUnit(), "LoadStr(udg_IssuedOrder, GetHandleId(GetEnumUnit()), udg_KnockbackedUnits)", LoadLocationHandleBJ(udg_TargetPointOrdered, GetHandleId(GetEnumUnit()), udg_KnockbackedUnits) )
there is a problem somewhere coz it doesnt work and i dont know where
i have never used jass before so i think the problem is in the custom script part, tahnk u for help
 
Following is in JASS, but you just can put all in custom scripts.

I save OrderId instead of OrderString into hashtable. (integer instead of string)

parentKey = GetHandleId(unit)

childKey
= 0

After unit gets order the next two lines are for removing location leak.


save
JASS:
set udg_Id = GetHandleId(GetTriggerUnit())
call SaveInteger(udg_KnockbackedUnits, udg_Id, 0, GetIssuedOrderId())
call SaveLocationHandle(udg_KnockbackedUnits, udg_Id, 0, GetOrderPointLoc())
load
JASS:
//Pick Every Unit and do Actions:
    set udg_u = GetEnumUnit()
    set udg_Id = GetHandleId(udg_u)
    set udg_loc = LoadLocationHandle(udg_KnockbackedUnits, udg_Id, 0)
    call IssueInstantPointOrderById(udg_u, LoadInteger(udg_KnockbackedUnits, udg_Id, 0), GetLocationX(udg_loc), GetLocationY(udg_loc), null)
    call RemoveLocation(udg_loc)
    set udg_loc = null

Variabled needed: Id = Integer | loc = location (point) | u = Unit
 
Status
Not open for further replies.
Top