arx-tools / arx-level-generator

A node.js library for creating maps for the video game Arx Fatalis
MIT License
6 stars 0 forks source link

rooms definitions: add "cursor move" command to introduce in-between positioning along --/-/+/++ #27

Open meszaros-lajos-gyorgy opened 1 month ago

meszaros-lajos-gyorgy commented 1 month ago

Currently the rooms can only be aligned either to the center of the other room or to its edges: image

It's nicer to have a bit of space around the entrance to have wall support on all sides: image

This can only be achieved - as the rooms must align to the edges - by adding rooms with one or two dimensions set to 0 just for offsetting the internal cursor. Example from LaLee's minigame:

# room C - pantry
cursor restore living-room
room add 0 0 50 spacer z- x++ y-
room add 50 $entranceHeight 200 door z++ x++ y-
room add 600 $roomHeight 350 room-with-tiles z- x++ y-
with light dim
room add 600 $roomHeight 50 room-with-tiles z-- y-

This hack could be turned into a proper feature and could be done cleanly with manipulating the cursor directly from code:

cursor move 0 0 50

Internally it could be implemented as adding a room as big as the previous one, but with no walls/ceiling/floor and the coordinates adjusted with the 2 values. This way cursor save would also work here.