Hi all
<=EDITED AND UPDATED FOR INFORMATION=>
To help assist as a helpful guideline of how the Module (from Bioware) is set up and used. I have left out events that are not really used from the NWN Lexicon (for others familiar with NWN1 Aurora).
Module (object oModule)
Module Variables: For Global Data and Configuration Settings
Module Events:
OnModuleLoad - Lua script that runs when the Engine Loads
OnHeartbeat - Lua Script that runs on a module cycle. Should be on 100ms intervals.
OnClientEnter - Lua script that runs when a Client Connects to the game
OnClientLeave - Lua script that runs when a Client Disconnects from the game
Subset of oModule:
--Area (object oArea) = Levels/Scenes :: References to scenes in oModule kept in an array for engine access
Area Variables: For Local Area Based Variables
Area Events:
OnEnter
OnExit
OnHeartbeat (Only active while a Client is in the Area) 100ms update rate
object oObjects = Non-Static Objects that have scripts running. Kept in a list of the oArea
Variables
Module Functions:
object GetModule();
int GetTimeYear();
int GetTimeMonth();
int GetTimeDay();
int GetTimeHour();
float GetTimeHourDecimal(); <= 12.3456789 hours of current day length
int GetTimeMinute();
int GetTimeSecond();
Area and Object Functions:
object GetEnteringObject(); Gets the object that last opened or entered the calling object.
object GetExitingObject(); Get the object that last left the calling object.
object GetArea(object oTarget); Get the area that the target is located.
General All Use Functions:
General Functions that are fabulously useful but must be designed into how the engine works. These functions work on any entity, Area, and Module. Internally I am not certain how Bioware is doing this. In Unity and UE4 I made 2 dimensional arrays and populated these when the object is initialized/instantiated...etc. My arrays were set to 1000 variables possible to keep speed up and give enough room to store enough variable data for usage. The sVarName must be Unique so that the Array is being searched the sVarName Sets/Gets the proper data.
int GetLocalInt(object oObject, string sVarName);
void SetLocalInt(object oObject, string sVarName, int nValue);
float GetLocalFloat(object oObject, string sVarName);
void SetLocalFloat(object oObject, string sVarName, float fValue);
string GetLocalString(object oObject, string sVarName);
void SetLocalString(object oObject, string sVarName, string sValue);
object GetLocalObject(object oObject, string sVarName);
void SetLocalObject(object oObject, string sVarName, object oValue);
location GetLocalLocation(object oObject, string sVarName);
void SetLocalLocation(object oObject, string sVarName, location lValue); <= location lValue = Vector3 float x, float y, float z
<=INITIAL POST=>
Ticking off items on the list for this engine I could not find something. The Engine Script...or call this...Module
Something that was incredibly important in the Bioware Aurora Engine (NWN) is called Module. This is the Engine Entity (object) that can run scripts and hold information. It cannot be set directly like other objects (meaning cannot be edited/placed in a scene) and is rather special. Its main task is at runtime in handling lots of global information and the transfer of this information to/from scene/level objects.
examples:
- Global Time
- Global Engine Configurations
- Global Data to Transfer between Scenes
- Global Heartbeats
- Global Transforms of Teleportation Waypoints
In any case. Couple of questions.
If this feature is available in Skyline already...it is not apparent in how this is created.
If this feature can be made in Lua and implement with a Do Not Destroy On Load type mechanism....this will work.
This is a very important feature to a game engine to make all scenes/levels be completely in sync with each other and not simply isolated environments.
Thank You. Cheers
Olander