Page 1 of 1

Light switch

Posted: Fri Aug 02, 2002 8:58 am
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 :-(

Posted: Fri Aug 02, 2002 4:29 pm
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?

Dynamic Lighting

Posted: Fri Aug 02, 2002 5:27 pm
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

Posted: Fri Aug 02, 2002 9:40 pm
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: :(

switch

Posted: Sat Aug 03, 2002 12:33 am
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.

Posted: Sat Aug 03, 2002 8:08 am
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.

Posted: Sun Aug 04, 2002 5:23 pm
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.

Posted: Wed Aug 07, 2002 3:47 am
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

A thought

Posted: Wed Aug 07, 2002 5:37 pm
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.

Posted: Wed Aug 07, 2002 5:58 pm
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 :( :( :( :(

Posted: Wed Aug 07, 2002 6:39 pm
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???

path

Posted: Wed Aug 07, 2002 11:24 pm
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.

Posted: Thu Aug 08, 2002 7:21 am
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 :?: :?:

Wrong forum

Posted: Sat Aug 10, 2002 4:24 am
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

Posted: Sat Aug 10, 2002 12:26 pm
by wacko
Thank you!
I'll take a deeeep look and will come back (to the scripting-forum, ofcourse! :wink: )