clearing item variable? possible?

Inflicted

Currently inactive
Reaction score
63
yes but for some reason i cant seem to set global item variable arrays?

hmm, i'l try again and tell you the result.

---

EDIT: okay i tested it and seem to be having a problem.

im using this line, imported into GUI:

Code:
set udg_BuyerItemHeld[GetConvertedPlayerId(udg_Temp_Player)] = null

i get error:

Type mismatch in assignment.

My variables are:
udg_BuyerItemHeld[] - global item type array[12]
udg_Temp_Player - global unit variable

i presume the error means i have the wrong type, but im unsure what i'm doing wrong cos my Jass isnt good.

im trying to set set udg_BuyerItemHeld with the array number of the number of the temp player.

anyone know what i'v done wrong?
 

KJP

New Member
Reaction score
5
try

JASS:
set udg_BuyerItemHeld[GetConvertedPlayerId(udg_Temp_Player)] = GetItemTypeID(null)
.

Had to make a trigger in gui and convert it to jass to get the end bit for you, but not sure on what your dooing with the index so thought id leave it
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
you said udg_temp_player is a unit variable? was that a typo? if not thats your problem because a player should be a player variable...

you dont have to set the array size for item arrays also because it wouldnt make a difference.

you actually dont have to set item variables to null also, in case you think it would leak.

and you can null them with simple GUI as well cause there is an option to set the variable to "no item".
 

Cheddar

This is the way it was meant to be.
Reaction score
126
Create new item, set it to new item, remove new item?
 

Inflicted

Currently inactive
Reaction score
63
you said udg_temp_player is a unit variable? was that a typo? if not thats your problem because a player should be a player variable...

yes, my mistake, it is a player variable.

Create new item, set it to new item, remove new item?

does not suit what i am trying to do with it, i need it to be empty.
Its item-type, not item aswel.

okay KJP, i will try that. ty
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
you said udg_temp_player is a unit variable? was that a typo? if not thats your problem because a player should be a player variable...

you dont have to set the array size for item arrays also because it wouldnt make a difference.

you actually dont have to set item variables to null also, in case you think it would leak.

and you can null them with simple GUI as well cause there is an option to set the variable to "no item".

i hate to quote myself.

this:
Trigger:
  • Set ItemVariableThingy = No Item


will be this in Jass:
JASS:
set udg_ItemVariableThingy = null
 
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