Lua scripts

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
tantalan
Posts: 112
Joined: Mon Mar 12, 2012 5:49 pm

Lua scripts

Post 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.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Lua scripts

Post by Neikun »

"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
tantalan
Posts: 112
Joined: Mon Mar 12, 2012 5:49 pm

Re: Lua scripts

Post by tantalan »

Oh man great great SCRIPTING REFERENCE is what i really needed but i didnt see it :-))))))
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Lua scripts

Post by Neikun »

That's okay. I fail to read a lot of what's already there all the time.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Lua scripts

Post by Komag »

Also look at this thread:
viewtopic.php?f=14&t=3099
Finished Dungeons - complete mods to play
tantalan
Posts: 112
Joined: Mon Mar 12, 2012 5:49 pm

Re: Lua scripts

Post 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
Last edited by tantalan on Wed Sep 19, 2012 9:59 pm, edited 2 times in total.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Lua scripts

Post 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
Finished Dungeons - complete mods to play
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Lua scripts

Post 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.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Malveus
Posts: 25
Joined: Tue Jul 17, 2012 5:03 am
Location: Louisville, KY

Re: Lua scripts

Post 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.
tantalan
Posts: 112
Joined: Mon Mar 12, 2012 5:49 pm

Re: Lua scripts

Post 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?
Post Reply