Light switch

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Light switch

Post by wacko »

Something probably everone (but me) knows already:

What I want: A light which can be switched off and goes on again after 5 seconds.

What I did: Create a entity light and a entity static_corona
Give them both a key targetname/light01

Create a entity static_equipment_electric-switch-nopulse
Create a entity trigger_multiple around it
Give it a key target/lighttrig

Create two entities trigger_relay
Give them both a key target/light01
and a key targetname/lighttrig
Give ONE of them a key wait/5

What I got: An always burning light plus a not working switch :-(
Pip
Private
Posts: 3
Joined: Sun Jul 14, 2002 9:34 am
Location: The Netherlands

Post by Pip »

i think you need to script it. make a trigger_use then let the script check if the light's on or off and then turn it off or on. setting the brightness to 0 and back. something like that?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Dynamic Lighting

Post by tltrude »

Here is a thread where we talked about dynamic lighting before. I don't know if NathanielPT ever came up with a tutorial for it, but you are bond to do better with his script than I did.

http://dynamic4.gamespy.com/~mohrad/php ... ight=light
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Oh god! This is ridiculous!!
It was SOOOO easy in worldcraft doing such simple things for halflife!! I can't believe, that I have to study C++ to switch off a light!?

What has happend to a func_button?

I accept programming scripts for airplanes that explode after being shot twice as often as the best DM-player in this map, but for this????
:x :shock: :(
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

switch

Post by tltrude »

All I can do is repeat what NathanielPT said, "Its the same thing that the "spotlight.scr" uses". If someone comes up with a light that goes on and off, I'll make the wall switch for it (script_object) that rotates up and down and clicks.
Tom Trude,

Image
NathanielPT
Corporal
Posts: 43
Joined: Sun Jul 07, 2002 3:35 pm
Location: USA/Africa
Contact:

Post by NathanielPT »

I haven't touched the idea of a tutorial, nor have I worked more with the lights to try and stop the clipping problem, sorry.

I have been working on fractal terrain. I very fasinating meathod of creating random realistic terrain. I just thought about maybe working with my program to output a greyscale image that could be loaded into GenSurf, or MOHRadiant, or anything else that will take a greyscale to create terrain.

Maybe I will mess with lights some today. It would still be script run but I could package it in such a way that you would create a "script_origin" give it a targetname of say "porch_light" and then a "trigger_*" that targeted the "script_origin", and had a "setthread / toggle_light" key/pair, which would toggle the light on and off. If this would be any help just let me know. I probably will get started on it, but how much I work on it depends upon if there is a demand for.
--NathanielPT--
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

A light-pack would be helpful for me (having no idea about scripting and seeing no way to get introduced in this kind of 'mapping' by now).
This makes the demand not very high, though...

Also, a tutorial about this topic seems to be even more helpful, because I would copy/paste your pack, but understand nothing...

Maybe if there was the 'pack' for the first thing with lots of explanations what to put where (for noobies like me), I could manage the second task myself.
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

A while back I asked a developer from 2015 (Mackey MacCandish) how to make a light turn on and off. His reply to me was that the quake3 engine does not allow for entity lights to be turned on and off. Like using the commands show and hide. He did say however that they had a workaround for this which required quite a bit of scripting. And did not produce the best effect but sufficed for what they wanted. He then instructed me to pick apart the global/alarm.scr to see what they did. Basically you are close in your approach. All you can do is turn coronas off and on and create flares. Bottom line: Entity lights are always on period, there is no turning them off.

G3mInI
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

A thought

Post by tltrude »

I had the idea of moving a room away from it's light source. Of course it failed because there are no light sources in the finished bsp--only lit surfaces.

So what we probably need is a way to teleport the player to a dark room--one that was not lit in the compile and is identical to the one in which he flipped the switch. There would have to be triggers to send him back to the world of light if he walks out of the room or flips the switch again.

I don't know if teleport works in MOHAA, but it's worth a try.
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Atleast for me, it wouldn't make any sense: I'm building DM-maps!
Here the player would feel very stupid, far off in a perfectly lit room, but without his friends...
I wanted to make a place where the player could camp in the darkness for a little while, but then light goes on again and he becomes visible again and has to move on...
If everything else fails, I'll have to do some sliding walls that cover the player that had pressed a button and slide back after a while.
I'd prefer lights though :( :( :( :(
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

I'm even too stupid for these sliding doors.
For them, I must use a different sound! Standard sound of a wooden (rotating) door can be changed into 'metal' sound with 'doortype'/'metal' but this isn't much better.
I found sound/mechanics/slow_gate.wav in a pk3, which I would like, but I can't make the door play this sound. How are these keys 'sound_open', 'sound_close' to be used???
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

path

Post by tltrude »

I think for those you have to use the path to the wav file. I gave up on doing it that way and just use the ubersound name in the script. Make a thread for that door (wall) and have the door trigger activate the sound.
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

So:
:( What ubersound name?
:( In which script?
:( What is a thread?
:( How could I make one or some?
:( Where should I put it or them?
You see, I don't know anything about these things. I confess, that I'm reading lots of posts about scripts and threads in this forum, but I couldn't find out yet, where this topic is explained. Everybody here seems to know about scripting. Where from???
I'm not very happy about having to write scripts and threads and things for every little thing thats more complex than a piece of wall. But if I have to, I will. Only thing is: HOW :?: :?:
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Wrong forum

Post by tltrude »

Well, it is easy to see you need scripting help and for that you should use the Scripting Forum. But there are a few tutorials on scripting. Here is a good place to start:

http://www.dafront.com/~nemesis/tut.htm
Tom Trude,

Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Thank you!
I'll take a deeeep look and will come back (to the scripting-forum, ofcourse! :wink: )
Post Reply