I am not talking about the examples I've seen where player inputs text and then the text changes a value. On those the values are always known. I am talking about the ability to auto select ArrayX and ArrayY values based off of in-game actions. Like a player placing a building on random objects(tiles) that are already mapped to an array.
I am aware I will have to implement a 3d Array. I am not 100% sure how that works. From my understanding (X0,Y0,Z0) has one value and then (X0,Y0,Z1) would just be second piece of information for (X0,Y0)? Do new Z layers "stack" above or below the current existing layers? When using a 3d Array can I add a new Z layer on an existing Array without effecting it's existing values and more important messing up code? I am thinking I can but want to be sure before I end up messing something up and not realizing until it is to late.
I currently have a single layer array that remembers the objects on a layer(Similar to Tiles). If a newly placed Building is covering 4 objects(Tiles) how do I collect the corresponding ArrayX, ArrayY coordinates so I can change the correct ArrayZ value? I want it so the Map loads the same way if the game is saved and reloaded.
I know I may have to have a building only take up one Tile upon placement and then mathematically change the other effected ArrayX, ArrayY and ArrayZ values with an event. There is also a chance I may be able to implement an overlapping event. The only issue is not knowing how to get effected ArrayX and ArrayY values.
A few more question. Is it possible to only use one Array for every level/map? Just on start of layer have it load the corresponding JSON file and auto adjust accordingly? From my understandings a JSON file is a readable string of text that Arrays can read and translate.... [X0,Y0,Z0][X0,Y1,Z0][X0,Y2,Z0].. etc. I assume all I would need is a Global Variable that changes on startup and to adjust it's size as well. Correct? Do JSON files work on all devices, P.C., mobile devices, consoles etc? The game generates a file and then the device handles it? If a device is not supported what happens?
Capx for this project is nearly empty and can be redone easily. I don't mind if the set-up for this is a small bit tedious. I am more about performance and ease of workflow after it is set-up. Plus once it is set up the chances are small that it will have to set it up again, possibly just a number change here and there.
I have read a lot already, these are just questions I haven't caught the answers to. I know this is a lot for one post and it may be all over the place. Sorry about the length of the post, the width is average.
I will be away for a while.
Thanks in advance.