Entity Script System
We've had a lot of discussion with the community about the Leadwerks3D script system. The current design is based on a combination of user feedback, lessons learned from Leadwerks Engine 2, stealing ideas from other game engines, and my own judgement. Our goal is to make a really easy and powerful game scripting system, without overwhelming the user with complexity. With that said, I thought I would let you in on how the script system presently is working in our own builds, and the process of using it.
To attach a script to an entity, open the Properties Editor. Click and drag the script file from the Asset Browser onto the Properties Editor. A tab appears where all the script properties are displayed:
Here's an alternate approach we are playing with. Here, the properties editor is embedded in the scene tab in the side panel. Since assets can't be dragged from the Asset Browser to the Properties Editor (since they are in different tabs) we just right-click on the entity in the Scene Browser, and a standard file request dialog appears, allowing you to choose a script file:
Which do you like better?
The visual logic editor in Leadwerks3D is called "Synapse". To add an entity into Synapse, drag the entity from the Scene Browser into the Synapse window. The entity will appear as a block, with its attached script components displayed below it in order. The color of the logical block corresponds to the object color in solid and wireframe viewports:
You can see the script defines the output and input functions that are displayed in Synapse. Next I'll show you how entities in Synapse can be strung together to make sequences of events and gameplay logic.
3 Comments
Recommended Comments