Modme Forums
Menu:

Powerup that spawns FX

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: Abnormal202

Hello, I have been trying to make a powerup that spawns a bunch of sand/wind FX at script origins all over the map. To do this, I've been looking through the NSZ_time_warp.gsc and replacing the warp_time function with my own. The only problem is I'm not sure how to spawn and delete FX through script. I've looked at the ScriptDocs and found:

entity PlayFX(<fx name="">,<position>,[forward],[up],[ignore pause])
</position></fx>



and

void StopFX(<localclientnum>,<effect id="">)
</effect></localclientnum>



problem is, I don't know what LocalClient Num or effect id or where to find it.


ModmeBot:

Reply By: natesmithzombies

You are off to a good start! Spawning fx can be a bit tricky and I have seen it done several different ways.

The way that I would do this is to use the "define" statement at the top of you script to make sure the fx is defined properly. Then add it to your zone. Defining an fx and precaching in script and zone can be learned by reading my brutus script. You will see it at the top of the script.

Playing is a bit less intuitive than you may think. FX can only be stopped in CSC (which is why you see the local client number as an argument). Because this is happening in the world, CSC (client script) would be a poor choice to use instead of GSC (level script). I am just trying to help you understand the difference between GSC and CSC.

So now that we understand we need to use GSC you need to PlayFxOnTag because this is the only way we can stop an fx in GSC. To do so, spawn a script model. SetModel to "tag_origin". PlayFxOnTag on the invisible tag origin model. Then delete the model whenever you want to stop the fx. Sorry for the long post, I just wanted to give you all the info you needed to give it a try yourself without me writing the code for you . Let me know if you need more help