Modme Forums
Menu:

Scripting Lights

Game Modding | Call of Duty: Black Ops 3 | General Discussion


ModmeBot:

Thread By: simplyzak09
Hi,
Is it possible to have a light that changes color through scripting, and if so how would I go about scripting that ?
What I am trying to achieve is, there are 3 switches the player must press to start an Easter egg.
However, the player must press them in an order, the player knows what order depends on a light above the switch.
so what I want to do is,

switch one will start green and once pressed will turn off
switch two will then turn from red to green. once triggered it will also switch off
turning switch three from red to green and so on.


ModmeBot:

Reply By: Abnormal202
You can do this two different ways. The first way, that I would probably do, is create an FX for each light. If you don't how to create an FX, you can look up many tutorials online, it's all done in radiant. This one might help:
Make sure the FX you are creating is a "Dynamic Light". Once you have your FX for all your lights, I recommend playing them by spawning an invisible model, playing the FX on the "tag_origin" of the model, and when you are ready to get rid of the FX to say, switch to a different light color, you can just Delete() the model.

fxorg = util::spawn_model( "tag_origin", location );
PlayFxOnTag( "my_fx/green_light_fx", fxorg, "tag_origin"); 


Alternatively you can use exploders. They are a type of light entity that I believe you can switch on/off in script. I've never used them before however, but this tutorial could help: http://wiki.modsrepository.com/index.php?title=Call_of_duty_bo3:_ZM_Exploders