Anyway,i've got a problem. Look at the preview window:
SpoilerShow
P.S. And sorry for my terrible english
Code: Select all
-- hello world script
function hello()
print("Hello world!")
end
this first line is a comment, which is useful for describe / document code, which itself is ignored by the engine, it starts with double "-"-- hello world script
the second line defines a function named hello - which will appear in the connector action field, you can name it differently if you want: SayHello_1, Say_Hello_2 etcfunction hello()
print should paste the worlds in the quota in the bracket into the console - they will NOT appear to the player. If you want to show some text to the PLAYER use hudPrintprint("Hello world!")
It shows where the end of the function is, so you can define multiple functions in one script and use them in different situations:end
Code: Select all
-- some Hello Messages
function sayHello_1()
hudPrint("Hello world!")
end
function sayHello_2()
hudPrint("Hello again!")
end
Got it! Thanks. But i still can't put down the strings! Shift+Enter, Ctrl+Enter and whatever+Enter doesn't works. Also i can't paste code in console.LucidPanic wrote:I think you want to test the little Hello World script from http://www.grimrock.net/modding/introdu ... scripting/ , right ?
I think i can explain that code snippet:Code: Select all
-- hello world script function hello() print("Hello world!") endthis first line is a comment, which is useful for describe / document code, which itself is ignored by the engine, it starts with double "-"-- hello world script
the second line defines a function named hello - which will appear in the connector action field, you can name it differently if you want: SayHello_1, Say_Hello_2 etcfunction hello()
print should paste the worlds in the quota in the bracket into the console - they will NOT appear to the player. If you want to show some text to the PLAYER use hudPrintprint("Hello world!")
It shows where the end of the function is, so you can define multiple functions in one script and use them in different situations:end
Code: Select all
-- some Hello Messages function sayHello_1() hudPrint("Hello world!") end function sayHello_2() hudPrint("Hello again!") end
I have only faint idea how to trigger those funtions - i believe you can put some lever, pressure plate - and connect it to the LUA script on activation, and define the action / function there.
HTH
ps. sorry for the english too;)

Afterwards connect a trigger (like a lever, pressure plate) to the script entity and choose the function to trigger.
Done.To trigger code:-
Add a pressure_plate_hidden
Select the plate
Add a connector - connect it to your lua script entity
In there... in there... In what? I can paste in scrolls, notes, walltexts, but not in to the consolePlace this somewhere on the map, then paste the code in there
