I thought I'd spend a little more time on this integration, using the laptop whilst watching the Olympics. The next phase was to automate the routines for NPC update and compacting the code routines. Ultimately, the idea is that after the scene is loaded, it will be parsed and flagged Dark AI objects, NPC's, Paths and Zones will be set up automatically via information taken from the relative lua scripts. Paths and Zones will be later, collision objects are done, so I was working on how to go about NPC's using this method. As some may have noticed I am using the
FPSC Model Pack 53 characters.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3UxxBVZqELtxn2EzQ7QPNLWCxuK7T456a-cnSu9eJoh9V7KEQwnmcGDMcYRzskcVhuOfPa2dDvkYXbxdjGwC_0HVr9Khs2n0PkZJvmjW2jtJ_jBWbwkOtJjzXI2cazlfbr4SKGpKQMqUc/s320/FPSC53.jpg)
I converted about 5 or 6 characters to Leadwerks format and all the weapons for this exercise. I will eventually convert them all but I hand "prune" the bones of the rig and that takes longer than I want to spend at any one time on this side project. The FSM is still very basic but the first goal was to derive a current Animation state with each of those states having sub-FSM's to dictate the current behaviour based on the previous state and internal and external inputs. The framework is in place for the animation state which is derived by performing Boolean logic on returned values and strings from the Dark AI runtime and some stubs are in place nested inside for some basic behavioural sub-FSM's. First though I want to able to set up the scene and then place all the Dark AI objects, NPC's, Paths and Zones directly in the editor and then use the load routines to set all that up in an automagic way inside the application. The collisional objects were easy and are done with some simple tick box flagging functionality added to their property scripts. The NPC's a little more in depth , due mainly to the large amount of usable settings! lol. But I wanted to be able to place the model and then assign it some basic attributes to be read on load, this included what weapon to attach.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO-Yey0P8QeBJkwbEh8wy5_2jC_Rije21UeTHy2AjQjzhfKDqzrjwomj0j8quFZtE31TeiaGwod3PZxBoz9Szc2J3FFI_0_RNqBY-HrVi4TL8fZu9AfXX5XhXyI2fwGN6OQaiYKQQuzt73/s320/Properties.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvvziZ9cHOd6mfGqs2RrjXGiwqWAd-1Qi-CcmSeaLY3vP714mbdacMDWFhQ5rWmopUsUAS8kTJ9rYYcs1kzNXbXhUsnLOW9HexC7Yv6XB_vH9sVQpN0RyhLx97mm3H7XvmuDRKD-KSaS_A/s320/Properties2.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgrgLJswiwmtCjrfNOaCvHOeNNd37U-HQxIRiuBY7fks091_G5VenLd3UNxd_-dU9gdxbNOxPLjD84Ff6myWXg9rPLwPUAIIWNJ5-cEG1QKCmGNW3hWf96Xr1IoZzh-qGLs9XO5zpXpLCq/s320/Model_Female.png)
So that was the basic NPC property script setup (wasn't that painful anyway). So using the test scene from
Leadwerks 2.5x + DarkBasic's Dark AI [Part 2], and placing a few enemies and some friendly's to look after the player, this is the result of the current stage reached in the integration.