Page 1 of 1

Question regarding script

Posted: Sat Dec 29, 2012 12:09 am
by stochastic
Hey LOG modders,

First of all I am quite new to the scripting-universe of this game, so please be nice. :)

I am trying to figure out how I can (by script), make a prop (temple_ceiling_lamp) spawn on a certain location, if a torch is removed from it's torch holder - ofc. if it is replaced, I want the ceiling_lamp destroyed.

Classic riddle, which answer is darkness, and when they remove the torch, they see the light...

(If one of you can help me with the script - do I just add it to the LUA, or do I have to create some ID list in a TXT file - or how does that work?)

I hope some of you will be kind to spare a few mins to answer my newbish question regarding spawning a prop

Yours sincerely
Stochastic

Re: Question regarding script

Posted: Sat Dec 29, 2012 12:16 am
by msyblade
The ceiling lamp prop is not built into the wallsets, You will need Daniv's Northern dungeon, or High/Dark Elf Temple. If you do already have those, theeeennnnn:

Place a "script entity", select it, select the text are (Lower right box), and copy/ paste this in:

Code: Select all

function destroythelamp()
dark_elf_temple_ceiling_lamp_1: destroy()
end
You of course need to replace the ceiling lamp name with your own. Then connect the torchholder to it on action DEACTIVATE.(activate is torch in, deactivate is torch out)

Hope that helps!

Re: Question regarding script

Posted: Sat Dec 29, 2012 12:25 am
by Neikun
there are ceiling lamps in the temple and prison wallsets.

Code: Select all

prison_ceiling_lamp

Code: Select all

temple_ceiling_lamp
And as lightsources, you could be able to toggle them. This is a better option than destroying.

Re: Question regarding script

Posted: Sat Dec 29, 2012 12:26 am
by Komag
the temple ceiling lamp is just a light, already with the game, and you don't need to destroy or create it on the fly, just turn it on or off with the torch, simple. If you want it to start off, add this line to any script object (not in a function):

Code: Select all

temple_ceiling_lamp_1:deactivate()
msyblade is referring to the custom set up ceiling lamp models, so if you want to use those, that's different

Re: Question regarding script

Posted: Sat Dec 29, 2012 12:38 am
by msyblade
Ha! I was thinking of "Ceiling Chain lantern".

Re: Question regarding script

Posted: Sat Dec 29, 2012 12:41 am
by stochastic
Haha, okay I feel slightly stupid now :)
I did not know that it was so simple, I was looking at the lamp, and since it did not have any "activate/deactivate" function, I thought it would not work by using another prop to activate/deactivate it... It did. :)

Sorry for asking :D and thank you very much.

Let me ask you something else then:
Are there any tuts on making those trap-doors work, so you end up in another room/level?

Re: Question regarding script

Posted: Sat Dec 29, 2012 12:57 am
by Komag
a trap door pit drops to the floor below, so if you mean you've. want the party to somewhere else instead the only thing I can think of is to have a hidden pressure plate in the pit landing activate a teleporter (since falling into an already active teleporter doesn't work)

Re: Question regarding script

Posted: Sat Dec 29, 2012 1:11 am
by Neikun
I wonder if it's possible to have a hidden plate on the trap door that activates a teleporter on that square-- if that would stop you from falling.

Re: Question regarding script

Posted: Sat Dec 29, 2012 1:22 am
by stochastic
Is there a script for killing the party, when they hit the next level (for instance, hidden plate = dmg?)

Re: Question regarding script

Posted: Sat Dec 29, 2012 2:17 am
by Komag
yes, you can damageTile with a huge amount