• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[JASS] Is there a function that....

Status
Not open for further replies.
pizzatime

  • Construction
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set unitArr[0] = (Constructing structure)
      • Set unitArr[1] = (Triggering unit)
 
Last edited:
Aww... and i though i was clever :(
kk, I'll experiment some with
  • Unit - A unit Is issued an order targeting a point
and then report my findings when I'm done.

That was in GUI but since the thread has a
JASS:
 title.[/QUOTE]
Ooops... sorry, didn't notice :D JASS from now on, got it ;)
 
Try this
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins construction
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Set structure = (Constructing structure)
      • Set constructor = (Ordered unit)
      • Game - Display to (All players) the text: (String((Unit-type of structure)))
      • Game - Display to (All players) the text: (String((Unit-type of constructor)))
 
@Starquizer: [ JASS ] remember?

Findings:
JASS:
function Trig_Building_Actions takes nothing returns nothing
    local string u = UnitId2String(String2UnitIdBJ(OrderId2StringBJ(GetIssuedOrderIdBJ())))

    if u!=null then
        call DisplayTextToForce( GetPlayersAll(), UnitId2StringBJ(GetUnitTypeId(GetTriggerUnit()))+" is building: "+u )
    else
        call DisplayTextToForce( GetPlayersAll(), "other order" )
    endif
endfunction

//===========================================================================
function InitTrig_Building takes nothing returns nothing
    set gg_trg_Building = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Building, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerAddAction( gg_trg_Building, function Trig_Building_Actions )
endfunction
You should be able to find both building unit and unit being built using this :)
 
Last edited:
Thanks guys!

Try this

Untitled Trigger 001

Events

Unit - A unit Begins construction
Unit - A unit Is issued an order targeting a point

Conditions
Actions

Set structure = (Constructing structure)
Set constructor = (Ordered unit)
Game - Display to (All players) the text: (String((Unit-type of structure)))
Game - Display to (All players) the text: (String((Unit-type of constructor)))

Since it was your idea....
Did I ever tell you that you're epic?? I mean you helped me with my missle system and now this! Thanks :D
 
You're welcome.

But don't forget to add a condition to check the issued order, but I don't know the build order string so that the trigger don't fire every time an order other than building is issued.

My script checks if the order is a unit type, which usually means structure :)
Otherwise you would have to go through every structure the unit can build.
 
Status
Not open for further replies.
Back
Top