News Board

Message Details

NPC Brains

By Tristan on 24/01/2010 21:22:00

Another quick update. The web api has been jsonified, so all calls should now return application/json data, containing at least the result status of the request. I have also finished implementing the brains for NPCs. A quick example can be found at /home/tristan/things/frog.cs. You can create an instance (or more) by using the create command. 'create TestLib.Frog' will add a frog to the room. You add behaviours to the brain with a priority and a condition for their execution. They continue to execute as long as the condition is true and another, more important behaviour does not get executed. Behaviours are implemented as iterator blocks, and use the yield statement to pause execution for a specified time. When the pause is completed, execution resumes after the yield statement.

Back to board index.