Mmmkay. I have a problem.
My game is in a playable state and I am at the point where I would like to add multiple stages. I wrote the code to read a data table to load a map. I was shortsighted and didn't test to see if the method I had in mind would work. Now I am unsure how to proceed.
I have a variable "stage" and thought I might be able to load each stage like this:
if stage<>0 then goto skipStage0
0, 16, 22, 12, 5, 4, 44,
36, 42, 12, 20, 13, 8, 0,
if stage<>1 then goto skipStage1
40, 0, 46, 8, 17, 20, 40,
4, 20, 28, 1, 33, 4, 4,
Then I have six events that change variables based on the data. ie.
temp2=stageData : temp3=temp2/7 : temp4=temp3*7 : temp5=temp2-temp4
xPos=26+temp5*16 : yPos=24+temp3*32
player0x=xPos : player0y=yPos
(It's not especially necessary to understand what the code above is for... I just posted it to illustrate how the data is being used and why I wouldn't have to duplicate the events for each data set.)
However, as more advanced bB users probably saw straight away, you cannot have multiple arrays with the same name - even if you skip the events that load each array. I was shortsighted and didn't think this was going to be a problem while developing the rest of the game. D'oh!
So, I am wondering if anyone has a solution to load a data set based on a variable... and use that data set in a bunch of events without having to duplicate the event code for each data set?
I hope this makes sense.
I did some calculations (and they are probably wrong) by commenting out stage data and load event code. If I could load an array similar to the way I thought i could, I might be able to get around 50 different maps. If I have to duplicate the events per map, I might get 8.
Edited by The Maxx, Sun Feb 19, 2017 8:00 AM.