Code: Select all
if Dungeon.getMaxLevels() == 0 then
Only if you don't want your hook to be added to the standard assets' items...
Code: Select all
if Dungeon.getMaxLevels() == 0 then
Only if you don't want your hook to be added to the standard assets' items...
When I did that it gave me an error "attempting to index 'c' (a boolean value)" or something like that
Code: Select all
local orig_defineObject = defineObject
local onEquipItemHook = function(self, champion, slot)
print("asdfasdf")
end
defineObject = function(def)
if def.components then
for k,c in pairs(def.components) do
if type(c) ~= "table" then
print(string.format("non-table value (%s = %s) encountered in component table for %s",
tostring(k),tostring(c),tostring(def.name)))
elseif c.class == "EquipmentItem" then
c.onEquipItem = onEquipItemHook
end
end
end
orig_defineObject(def)
end
1) This will make every "custom_potion" stackable, as long as it's in the game world (not in a champion inventory, not in a container)Lorial wrote: ↑Sat Dec 29, 2018 12:53 pm I require a helping hand concerning some problems I ran into after the release of my mod and I assume this would be easy to fix. It is important to be able to change it ingame using the console since a re-release would render all save games corrupt - not an option anymore at this point.
Code: Select all
for i = 1, Dungeon.getMaxLevels() do
for e in Dungeon.getMap(i):allEntities() do
if e.name == "custom_potion" then
e.item:setStackable(true)
e.item:setStackSize(1)
end
end
end
Code: Select all
teleporter_1.teleporter:setTeleportTarget(starting_location_1.level, starting_location_1.x, starting_location_1.y, starting_location_1.elevation)
Code: Select all
monster_123.monster:die()
I don't see why releasing an updated version is a problem? Every mod out there has bugs and everyone releases updates for it.Lorial wrote: ↑Sat Dec 29, 2018 12:53 pm Hello there.
I require a helping hand concerning some problems I ran into after the release of my mod and I assume this would be easy to fix. It is important to be able to change it ingame using the console since a re-release would render all save games corrupt - not an option anymore at this point.
Thank you in advance.
I have been trying to wrap my head around the scripting reference forever, but I hardly ever glued things together properly. To this day I have no clue how to fuel my lantern with oil flasks even though setFuel or something is in there and recharging is a thing in the game...
Via console this does not seem to work, they simply refuse to stack. Unfortunately, the crash occurs when making them, so only editing the potions.lua seems to have any effect.Zo Kath Ra wrote: ↑Mon Dec 31, 2018 4:09 pm
1) This will make every "custom_potion" stackable, as long as it's in the game world (not in a champion inventory, not in a container)
Last time I updated the mod, I instantly got reports of software issues by players trying to load their previous save game. Perhaps this is a steam thing, but I did not want to ruin their fun any further. Steam overwrites old versions of subscribed mods by default, so I could not even upload a newer version and leave it to players whether they wanted to update and start over or not. I could of course upload another workshop entry, but now the main fix is a simple copy&paste.Pompidom wrote: ↑Mon Dec 31, 2018 7:27 pm I don't see why releasing an updated version is a problem? Every mod out there has bugs and everyone releases updates for it.
Did you even upload it at https://www.nexusmods.com/legendofgrimrock2 ? Please do, so that everyone (non steam users) can enjoy your mod.
Happy new year and best wishes!
Start with this (if you haven't already): https://github.com/JKos/log2doc/wikiLorial wrote: ↑Tue Jan 01, 2019 12:37 am I have been trying to wrap my head around the scripting reference forever, but I hardly ever glued things together properly. To this day I have no clue how to fuel my lantern with oil flasks even though setFuel or something is in there and recharging is a thing in the game...
Code: Select all
function darknessSpell()
onCastSpell = function(party,champion,spellName)
if spellName == "darkness" then
hudPrint("Found!")
darkness_door.door:open()
return false
end
end
end