After some busy weeks, some little update for you regarding our future Racing/Mission System. Torque3d lacked the ability to load/unload/edit things in groups dynamically. They have an object type called “prefab” which enables you to group objects together and reuse this group in several places. However, this system always loads the objects upon level loading. So here we want to present you a little feature that we added to this prefab class so we can now have prefabs that can contain race items (triggers, blocking objects, etc) in a separate file that can be loaded dynamically and is easy to be edited by the users.
Prefabs now have 3 more options in their context menu: “Unpack” - this opens the prefab to be edited. “Load/Unload” - this adds or deletes the objects from this prefab from the scene dynamically. (Also notice that the prefab icon changes depending in which state it is)
For Example, this is the race1 prefab loaded which contains the barrier on the left:
And the same prefab unpacked: the user can now edit the contained objects. Afterwards the user can select “pack prefab” on the context menu again to close it.
This system will allow us and you to create races and missions that change the objects on the terrain π
Usage Example: the player drives through this trigger (they will get fancier, don’t worry) which loads the prefab (which contain the barriers you can see in the background) and starts the race in Lua: