Kurt J. said: Andy said: Is it possible to create a 2D Array in scriptcards? Something to the equivalent of... array = [ [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] ]; I tried some experiments using stingify and array;define;arrayname;[&arrayname0];[&arrayname1];[&arrayname2];[&arrayname3];[&arrayname4];[&arrayname5];[&arrayname6];[&arrayname7];[&arrayname8];[&arrayname9] or creating a for loop to add the arrays into another array, but I was unable to crack it. Is it possible to nest arrays at all or am I just missing something that's in front of my face? As always, thank you Kurt for creating this. It has changed my attitude toward playing games on roll20 in a very positive way. Currently there isn't a way to do this. I have some ideas, but nothing solid to implement yet. I'd like to add the ability to directly reference array members in the same way you can reference rollVariables and stringVariables. That would allow at least a workaround that would behave like 2D arrays. The pontential for this using ScriptCards is huge. The abstract layers you could create for the map alone makes this tool practically essential. IMO. :) TrapArray =[ [0,0,0,0] [0,0,0,0] [0,0,1,0] [0,0,0,0] ] trap = 1 get the coords of a token, if it matches coordinate (2,2) BOOM! That sort of thing. Could be used to trigger any sort of event you could think of...secret doors, atmospheric sounds, initiative rolls, animations, etc. You could even use it to procedurally generate maps if you set the graphics up for it. in the grid size you use 70px X 70px per graph TerrainArray= [ [0,1,0,2,0] [0,0,0,1,0] [0,1,0,0,0] [0,1,0,2,0] [0,1,0,0,0] [0,1,0,0,3] ] grass = 0 tree = 1 bush = 2 water = 3 the implementations are almost endless really... You could switch tokens on or off on the map layer to show distances, movement possibilities, calculate who gets damaged, adjacency for attacks of opportunities, and so on... It doesn't have to be visually pleasing to code. It just needs to be able to nest the arrays and then read from the coordinate points(x,y) Whatever is in the array[array[]] will index will be what is at the coordinate on the map. It could be used to determine difficult terrain. DifficultTerrainArray = [ [4,4,4,4,4] [3,3,3,3,4] [2,2,2,3,4] [1,1,2,3,4] [0,1,2,3,4] ] This would show a steep incline going from southwest to northeast. It could be mud that gets thicker or whatever you wanted. Is there a way to acheive this? BTW- great use of the Bresenham's line algorithm in the lightning bolt example. I'm using it to gauge PC pathing when they move over grid squares to trigger events like traps and such. Keep the awesome examples coming! Nice job, Kurt!