Lua scripts

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Xzalander
Posts: 62
Joined: Thu Sep 13, 2012 1:27 pm
Location: Yorkshire, United Kingdom

Re: Lua scripts

Post by Xzalander »

Malveus wrote:
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.
Agree'd this is the solution.

A good idea is to have a Holding Cell on your Dungeon somewhere. Move any teleported items to the holding cell and make it so they land on a Pressure Plate. Have the pressure plate trigger a script to delete any items found on the grid reference of the pressure plate. Presto: item be gone!
User avatar
Malveus
Posts: 25
Joined: Tue Jul 17, 2012 5:03 am
Location: Louisville, KY

Re: Lua scripts

Post by Malveus »

Xzalander wrote:
Malveus wrote:
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.
Agree'd this is the solution.

A good idea is to have a Holding Cell on your Dungeon somewhere. Move any teleported items to the holding cell and make it so they land on a Pressure Plate. Have the pressure plate trigger a script to delete any items found on the grid reference of the pressure plate. Presto: item be gone!
I'm so mean that I teleport items to a locked "Lost and Found" room where you can actually see the ever growing pile of your stuff through a wall grate.There's eventually a key...somewhere...way down in the dungeon.
User avatar
Xzalander
Posts: 62
Joined: Thu Sep 13, 2012 1:27 pm
Location: Yorkshire, United Kingdom

Re: Lua scripts

Post by Xzalander »

Oh that is genious and so, so devious at the same time.
:mrgreen:
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: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?
Can't move those. You have to use multiple teleports and activate / deactivate them as you need.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
tantalan
Posts: 112
Joined: Mon Mar 12, 2012 5:49 pm

Re: Lua scripts

Post by tantalan »

Montis wrote:
tantalan wrote: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?
Can't move those. You have to use multiple teleports and activate / deactivate them as you need.
GREAT IDEA! I agree that it works i ll do that.
tantalan
Posts: 112
Joined: Mon Mar 12, 2012 5:49 pm

Re: Lua scripts

Post by tantalan »

Do you know how tu put a scroll in alcove with my text? I mean i put alcove than i enter that i want to add a scroll but there is no option how to write text on the scroll...
Ixnatifual

Re: Lua scripts

Post by Ixnatifual »

tantalan wrote:
Montis wrote:
tantalan wrote: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?
Can't move those. You have to use multiple teleports and activate / deactivate them as you need.
GREAT IDEA! I agree that it works i ll do that.
Yep that's a great way I've found. I was also trying to find a way to physically move the teleporters at first!
User avatar
ScroLL
Posts: 56
Joined: Tue Sep 18, 2012 12:21 pm
Location: Vermont

Re: Lua scripts

Post by ScroLL »

tantalan wrote:Do you know how tu put a scroll in alcove with my text? I mean i put alcove than i enter that i want to add a scroll but there is no option how to write text on the scroll...
There is a page on it in the Modding guide: http://www.grimrock.net/modding/how-to- ... an-alcove/

The code:

Code: Select all

local message = spawn("scroll")
message:setScrollText("This is an important\nmessage!")

scrollAlcove:addItem(message)
tantalan
Posts: 112
Joined: Mon Mar 12, 2012 5:49 pm

Re: Lua scripts

Post by tantalan »

Guys thanks for help! I have another two problems:
1) How to activate something with fireball? I mean what is the thing that can handle an activation by fireball? I tried pressure plate but it has no option to be activated by fireball I mean that its also not logical how can be a presure plate activate by firebal :-)

2) How can i handle daemon_eye_slots? I mean what is the code i must use to for example open a door when i put red gem and blue gem to daemon_eye_slots?
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:Guys thanks for help! I have another two problems:
1) How to activate something with fireball? I mean what is the thing that can handle an activation by fireball? I tried pressure plate but it has no option to be activated by fireball I mean that its also not logical how can be a presure plate activate by firebal :-)

2) How can i handle daemon_eye_slots? I mean what is the code i must use to for example open a door when i put red gem and blue gem to daemon_eye_slots?
1) You need a receptor or a hidden receptor for this. Watch the third video tutorial by Komag on this.

2) You have to actually place additional eye sockets. You would also need to redefine them, based on what you want to insert. I downloaded the asset pack and had a look at the defined object in there:

Code: Select all

defineObject{
	name = "eye_socket_left",
	class = "Alcove",
	onInsertItem = function(self, item)
		return item.name == "blue_gem" and self:getItemCount() == 0
	end,
}
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
Post Reply