Editing core aspects of the game
-
RegisCastus
- Posts: 5
- Joined: Tue Nov 20, 2012 5:26 pm
Editing core aspects of the game
Hey everyone, I posted this question in the steam forums and someone pointed me here for more information:
Is it possible to do something like fully removing resting, or at least editing how the rest system works? Or reducing the player party from 4 characters to 1? Haven't seen any way to do anything like this in the editor and I haven't found been able to find anything online stating if you can. Figured maybe someone more experienced in the editor might know around here. Thanks for any information you can give!
As I stated above, I'm looking to (mostly) remove the resting system, the 4 man party system and maybe the hunger system. I'm pretty poor at coding, so I'm wondering if anyone here has made some code that fixes those issues I'm having. Thank you for any help you can provide.
Is it possible to do something like fully removing resting, or at least editing how the rest system works? Or reducing the player party from 4 characters to 1? Haven't seen any way to do anything like this in the editor and I haven't found been able to find anything online stating if you can. Figured maybe someone more experienced in the editor might know around here. Thanks for any information you can give!
As I stated above, I'm looking to (mostly) remove the resting system, the 4 man party system and maybe the hunger system. I'm pretty poor at coding, so I'm wondering if anyone here has made some code that fixes those issues I'm having. Thank you for any help you can provide.
- montagneyaya
- Posts: 103
- Joined: Tue May 01, 2012 11:08 pm
Re: Editing core aspects of the game
You can use hook party onRest or method party:isResting() like this
and Champion:setEnabled(enabled) method for change the number of champion
You can find all method and hook here :
http://www.grimrock.net/modding/scripting-reference/
http://www.grimrock.net/modding/asset-d ... reference/
Code: Select all
if party:isResting then
party:wakeUp(true)
endYou can find all method and hook here :
http://www.grimrock.net/modding/scripting-reference/
http://www.grimrock.net/modding/asset-d ... reference/
Door on floor placement: http://grimrock.nexusmods.com/mods/120
-
RegisCastus
- Posts: 5
- Joined: Tue Nov 20, 2012 5:26 pm
Re: Editing core aspects of the game
I tried flat out copy pasting them into an LUA file and uh, well as I said I'm pretty terrible at coding, and I really can't grasp...anything really in those reference lists. Is there an opener that I need to put in the LUA, like you would in a C++ file? Sorry for my flat out ignorance of programming, but it's something I never had the patience for.montagneyaya wrote:You can use hook party onRest or method party:isResting() like this
and Champion:setEnabled(enabled) method for change the number of championCode: Select all
if party:isResting then party:wakeUp(true) end
Re: Editing core aspects of the game
For the food system, you could have a function that runs regularly to add an amount to all champions food bar.. thus negating the need to eat. (you could even add this to the party onMove hook, so every time the party moved, their food bar would be increased)
As montagneyaya has already said you can disable champions at the start of the dungeon.
You could use scripts to prevent the party from resting, but using the onRest hook in the party definition is probably the best way to do it. you'd need to edit the init.lua file in your dungeon folder and add something like
Here the "return false" part of the onRest hook will prevent the party from ever being able to rest.
Code: Select all
function addFood()
for i = 1,4 do
party:getChampion(i):modifyFood(200)
end
endYou could use scripts to prevent the party from resting, but using the onRest hook in the party definition is probably the best way to do it. you'd need to edit the init.lua file in your dungeon folder and add something like
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onRest = function()
return false
end,
}Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Editing core aspects of the game
Try copy/pasting the following into your init.lua file (found in "documents/Almost Human/Legend of Grimrock/Dungeons/NAME OF YOUR DUNGEON/mod_assets/scripts" folder_
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onRest = function()
return false
end,
onMove = function()
for i = 1,4 do
party:getChampion(i):modifyFood(200)
end
end,
}
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
-
RegisCastus
- Posts: 5
- Joined: Tue Nov 20, 2012 5:26 pm
Re: Editing core aspects of the game
Did that, and it worked. Thanks for clarifying where it was meant to go.Grimwold wrote:Try copy/pasting the following into your init.lua file (found in "documents/Almost Human/Legend of Grimrock/Dungeons/NAME OF YOUR DUNGEON/mod_assets/scripts" folder_
Code: Select all
cloneObject{ name = "party", baseObject = "party", onRest = function() return false end, onMove = function() for i = 1,4 do party:getChampion(i):modifyFood(200) end end, }
Re: Editing core aspects of the game
On my computer recovering from a rest crashes the level, unless I add the onWakeUp() function in there too.
EDIT: if you make the onRest() return true.
Is that a fluke in my level, or a known issue?
EDIT: if you make the onRest() return true.
Code: Select all
onWakeUp = function()
return true
end,
Did you visit the Wine Merchant's Basement? And heard about the Awakening of Taarnab?
Re: Editing core aspects of the game
Glad it worked.RegisCastus wrote:Did that, and it worked. Thanks for clarifying where it was meant to go.Grimwold wrote:Try copy/pasting the following into your init.lua file (found in "documents/Almost Human/Legend of Grimrock/Dungeons/NAME OF YOUR DUNGEON/mod_assets/scripts" folder_
Code: Select all
cloneObject{ name = "party", baseObject = "party", onRest = function() return false end, onMove = function() for i = 1,4 do party:getChampion(i):modifyFood(200) end end, }
To disable champions... place a script entity in your dungeon and paste in the following
Code: Select all
party:getChampion(1):setEnabled(false)
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Editing core aspects of the game
It's not you.. I just did it in a test dungeon and it seems that if the onRest hook is used AND returns true, then you do also need to add the onWakeUp hook as well it seems. in the case of the OP we are using return false for onRest, so onWakeUp is not needed.mahric wrote:On my computer recovering from a rest crashes the level, unless I add the onWakeUp() function in there too.
EDIT: if you make the onRest() return true.
Is that a fluke in my level, or a known issue?Code: Select all
onWakeUp = function() return true end,
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
-
RegisCastus
- Posts: 5
- Joined: Tue Nov 20, 2012 5:26 pm
Re: Editing core aspects of the game
Got that working too. I find it weird that some things get coded in the editor while others get coded out of itGrimwold wrote:Glad it worked.RegisCastus wrote:Did that, and it worked. Thanks for clarifying where it was meant to go.Grimwold wrote:Try copy/pasting the following into your init.lua file (found in "documents/Almost Human/Legend of Grimrock/Dungeons/NAME OF YOUR DUNGEON/mod_assets/scripts" folder_
Code: Select all
cloneObject{ name = "party", baseObject = "party", onRest = function() return false end, onMove = function() for i = 1,4 do party:getChampion(i):modifyFood(200) end end, }
To disable champions... place a script entity in your dungeon and paste in the following
That will disable the champion in the top left slot as soon as the dungeon starts. To disable more champions, simply add additional lines and change the 1 to 2,3, or 4. to disable the other champions.Code: Select all
party:getChampion(1):setEnabled(false)