Okay so I haven't coded anything in a while and I'm going after the skeleton I had of a grid system for rooms. Trying to make things run better and make more sense, be more self-sufficient sort of.
A piece of syntax I'm wondering about is the old...
for <i; 1; %thisnumber%>
Is it possible to have two instances of that running in the same uh, "process". Let me explain better, ok, if a room has a layout of a grid, x and y, 10 by 10, and I wanted to visually represent this grid on the screen, sure I could just have quest get the x and y size of the room and print out a 10 box by 10 box little grid, that's easy enough. Now suppose we want to check each object in the room's properties to see if and what section of this grid it occupies, of course you can do a "for each object" type deal but it seems a little inefficient checking for each number of the grid. What I'm wondering is if a piece of syntax could look like this would work...
for <x; 1; $objectproperty(#quest.currentroom#; x)$> AND for <y; 1; $objectproperty(#quest.currentroom#; y)$> // maybe the and isn't necessary, perhaps just setting the variables to be anything on those scales is enough
It seems like in some form it could work, Alex probably has it set up where the "for" only sets the variable as a "sliding" one and they can be combined, I just haven't tried it and wanted to shoot it by some people.
Another problem, though it seems easy enough, would be controlling view of objects through the direction they are facing. This seems easy to control via a scope type property on players, giving a virtual uh, peripheral vision. That seems easy to implement by only having the x and y co-ordinates of the map be positive numbers and in more sense a chart than a grid and processing only a cone type shape of the grid in that direction... ie:
* pov
1,1 1,2 1,3 1,4 1,5 1,6 1,7 1,8 1,9 1,10
2,1 2,2 2,3 2,4 2,5 2,6 2,7 2,8 2,9 2,10
3,1 3,2 3,3 3,4 3,5 3,6 3,7 3,8 3,9 3,10
4,1 4,2 4,3 4,4 4,5 4,6 4,7 4,8 4,9 4,10
5,1 5,1 5,3 5,4 5,5 5,6 5,7 5,8 5,9 5,10
6,1 6,2 6,3 6,4 6,5 6,6 6,7 6,8 6,9 6,10
etc.
If they are standing on 1,5 facing south, they can see 2,5 3,5 and 4,5 straight in front of them and a broad field of the according *,3 *,4 *,6 and *,7's as well.
So I suppose that seems sort of "easy" enough to do, right? I imagine to make it so quest can cout out the grid for viewing it would probably be best if it operated on some ansii graphic string variables that were preset. That way it tests each object in the room for it's "grid" position, stores those positions in variables with references to the object name, and these objects properties are tested to see if it is a mob, npc, piece of scenery, etc., and finally the grid can begin filling in empty squares get to a variable it knows an object is at, insert the appropriate little "graphic" and continue/repeat as necessary.
Eh, I don't know what this was about, just crap on my mind. As always, questions, comments, ideas, opinions and reaming is all welcome and all is open to interpretation.