Short custom script question

Mahrloc

New Member
Reaction score
5
i want to refer to a "picked unit" in a custom script... everything i've got till now is:
JASS:
Custom script:   call RemoveLocation(udg_Loc[GetPlayerIndex(GetUnit(???))])

what do i have to use?
 

X-maul

AKA: Demtrod
Reaction score
201
i want to refer to a "picked unit" in a custom script... everything i've got till now is:
JASS:
Custom script:   call RemoveLocation(udg_Loc[GetPlayerIndex(GetUnit(???))])

what do i have to use?

what i normally do when I cant find such things is:
to have a varible with picked unit
Code:
Set TempPoint[Player number of(Owner of Picked unit)] = Center of [COLOR="Blue"][U]REGION[/U][/COLOR]

call RemoveLocation(udg_TempPoint)
then it will give you an error when you save, where it displays this place in JASS and then you can see the JASS version of Picked Unit ;)
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
picked unit in custom script would be GetEnumUnit()
JASS:
call RemoveLocation(udg_Loc[GetPlayerIndex(GetEnumUnit()])

is GetPlayerIndex() a valid native? because it isn't highlighted Oo
can't remember
 

Ashlebede

New Member
Reaction score
43
A small error :
JASS:
call RemoveLocation(udg_Loc[GetPlayerIndex(GetEnumUnit()])

The ()]) at the end
Change it to
JASS:
call RemoveLocation(udg_Loc[GetPlayerIndex(GetEnumUnit())]

JASS:
call RemoveLocation(udg_Loc[GetPlayerIndex(GetEnumUnit())]


Also has a syntax error. The parenthese is missing at the very end.

JASS:
call RemoveLocation(udg_Loc[GetPlayerIndex(GetEnumUnit())])


And, once again, [ljass]GetPlayerIndex()[/ljass] does not exist. It is [ljass]GetPlayerId()[/ljass], and it requires a [ljass]player[/ljass]-type parameter, not a [ljass]unit[/ljass]. See my previous post.

Edit : Just remembered [ljass]GetPlayerId()[/ljass] will return a different value than its GUI version. The code would be :



Notice that [ljass]+1[/ljass]?
 
General chit-chat
Help Users

      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