Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of code/doc/ScriptController


Ignore:
Timestamp:
May 22, 2014, 1:55:29 PM (11 years ago)
Author:
samuezu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/ScriptController

    v1 v1  
     1= ScriptController =
     2
     3The ScriptController enables to control the movement of a controllable entity via a LUA-script.
     4
     5== The Process ==
     6
     7There are two important new classes. The ControllerDirector class and the ScrpitController class.
     8
     9The ControllerDirector waits for an event to be triggered by the specified entity and saves a pointer to it. Then the LUA-file is parsed (the game is suspended during this but it doesn't take long).
     10The LUA-file contains all necessary parameters (the function's name, coordinates, execution time) to create a new event and instantiates a ScriptController object. Inside that object, time (variable: scTime) begins now at zero, all events will be executed relative to this time.
     11
     12The ScriptController-object gets its instructions via the eventScheduler function and stores them in a vector of events (struct) in ascending order of their execution time. The LUA part is done now.
     13
     14Within every clockcycle the ScriptController's tick function checks if the time to execute the first event in the vector has come yet.
     15After an event has been executed, it is erased from the vector.
     16
     17