• 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.

[Trigger] Leaks in Arrays.

Status
Not open for further replies.
Level 20
Joined
Apr 22, 2007
Messages
1,960
Brackets delimit an array's index. Huurka got his syntax wrong too...

Here... let's say you want to remove a location at index 0:
  • Custom script: call RemoveLocation(TempPoint[0])
If you want to remove a location at the triggering player's index:
  • Custom script: call RemoveLocation(TempPoint[GetPlayerId(GetTriggerPlayer()) + 1])
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
If you want to remove every location in the array:

  • Use a loop


P.s. Just messing with you ;)
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Oh right one thing though... Since he asks for Gui...

It has to be udg_ as a prefix, before the actual name. I guess you already know, but to be 100% sure : )
  • Custom script - call RemoveLocation( udg_TempPoint[index] )
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
A little bit of more details please.
What kind of array do you have?
What exactly do you want the array to be after you "remove the player" ?
 
Level 24
Joined
May 9, 2007
Messages
3,563
I just want to remove the leaks.

It is a location array with 12 . . . things (can't think).

  • Set TempPoint[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
I would prefer not to do a 12 action loop every time I use a array like this, as I have 4 in my map.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
  • Custom script - call RemoveLocation( udg_TempPoint[(Player number of (Owner of (Triggering unit)))])
You made it sound strange
P.s. removing all the points in the array would cause bugs with MUI.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
:D
HINDYhat, I am talking about the crap I posted.
P.s Multitasking is bad for concentration.
 
Status
Not open for further replies.
Top