Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Duncan1246 wrote:I needs to use runes-buttons (same as "wall_button" but with a rune instead of the LOG1 logo, named "wall_button_fire", ..., etc.
The best way to have the runes, is to change the texture on the material... but that's not the easiest way. The second best , is to edit the model in blender an add the rune as a plane, one unit in front of the button face. It will cover the logo, rather than replace it.
To alter the textures, you could use Blender to bake the changes to the material(s); or you could use Photoshop/Gimp along with the normal map plug-in; to fake the baked results.
Thanks Isaac. It's your slider puzzle in ORR2 which give me the idea to use runes in a slightly different way, I make an attempt with Blender, but I failed: this tool needs some time to handle... So I have made the runes buttons with your first proposal: changing textures and materials of the center of the button, leaving the metal around unchanged. It works, even if it's certainly possible to make it better.
But now the problem is: how use these buttons with Lark's multilever script, because the script call ONE button model for all buttons spawned. I haven't tried to change the script for now, but my feeling is that it's not so easy...
Duncan
Duncan1246 wrote:But now the problem is: how use these buttons with Lark's multilever script, because the script call ONE button model for all buttons spawned. I haven't tried to change the script for now, but my feeling is that it's not so easy...
Duncan
I could not find a way to override the material called by a model ~per node. However, I did manage to override the button face, once I'd reassigned it to a new material in the GMT. This seems to work pretty well; (specifically for a 3x3 grid of the runes) . https://www.dropbox.com/s/k3ez33cqrc5pt ... d.zip?dl=0
To use this method, you must add the included button model, the three clay tile textures, and the runes.lua script to your mod; runes.lua needs to be imported to init.lua
Ok Issac I downloaded the test dungeon but imam not sure how to use it yeah. Is it possible for you to make a better example on how to use your test dungeon with a puzzle, small, medium, high for testing yeah? Your demo just has the code and nothing connected to script you made.
Eleven Warrior wrote:Ok Issac I downloaded the test dungeon but imam not sure how to use it yeah. Is it possible for you to make a better example on how to use your test dungeon with a puzzle, small, medium, high for testing yeah? Your demo just has the code and nothing connected to script you made.
Thxs for any help mate
It's Larks button script... I just added a tweak that changes the buttons to have rune faces. Lark explains the usage in the OP.
Basically the script makes buttons that call the buttonPress() function. To have the buttons trigger anything, requires that you change the logic in the buttonPress() function.
The example I give, shows the calling of three separate scripts, but of course it could also call one script, with many functions in it; or simply add the instructions into the list.
Duncan1246 wrote:But now the problem is: how use these buttons with Lark's multilever script, because the script call ONE button model for all buttons spawned. I haven't tried to change the script for now, but my feeling is that it's not so easy...
Duncan
I could not find a way to override the material called by a model ~per node. However, I did manage to override the button face, once I'd reassigned it to a new material in the GMT. This seems to work pretty well; (specifically for a 3x3 grid of the runes) .
To use this method, you must add the included button model, the three clay tile textures, and the runes.lua script to your mod; runes.lua needs to be imported to init.lua
Thanks a lot, Isaac, the script works perfectly!
I have had some trouble with the order, because I don't use the order of the runes cast and the order of definerunes() is inverse of reading order, so first attempt it was a real mess... but all is right now
Duncan
Everything is fine - my buttons are created, they work and send their impulses after beeing pressed. At the end they trigger a function which starts like
function mineSequence(sender)
if sender.id == "mine_buttongrid_button_41" then
("mine_buttongrid_button_41" is the button created with Larks script - ID is veryfied)
But I always get the error attempt to index local 'sender' (a number value)
I know that this function works if I trigger it with a normal button - so it seems "sender" in this case is lost somehow.
Does anyone have an idea what I have to do?
THOM formaly known as tschrage _______________________________________________ My MOD (LoG1):Castle RingfortThread My MOD (LoG2):Journey To JusticeThread | Download
function buttonPress(my)
local pushed = tonumber(string.sub(my.go.id, string.len(my.go.id) - 1))
hudPrint("button pressed: "..pushed)
--Replace the above with your own logic
end
function mineSequence(my)
if sender.id == "mine_buttongrid_button_41" and counter_mineGrid.counter:getValue() == 5 then
counter_mineGrid.counter:setValue(4)
elseif sender.id == "mine_buttongrid_button_41" and counter_mineGrid.counter:getValue() == 4 then
counter_mineGrid.counter:setValue(5)
THOM formaly known as tschrage _______________________________________________ My MOD (LoG1):Castle RingfortThread My MOD (LoG2):Journey To JusticeThread | Download
--script id is "combination_lock"
combination = {11,11,23,32,12,22}
next = 0
function buttonPress(button)
next = next + 1
if combination[next] ~= button then
next = 0
end
if next == #combination then
--do something
playSound("master_gate_open")
--do something
next = 0
end
--print(next, button) --uncomment to see the button ids
end
To set the combination, uncomment the print statement and press the buttons you want. Use those numbers in the combination table ~first to last.
And once again: A big thank you, Isaac. Works perfect!
THOM formaly known as tschrage _______________________________________________ My MOD (LoG1):Castle RingfortThread My MOD (LoG2):Journey To JusticeThread | Download