For people who have done some programming in AGI, they would have noticed the lack of arrays. I've been thinking of some reasons why arrays would be useful, like mazes or maybe the position of items on the screen.
I've come up with one way for making an array in logic code.. It's readonly but you could store a lot of information in it. Basically, you set up a comma separated excel file full of data like this:
1, 10, 50
2, 30, 100
where the first digit is the index, or the number that identifies the item.
secondarly, you setup another file, a sort of template file like this:
index
var1 = %d;
var2 = %d;
when you run this converter I'm working on.. you'll get this as output:
// item #1
if (index == 1)
{
var1 = 10;
var2 = 50;
return();
}
// item #2
if (index == 2)
{
var1 = 30;
var2 = 100;
return();
}
// remove this error message if you don't want to handle it
print("ERROR! Data not found!");
return();
Now, I haven't finished any maze code yet.. but I'm going to start working on another program that will create maze data (ie, rooms that connect to each other in a random way.. but still solvable as a maze).. The way it compares the index is pretty simple/slow at the moment too.. but I was thinking about using a pseudo binary search as a secondary option.
Then people could add a maze into their game without having to generate a different logic file for each room.. just a few random pics for each room.
I hope that description made sense.. The reason why I posted was to ask other people what they thought... Any ideas on what to add?
- Nick