LUA clueless, need help.
Re: LUA clueless, need help.
Well then I very much expect there to be a House Wife and Chauffeur NPC in your Mod. MAKE IT HAPPEN 
Re: LUA clueless, need help.
Some modders distribute their source files so that you can edit their dungeons. If the dungeon does not have source files released then you would need to extract the .dat file with a tool like offzip and match up the resulting hashed filenames to their original filenames. I do not recommend this.utopia570 wrote:Ok so for now, my only other question would be, is it possible to edit someone else's dungeon? I have 0 intention of reuploading a modified dungeon or "ruining" someone else's work. I simply want to alter a dungeon to my play style. It would be just an offline change for my own purposes. Thank you.
However there are a lot of changes you can make simply by using the debug console (enable with "console = true" in your grimrock.cfg and press the consoleKey ingame to open, '\' by default.) which is simply a Lua console; see the scripting reference for what you can do with it. For example, to make secret buttons more noticeable, you can run this line to draw white boxes around all ClickableComponents on objects with ButtonComponents:
Code: Select all
for l = 1,Dungeon.getMaxLevels() do for e in Dungeon.getMap(l):allEntities() do local clickables = {} local button = false for _,c in e:componentIterator() do if c.getFrontFacing then table.insert(clickables,c) elseif c.getDisableSelf and c.getSound and not (c.isActivated) then button = true end end if button then for _,c in ipairs(clickables) do c:setDebugDraw(true) end end end endCode: Select all
party.party:setMovementSpeed(1.5)Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: LUA clueless, need help.
Any modding of a user dungeon that is not offered as an editor project, will [usually] be done in-game through the Lua console, using Lua script commands.utopia570 wrote:Ok so for now, my only other question would be, is it possible to edit someone else's dungeon? I have 0 intention of reuploading a modified dungeon or "ruining" someone else's work. I simply want to alter a dungeon to my play style. It would be just an offline change for my own purposes. Thank you.
If the idea is to remove spiders ~for instance, it's possible in theory (to swap them for another monster), but in practice, some of them are spawned via scripts, and it's not as simple as replacing all monsters of a given type with another. Basic console commands can add equipment, open doors, kill monsters, and even move the party around, but in a complex scripted mod, it's sometimes possible to cause problems in it by changing things (unexpectedly); use with caution.
Re: LUA clueless, need help.
btw. Component:getClass() was added in 2.2.4.minmay wrote:Code: Select all
for l = 1,Dungeon.getMaxLevels() do for e in Dungeon.getMap(l):allEntities() do local clickables = {} local button = false for _,c in e:componentIterator() do if c.getFrontFacing then table.insert(clickables,c) elseif c.getDisableSelf and c.getSound and not (c.isActivated) then button = true end end if button then for _,c in ipairs(clickables) do c:setDebugDraw(true) end end end end