Tutorial: Create a working battery with light Last edited 1 year ago2023-10-22 13:03:36 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.
Work in progress
This tutorial lacks good formatting and has missing images. Contributions are welcome.
Hello, and welcome to another tutorial! This tutorial will teach you how to create working shiny batteries without programming. This guide assumes you know the basics of Half-Life mapping. To do this tutorial, you will require: First, create an item_battery entity, then, create a light_spot entity inside/on top of it. Name the light_spot whatever you want (Example: BAT_LIGHT), and make sure it has the following values:
`!!EPAIRS
"classname" "light_spot"
"style" "0"
"_sky" "0"
"_light" "0 255 255 200"
"pitch" "-90"
"_cone2" "23"
"_cone" "15"
"_falloff" "0"
"_fade" "1.0"
"angles" "0 0 0"
"targetname" "YOUR_BATTERY_NAME_HERE"`
You can copy this and paste it in the entity Properties

Next, go to the item_battery entity, and in Target, choose the light. It should look something like this:

User posted image

Run the map, make sure HLRAD (Lights) its on Extra. If its not working, you did something wrong, delete both entities and try again.

User posted image
Idle battery

User posted image
After player takes it

If you want the light more "strong", change the color to a darker one. The light disappears when you take the battery, but if the battery moves, the light_spot will not move with it. This works with other entities like healthkits, breakables, doors...

1 Comment

Commented 3 months ago2024-09-22 06:16:33 UTC Comment #106409
Be careful with this. You only have 31 named lights to work with per map.
A more optimized way, that comes free with most entities, is to use entity effects (effects) property.

You must log in to post a comment. You can login or register a new account.