Engine
Engine copied to clipboard
Enhancement: Game Events for scripts
What would this enhancement be for?
Scripting
Describe your enhancement suggestion in more detail
It'd be great if scripts could operate completely on their own, independent of external entities to maintain their functionality – including spawning bespoke entities to reference back to themselves. That is to say, a script should have some form of event or callback which is triggered when the map is fully spawned (similar to the OnMapSpawn input for logic_auto), when a map reloads, or to call its Think function (independent of a logic_script entity).
One possible approach would be to have a system similar to L4D2's Game Events: https://developer.valvesoftware.com/wiki/Left_4_Dead_2/Scripting/Expanded_Mutation_System/Appendix:_Game_Events