Question regarding script

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Question regarding script

Post 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
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Question regarding script

Post 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!
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Question regarding script

Post 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.
Last edited by Neikun on Sat Dec 29, 2012 12:27 am, edited 1 time in total.
"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: Question regarding script

Post 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
Finished Dungeons - complete mods to play
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Question regarding script

Post by msyblade »

Ha! I was thinking of "Ceiling Chain lantern".
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Question regarding script

Post 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?
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Question regarding script

Post 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)
Finished Dungeons - complete mods to play
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Question regarding script

Post 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.
"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!
stochastic
Posts: 15
Joined: Fri Dec 28, 2012 11:59 pm

Re: Question regarding script

Post by stochastic »

Is there a script for killing the party, when they hit the next level (for instance, hidden plate = dmg?)
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Question regarding script

Post by Komag »

yes, you can damageTile with a huge amount
Finished Dungeons - complete mods to play
Post Reply