This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ~ ~ NOTOC~ ~ Scripting: Communication with Modules Not all dynamic controllers are created by script. In some situations it is easier and better for performance to use the module system. Skyline will happily run an object containing both a script, either external or micro script and a visual module graph. Tools have been provided for inter system communication between scripts and modules, lets take a look. <grid><col sm="6"> callModuleEvent() - To call a module From within a lua script, you can call the lua module event command. This will then be picked up in the targetID graph, and be used to cause the receiving module to pass a module Event signal. -- | ARGUMENTS -- callerID, targetID, key, type, value -- | param: objID - is the id of the entity calling the module. This should be obj or objID. -- | param: targetID - is the id of the target entity we want trigger the event on. This can be itself as the same entity may contain a script, and a graph. -- | param: key - identifier is the name attached to the target module "Lua Event" -- | param: type - is either "int", "float", "bool", "string", etc... sky.callModuleEvent(objID, targetID, "stopActivate", "int", "1") In the object with the ID of targetID, you would then require a receiving module. </col> <col sm="6"> Receiving Module In the receiving objects graph, use the "Lua Event" module located in the category "Lua". This module requires a key identifier,sent from the lua command. Upon a call from sky.callModuleEvent(..), this module will send an Event signal and the received value, out of its connectors. <well> </well> </col></grid> <grid><col sm="6"> Module to script communication The final way of communicating is from module into a lua script. This is used as such: <well> </well> If you are calling a microscript, then the bottom property needs to be set to checked using a Boolean variable module. If its an external script, then leave it as it is shown in the picture above. </col> <col sm="6"> Receiving script Any signal passed from a module can be received by a Lua script function of the same name passed into the module. ie: function PlayerKO( eID, value) -- ..... run code ..... end As you can see, there are plenty of ways of communicating in skyline. There are also action setters and getters, nut this is for another time… </col></grid> <-manual_scripting:manual_scripting_communication_scripts|Previous: Communicating with Scripts^manual_scripting:manual_scripting_index|Scripting Index^manual_scripting:manual_scripting_communication_actions|Next: Communicating with Actions → Detach Close Document TOC Developer Sidebar SidebarDev HTML5 Bootstrap Commands Nav Menu Example TOC Ideas Site Index Layout: Tutorial Intro Layout: Tutorial Page Layout: FAQ Page Layout: Index Home Welcome What is Skyline Terminology FAQ FAQ Index Working on Scenes Scripting Assets General Info Installation and Setup Game Objects Manual Scripting Index Script Overview Micro Scripts External Scripts Scene Scripts Events Tags and ID's Communicating with Scripts Communicating with Modules Communicating with actions Dynamic Properties Learning Tutorials Index Basic Character Basic Shooting Guides Index Getting Started Video Tutorials Index