Page 1 of 3

Lua scripts

Posted: Tue Sep 18, 2012 10:23 pm
by tantalan
Guys thanks for the editor great thing, thanks for nice guide through how the editor works. BUT i dont thing you gave us enough info about the functions in your game. I mean you gave us documentation to lua languague its ok BUT if i know programming and i want to activate the teleport and make it visible with script how can i know which function makes teleport visible or which activates it? Dont you have some list of all functions you used in scripts for ex to activate trigersteleports etc... Or the best thing would be if you give us some examples how you programed teleport puzzles or puzzles with fireballs, pits etc.

Re: Lua scripts

Posted: Tue Sep 18, 2012 10:29 pm
by Neikun

Re: Lua scripts

Posted: Tue Sep 18, 2012 10:39 pm
by tantalan
Oh man great great SCRIPTING REFERENCE is what i really needed but i didnt see it :-))))))

Re: Lua scripts

Posted: Tue Sep 18, 2012 10:43 pm
by Neikun
That's okay. I fail to read a lot of what's already there all the time.

Re: Lua scripts

Posted: Tue Sep 18, 2012 11:01 pm
by Komag
Also look at this thread:
viewtopic.php?f=14&t=3099

Re: Lua scripts

Posted: Wed Sep 19, 2012 9:19 pm
by tantalan
Can somebody help?
1)
How does IF work when i have more than one lines of code? Is this right? For example:
If a==2 then
door1:close()
door2:close()
end

2)
I saw this code in reference:
Party:shakeCamera(intensity, duration)
I tried: Party:shakeCamera(1, 2) but it gave me an error: attempt to index global party a nil value. Why is that?

3)
Can you give me example of code that removes an object from ALTAR? I need to make this object to disappear. For example a key or something that player puts on altar

4) What is the code for having a room where will spawn a snail until there will be max 5 snails than it stops. Can u help?
Half solution: I made a timer which activates a spawner after a while and each time counter counts +1 but i dont know how to decrease counter when snail dies

Re: Lua scripts

Posted: Wed Sep 19, 2012 9:44 pm
by Komag
1) I think it would have to be:
if a == 2 then
but otherwise the doors should close fine

2) don't know about the shakecamera

3 I believe we currently can't removing items from alcoves or altars

Re: Lua scripts

Posted: Wed Sep 19, 2012 9:54 pm
by Montis
tantalan wrote: 2)
I saw this code in reference:
Party:shakeCamera(intensity, duration)
I tried: Party:shakeCamera(1, 2) but it gave me an error: attempt to index global party a nil value. Why is that?
2) you have to use a lower case "p" in party, then it will work.

Re: Lua scripts

Posted: Wed Sep 19, 2012 9:58 pm
by Malveus
Komag wrote:1)

3 I believe we currently can't removing items from alcoves or altars
You can place a hidden plate, teleport ( deactivated and invisible), and altar, all on the same square, run a connector from the plate to a timer which activates the teleport, and it will remove the object from the altar, sending it wherever.

Re: Lua scripts

Posted: Wed Sep 19, 2012 11:43 pm
by tantalan
Thanks for advices. Do you know how to make a moving teleport? I know probably using timer but how to create and remove teleport from one place to another?