Re: LUA clueless, need help.
Posted: Mon Mar 23, 2015 9:31 pm
Well then I very much expect there to be a House Wife and Chauffeur NPC in your Mod. MAKE IT HAPPEN 
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.
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)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.
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