ID:139293
 
Code:
mob
var
move = 5
nu[] = /obj/


mob
verb
move()
world << "move: [usr.move]"

var/n = 0
while(n<move)
nu[n] = new /obj/clt(loc = locate(x+n,y,z))
n++
//summon "tiles" in the amount of the users move ability, attempted to assign them to array, get an error at run time.


Problem description: I'm trying to create a click-movement system where the available tiles which a character can move are visually displayed, but I can't figure out how to store the displayed tiles so i can later delete them. Trying to do this in an array

There are no arrays, per se, only lists. So, you would just do:

for(var/n = 0, n < move; ++n)
nu += new /obj/clt(etc)
In response to Garthor
Garthor wrote:
There are no arrays, per se, only lists. So, you would just do:

for(var/n = 0, n < move; ++n)
> nu += new /obj/clt(etc)


Ok but when i try to DELETE nu, it only deletes the last nu created because the ones before it are no longer stored because as new nu's are created it replaces the old one so im not sure how to keep track of them so i can delete them without all of them being stored in one variable (an array)
In response to Lilcloudy1
Whoops, I missed that you didn't initialize the list properly. It should be nu = list().