Jass Global Variables? I Think?

Squeekems

TH.net Regular
Reaction score
11
How do I refer to "[ljass]((Player number of (Owner of (Triggering unit))[/ljass]" in jass? I came to the last line in this trigger, and realized I have no idea how to refer to it. Plus rep for this quick tip. <(o_- )>
Trigger:
  • Barracks
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
    • Actions
      • Set TempGroup[((Player number of (Owner of (Triggering unit))) - 1)] = (Units owned by (Owner of (Triggering unit)) of type Barracks)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BarracksMax[((Player number of (Owner of (Triggering unit))) - 1)] Greater than or equal to (Number of units in TempGroup[((Player number of (Owner of (Triggering unit))) - 1)])
        • Then - Actions
          • Set TempGroup[((Player number of (Owner of (Triggering unit))) - 1)] = (Units owned by (Owner of (Triggering unit)) of type WorkerType[((Player number of (Owner of (Triggering unit))) - 1)])
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup[0])
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Ctrl+Z does the trick if you only intend to look at the converted code.
 

Cetacean

New Member
Reaction score
2
GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))

I had to look this up myself just yesterday. :)
 

Inflicted

Currently inactive
Reaction score
63
Also, make sure you copy the trigger first before converting it, once converted they cannot be converted back into GUI.

Ctrl+Z does the trick if you only intend to look at the converted code.

The simplest solutions are often the best [noparse]:p[/noparse]

Lol, yeah I also commonly revert it back with just the Undo Function.

Also, I don't think that triggering unit is Global. It's not really accessible outside of the Trigger.
Most cases, variables are exactly the same in GUI as in Jass.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
It's definitely not global, but it's an obvious local that exists for most triggers.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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