Login x
User Name:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

1 Active | 13 Guests


CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping


CoDUO Mapping
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Switched Lights
Versions: You must be logged in to view history.

How to add player controlled lights for MP or SP maps.

By <|WHC|>Grassy Web: www.whcclan.com Email: mpat9169@bigpond.net.au

What is this? :
It's a script and map system I devised to allow players the ability to turn on or off lights in MP or SP maps.
It has been tested in UO but should also work in COD.
I have tried to make it universal so anyone can use it in their own map.
This tutorial includes a raw .map file to load into the editor for closer inspection [download here], these screen shots, the script, and a complete
pk3 to put in your game directory to load and play right off to see the system in action.
In the example it has two lights controlled by one trigger, it can handle any number of lights and triggers as long as you keep the
keys and values on each entity following the correct name convention.
The actual script also has plenty of info at the top and includes a few examples for more lights in other parts of a map.

In Game Screenshot:

Step 1:

Place your xmodel light_off types and give them these keys and values,
key: targetname value: lightoffmodel
key: script_noteworthy value: room1
And change them into script_models, dont leave them as misc_models!

Step 2:

Now place your xmodels light_on types exactly in the same spot as the off models and give them these values,
key: targetname value: lightonmodel
key: script_noteworthy value: room1
And change them into script_models, dont leave them as misc_models!

Step 3:

If you want a model to represent the light switch you can make one out brushes
and define it as a script_brushmodel or use an existing xmodel and define it
as a script_model. You can have any number of models coresponding to the triggers
and just follow the same naming convention. The script will still work ok if no models
are found, but you wont get a sound played when triggered.
key: targetname value: lightswitch
key: script_noteworthy value:room1

Step 4:

Place your trigger (trigger_use) where you want them and give them the required values
key: targetname value: lighttrigger
key: script_noteworthy value: room1
key: hintstring value:Press Use to work lights (or anything else you want to display)

Step 5:

Now for the actual lights, create two script_models and position them on the light xmodels, then select
each in turn and give them these keys and values. You can change the color as well by pressing K.
Key: targetname value: light
Key: script_noteworthy value: room1
Key: light value: 60
Note* I recomend you stay below 100 for light value or it will show through everything.

Step 6:

Now for some scripting, if you have only created something similar to this tutorial and used the same names then
all you need to do is add this line to your maps .gsc script near the top.
level thread maps\mp\light_control_v2::main();
If you have more lights and switches with new names then follow the instructions in the scrip "light_control_v2.gsc"
You will see in the script that you can start the map with (lights off) or (lights on) by using a particular command line.
The light radiated from the script_models is a work around due to the fact that the game doesn't support control of real lights.
Unfortunately the script_models we have to use don't radiate light as well as a normal light entity would, it's advisable to keep the light
values fairly low otherwise it will radiate right through walls, floors and roofs and look nasty.
Only use them for effect in enclosed areas like tunnels, low level outside additional lights, cellars underground etc etc.
Another possible use could be to have a player activated light up on a building or a tower as a signal to the rest of the team it's good
to go! Storm the Base! :-)

I hope you find this tutorial, script and light system useful.

Regards Grassy.

Latest Syndicated News

Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends