Removing array variables?

Baltazhar

Active Member
Reaction score
55
Okay, first off.. I'm a utter newb when it comes to Jass. The only stuff I know are the leak-fixing scripts from various tutorials.

Anyway, I had a question concerning this. I know the basic RemoveLocation and DestroyGroup... But what if I wanted to remove a region with an array?

Would it be: "call RemoveRect (udg_My_Variable 1)"?
To be specific I have a a Region variable with an array of 10, one of each of the human players. I need the call to get the (Playernumber of (owner of (dying unit))). Dying unit can be replaced with triggering unit ofc, just like to be precise :)

Rep for the solution! My kingdom for a horse! ... Well.. thx in advance :)

EDIT: I'm not sure if I might be a bit impatient, but I'll try to clarify it further.

I made a trigger with Special Effects, since it's one of the only Variable GUI options. I need the same function, just with Region removal :)
Code:
Special Effect - Destroy My_Effect[(Player number of (Owner of (Dying unit)))]

Okay, think I actually managed to figure it out on my own. Took an hour of looking through random pieces of code to figure out the pattern of the different characters in the code, but I think I did it.
At least the compiler likes it, so that's a small bonus :D

JASS:
call RemoveRect (udg_DeathMarchRegion[GetPlayerId(GetOwningPlayer(GetDyingUnit()))])

Is this "Remove Region - DeathMarchRegion[Playernumber of (owner of (dying unit))]" ?
 

Cohadar

master of fugue
Reaction score
209
Playernumber of (owner of (dying unit)) in GUI
is actually GetPlayerId(GetOwningPlayer(GetDyingUnit())) +1 in JASS

Notice the +1 thingy...

Players in GUI start from 1
In jass Player(0) is red.
 

Baltazhar

Active Member
Reaction score
55
Ah, didn't know that... So i'd have to change that to a +1, to delete the right integer value of the array.
Thx a lot :) +rep
 
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