Lua cave generation and keeps

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Lua cave generation and keeps

Post by vghetto »

Hi,

This is driving me crazy, I have explicit x and y values for a chamber and a place_castle=yes item_location.

Code: Select all

x=5
y=5
jagged=0
For some reason the keep isn't exactly on the given x,y values. It is sometimes off by 1 or 2.

I'm looking at the cave_map_generator.lua and can't see anything out of the ordinary there that might be causing the shift.

Any ideas on what might be going on?

Edit: ok, looks like I have to set the chamber size to 1 in order to get an exact id location.
So, the chamber gets cleared, then a random tile from that set gets selected for the id.
local index = random(#locs_list) This is what was causing it.
Post Reply