Page 1 of 1

Script: Reference Level Number Directly Below?

Posted: Wed Oct 29, 2014 8:05 pm
by Lark
Level numbers reference the order that the levels are in the "Project" stack and not their physical relationship with each other anymore. When scripting, I like having the script do as much setup as possible (on multiple levels at times) so I can duplicate it and move it around as needed. The addition of "void" tiles makes this even easier. However, if I want to reference a location directly below the current level, I'm stuck. It used to be self.level + 1, but now that could be a level to the side or basically anywhere...

Does anyone know how a script can reference a spot directly below something on a given level?

Re: Script: Reference Level Number Directly Below?

Posted: Thu Oct 30, 2014 12:31 am
by Batty
I just tried some of the new methods and I can't get it. Only thing I can say is organize your project stack so that when you do "level + 1" you get the correct level.

Re: Script: Reference Level Number Directly Below?

Posted: Thu Oct 30, 2014 1:14 am
by MrChoke
This is a major thing I am struggling with too. We need access to these levels as objects in the scripts. I wish AH would give us some more modding info. SIgh.

Re: Script: Reference Level Number Directly Below?

Posted: Fri Oct 31, 2014 10:17 pm
by Lark
I'd hoped to find a solution once the Scripting Reference was out, but I've not found anything yet. A way to iterate over all the maps to check their coordinates or to check for the existence of a map with given set of coordinates and, of course, returning the level number, would be most welcome. Anyone found a map:getCoordinates(level) or similar method anywhere? For now, I'll just drop an anchor below the primary script - that should get me by for now but I'd hoped for a more elegant approach. Cheers, -Lark

Re: Script: Reference Level Number Directly Below?

Posted: Fri Oct 31, 2014 10:23 pm
by NutJob
For interim I've just been putting a dummy_light (something I'll never use, basically) on all levels (at 0,0) and calling these to stack functions on.