Page 2 of 3
Re: Lua scripts
Posted: Thu Sep 20, 2012 12:11 am
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!
Re: Lua scripts
Posted: Thu Sep 20, 2012 12:33 am
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.
Re: Lua scripts
Posted: Thu Sep 20, 2012 12:59 am
by Xzalander
Oh that is genious and so, so devious at the same time.

Re: Lua scripts
Posted: Thu Sep 20, 2012 1:33 am
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.
Re: Lua scripts
Posted: Thu Sep 20, 2012 7:18 pm
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.
Re: Lua scripts
Posted: Thu Sep 20, 2012 7:49 pm
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...
Re: Lua scripts
Posted: Thu Sep 20, 2012 8:02 pm
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!
Re: Lua scripts
Posted: Thu Sep 20, 2012 8:05 pm
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)
Re: Lua scripts
Posted: Sat Sep 22, 2012 10:31 am
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?
Re: Lua scripts
Posted: Sat Sep 22, 2012 12:03 pm
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,
}