destroyab;le spotlight
Moderator: Moderators
destroyab;le spotlight
I know its very easy thing, but i want see any tutorials etc... i know how replace spotlight model to destroyed(???) or change anim, if its possible... do i need make a script light for spotlight? I havent time for looking in whole web for tuts, but im keep my maps realistic, light can be switched on and off, and surly lightbulb can destroyed....but i want make spotlight using they models too, so, any tuts?
I am not sure what you exactly want to do.
If you want to make a spotlight, that can be switched on and off, create a script_object, create this keys and values:
targetname spotlight
model miscobj/searchlight.tik
Create a trigger_use around your on/off switch and give it the key and value:
setthread switchspot
Create a trigger_multiple around your spotlight and give it the key and value:
setthread killspot
health 10
targetname killspottrigger
Activate "DAMAGE" in the Entity window for this trigger.
script:
There is no searchlightdestroyed model. searchlightoff.tik is already destroyed.
If you want to make a spotlight, that can be switched on and off, create a script_object, create this keys and values:
targetname spotlight
model miscobj/searchlight.tik
Create a trigger_use around your on/off switch and give it the key and value:
setthread switchspot
Create a trigger_multiple around your spotlight and give it the key and value:
setthread killspot
health 10
targetname killspottrigger
Activate "DAMAGE" in the Entity window for this trigger.
script:
Code: Select all
main:
level.spotstat = 0
end
switchspot:
if (level.spotstat == 1)
{
$spotlight.model = "miscobj/searchlightoff.tik"
level.spotstat = 0
} else {
$spotlight.model = "miscobj/searchlight.tik"
level.spotstat = 1
}
end
killspot:
$killspottrigger nottriggerable
$spotlight.model = "miscobj/searchlightoff.tik"
level.spotstat = -1
end
Last edited by Condor on Sun Jan 04, 2009 7:12 pm, edited 1 time in total.
...waking up in the middle of the night with your hands covered in blood and you have no idea what happened.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
You might want to increase the health though, unless you want 1 shot and out, If you put it's health at 100, a single mg bullet is enough to kill it so take 150 if you want it to last at least 2 bullets.
So for mapping do what condor says. Basically, the same applies for scripting if you want to do it solely with script. Since this is the scripting forum I'll tell something you'll probably don't know how to do in scripting: The DAMAGE flag is spawnflags 128 in scripting.
So for mapping do what condor says. Basically, the same applies for scripting if you want to do it solely with script. Since this is the scripting forum I'll tell something you'll probably don't know how to do in scripting: The DAMAGE flag is spawnflags 128 in scripting.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
Main question was: how turn on and off spotlight light.. so imiscobj/searchlight.tik is the LIGHT ON model, earchlightoff.tik is LIGHT OFF model, so dont need to spawn any light... well so that's all, thanks.
Btw showed here script is a bit laborious, i'll need to rewrite it at all...get it to not use global var's, change targetnamed entities to locals.. etc
Btw showed here script is a bit laborious, i'll need to rewrite it at all...get it to not use global var's, change targetnamed entities to locals.. etc
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
He means that he wants to turn the light on and off, not blow it. Try using the lightOff and lightOn commands on a spawned spotlight.
But you could use the search button, the search button is a blessing that's often ignored in forums. Believe me, after 7 years and 101651 articles, people have asked a lot of things and a lot of same things. There are quite a few topics dealing with spotlights. Some of which explain you how to control the light yourself. Here's the one:
/forum/viewtopic.php?t=11011&start=0
If you're unfamiliar with funcbeam, no worries, it's extremely easy. Not worth an explanation. And you'll find a lot more topics about spotlights when you search for it.
But you could use the search button, the search button is a blessing that's often ignored in forums. Believe me, after 7 years and 101651 articles, people have asked a lot of things and a lot of same things. There are quite a few topics dealing with spotlights. Some of which explain you how to control the light yourself. Here's the one:
/forum/viewtopic.php?t=11011&start=0
If you're unfamiliar with funcbeam, no worries, it's extremely easy. Not worth an explanation. And you'll find a lot more topics about spotlights when you search for it.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
I think it would be better to create a notsolid script_object with the shape of the lit up ground/walls, which is outside the level limits (not the world limits), but lit up by usual lights while the compiling process.
If you switch on the light the first time, this part of the ground/walls/etc.) gets moved to the position where its not-lit-up brother is (also a script object), which gets hidden as long as the light is on, so you don't need that slow, buggy dynamic lighting.
You can use the lightmaps from the compiling process, but it only works, if the manually lit-up part of the level is not very detailed and outside.
If you switch of the light, you just hide this script_object. I would not use dynamic lighting, if you have lots of spots etc. that can be switched on and off.
If you switch on the light the first time, this part of the ground/walls/etc.) gets moved to the position where its not-lit-up brother is (also a script object), which gets hidden as long as the light is on, so you don't need that slow, buggy dynamic lighting.
You can use the lightmaps from the compiling process, but it only works, if the manually lit-up part of the level is not very detailed and outside.
If you switch of the light, you just hide this script_object. I would not use dynamic lighting, if you have lots of spots etc. that can be switched on and off.
...waking up in the middle of the night with your hands covered in blood and you have no idea what happened.