
I have a question, what calls makeControls(caller, control, base, size, space, omit) if I want the buttons or things like that to appear somewhere? Could you provide a quick short installation guide please ?
The function buttonPress() is where the button or lever's action originates. The variable *pressed* is a local numerical id derived for the button; use it to script a block in the buttonPress() function, that either contains or calls your scripted action for each button.THOM wrote:So - what I have are three buttons in a vertical row and I want button A to trigger script A, button B to trigger script B and so...
Can someone give me a clue how to script that?
Code: Select all
function buttonPress(my)
local pushed = tonumber(string.sub(my.go.id, string.len(my.go.id) - 1))
--=|--------------------------------------------------------------------------------------------------------
local buttonAction = { [12] = function() script_A.script.myFunc(pushed) end,
[22] = function() script_B.script.myFunc(pushed) end,
[32] = function() script_C.script.myFunc(pushed) end,
}
buttonAction[pushed]()
--=|--------------------------------------------------------------------------------------------------------
end
Code: Select all
--=|----place below leverFlip()------------------------------------------------------------------------------------
makeControls(self, "wall_button", self.go.id .."_button_", {3, 3}, {.4, -.4, .4, -.4}, {11,21,33,13,23,31,33})
--=|--------------------------------------------------------------------------------------------------------
Code: Select all
--name object script_A
function myFunc(pushed)
playSound("secret") hudPrint("Button Pressed "..pushed)
end
Hi Lark,Lark wrote: makeControls(self, "wall_button", self.go.id .."_button_", {3, 3}, {.4, -.4, .4, -.4}, {21, 23, 12, 32})
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.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.