
How to disable automap ina floor? (trying to make labyrinth)
Re: How to disable automap ina floor? (trying to make labyri
This definitely should be integrated into the random dungeon generator project! 

Finished Dungeons - complete mods to play
Re: How to disable automap ina floor? (trying to make labyri
...but I can't get it to work, I need more clear instructions I think.
I made a script called MazeBuilder, pasted the huge code into it
I made another script called script_entity_1 (didn't name it), and put in:
didn't work, gave error "attempt to call method 'Initialize' (a nil value)" next to line 2
after reading more, and this thread, changed code to:
didn't work, gave error "attempt to modify a read only value" next to "maze.width = w"
What do I EXACTLY need to do?
I made a script called MazeBuilder, pasted the huge code into it
I made another script called script_entity_1 (didn't name it), and put in:
Code: Select all
maze = MazeBuilder:Create()
maze:Initialize(1, 2, 2, 28, 28)
maze:RandomizeMap()
after reading more, and this thread, changed code to:
Code: Select all
maze = MazeBuilder:Create()
MazeBuilder:Initialize(maze,1, 2, 2, 28, 28)
MazeBuilder:RandomizeMap()
What do I EXACTLY need to do?
Finished Dungeons - complete mods to play
Re: How to disable automap ina floor? (trying to make labyri
Komag, try this for your script_entity_1:
The differences here being the calls to Initialize and RandomizeMap are made using dots (MazeBuilder.Initialize) instead of colons (MazeBuilder:Initialize), also, you need to pass the maze object to RandomizeMap.
For Lua, calling foo:method() is equivalent to calling foo.method(foo), so using the colons here actually passes the script entity to the function calls as the first parameter instead of the maze object.
Initially i wanted the Initialize and Mapping functions to be on the maze object, but tables with methods on them are not savable in LoG, so I had to do it this way.
Edit: and heres a 28x28 random generated map. Took me like a half hour to uncover every cell!
Code: Select all
maze = MazeBuilder:Create()
MazeBuilder.Initialize(maze,1, 2, 2, 28, 28)
MazeBuilder.RandomizeMap(maze)
For Lua, calling foo:method() is equivalent to calling foo.method(foo), so using the colons here actually passes the script entity to the function calls as the first parameter instead of the maze object.
Initially i wanted the Initialize and Mapping functions to be on the maze object, but tables with methods on them are not savable in LoG, so I had to do it this way.
Edit: and heres a 28x28 random generated map. Took me like a half hour to uncover every cell!
SpoilerShow

Re: How to disable automap ina floor? (trying to make labyri
Thank you dasarby, this is sure to be helpful to many modders. You put thought and consideration into it, Much appreciated.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Re: How to disable automap ina floor? (trying to make labyri
Ah, it's working.
- I didn't know you needed to carve out the area first (but I guess that makes sense, doesn't it)
- You might consider updating or rewording the setup notes in the script itself as they show:
which was confusing to me since I really am not a coder at heart
This is pretty cool, a full maze as large or small as you want, new every time the level is played!
- I didn't know you needed to carve out the area first (but I guess that makes sense, doesn't it)
- You might consider updating or rewording the setup notes in the script itself as they show:
Code: Select all
-- maze:Initialize(1, 5, 5, 10, 10) -- 10x10 maze located at (5,5)
-- 5. By default, all doors will be open. Set the map to a preset one or a random one:
-- maze:SetMap(mapString)
-- maze:RandomizeMap()
This is pretty cool, a full maze as large or small as you want, new every time the level is played!

Finished Dungeons - complete mods to play
Re: How to disable automap ina floor? (trying to make labyri
Ah right, thanks Komag. That help text was from a older version (one that works in the editor, but not in an exported map), I've updated the script to the correct usage.