Page 1 of 1

Another script help pls

Posted: Thu Jan 03, 2013 5:08 pm
by Drakkan
not sure how hard it would be, any advice pls ?

I have a room covered with visible plates. Some plates are lit with a steady blue light. The light moves over the rest of the plates following specific patterns. Anytime you are on a plate that's lit, you lose hit points.
Another solution woul be no plates at all, just make movable teleport objects (with changed texture as some kind of light) which will dmg party instead teleporting (if thats possible)

Re: Another script help pls

Posted: Thu Jan 03, 2013 7:16 pm
by Komag
You could have a flag for each square in the room, and when the lights move also set the flags. Then have a fast timer (maybe 0.2s) triggering a damage tile for every square, but won't do the damage for any particular square if that square's flag is set (or not set, whichever way you want), constantly repeating some small damage like 1 or 2

Re: Another script help pls

Posted: Thu Jan 03, 2013 7:25 pm
by aaneton
I would forget about plates only focus on light and damagetiles. If you step into light you take damage.

Create a light object (attached example there is code in objects.lua)

You can use timers to "move" (create and destroy) red_floor_light and damagetile in predefined pattern across room. I created a example dungeon of two groups of lights flickering back and forth(with separate damagetile timer). Feel free to use and modify as you like. There are probably more elegant ways to do this but this does the trick.

Here is a example dungeon for editor:
http://www.aaneton.net/~tommi/Moving_Li ... _files.zip

Same dungeon exported:
http://www.aaneton.net/~tommi/Moving_da ... ungeon.zip

(extract files to ...\Almost Human\Legend of Grimrock\Dungeons)

Re: Another script help pls

Posted: Thu Jan 03, 2013 7:27 pm
by aaneton
Komag wrote:You could have a flag for each square in the room, and when the lights move also set the flags. Then have a fast timer (maybe 0.2s) triggering a damage tile for every square, but won't do the damage for any particular square if that square's flag is set (or not set, whichever way you want), constantly repeating some small damage like 1 or 2
This is a more elegant solution than mine, and probably more practical for large rooms / lots of lights, for small areas moving lights in groups like my example might do the trick.