heyo. I'm trying to have a light follow you around but my script isn't working. I've placed a light in radiant with the targetname "light_a" and I've called this function in the main one.
First of all, you're using improper syntax in two of your functions. When you do:
Then you have this:
I haven't tried using a "radiant light" in script, however you can easily use an "FX light" to accomplish what you need. First of all, open radiant, go to the fx browser, and find a good fx light that you want to use, or create/edit your own. Then in script, when you are ready to spawn the "following light", you need to get the player first. For testing purposes, just drop down a trigger_use, give it a targetname like "fxlight". Then in script, do:
Don't forget to add the fx in your zone file. Go to launcher, right-click your map, and click 'edit zone file', then add:
Then obviously you need to thread the init() function, and the fx_light() function in your mapname.gsc, so put the fx light scripts into it's own gsc file, so the #namespace command makes the init() function local. Ex.
Hope this helps. I've done similar things with fx so I know this method works. However there are usually always multiple ways to do any one task in coding, generally speaking. As for the "link to" method, what you're looking for if you want to go that route is to use an offset on the z-axis, so the light spawns above the player and shines down on them. So, if you use the link to method, then do it like this:
Last Edit: March 20, 2017, 11:31:04 am by Archaicvirus