Jump to content
Sign in to follow this  
x39

XEventSystem - Create custom events for your mod/mission with ease

Recommended Posts

XEventSystem 1.0.0



XEventSystem is a function libary which was created to provide and standarize the custom event creation for large scripting based mods/missions.

It will not provide any features for endUsers (meaning this is an addon which is only made for devs!)

Made By X39 (Cpt. HM Murdock)

DOWNLOAD V1.0


How To Install (as addon):

  1. Unzip the file
  2. Move the "@XEventSystem" folder to your ArmA 3 dir (or to the directory you move your mods to by default)
  3. Add "-mod=@XEventSystem" to your launch parameters OR start the game and enable the mod at "Configuration>>Expansions"
  4. Start using it (please take a look into the devReadMe.txt until the wiki for this is done)

How To Install (as mission libary):

  1. Unzip the file
  2. UnPBO the "@XEventSystem/Addons/x39_eventsystem_core.pbo"
  3. Move the content of the entire pbo (starting with the folder "x39_eventsystem_core") into your mission folder
  4. Add the following lines to your init.sqf (after theese lines you can start using the mod)
       _res = [nil] execVM "\X39_EventSystem_Core\X39_EventSystem\createFunctions.sqf"; waituntil{scriptDone _res};
       _res = [nil] execVM "\X39_EventSystem_Core\X39_EventSystem\Functions\initMod.sqf"; waituntil{scriptDone _res};
    


  5. Start using it (please take a look into the devReadMe.txt until the wiki for this is done)

devReadMe.txt (might not be up to date! Current version: 1)

Preamble:
   This ReadMe is supposed to be read by a mission maker (or addon developer ... yeah you know what i mean ^^)
   so if you only want to use the mod as enduser - - - STOP READING (you wont get any profit from it :P)
----------------------------------------------------------------------------------------------------------------

TableOfContent:
   1. Concept of the event system
       A. What are namespaces?
       B. What are events?
   2. Registering a namespace
   3. Registering an event
   4. Adding a handler
   5. Triggering events
   6. Function Reference
       A. Mod Initialization
           a. X39_EventSystem_fnc_initMod
       B. Base functionality
           a. X39_EventSystem_fnc_getAvailableEvents
           b. X39_EventSystem_fnc_getAvailableNamespaces
           c. X39_EventSystem_fnc_registerEvent
           d. X39_EventSystem_fnc_registerNamespace
           e. X39_EventSystem_fnc_syncEventBase
           f. X39_EventSystem_fnc_triggerEvent
       C. Further extending
           a. X39_EventSystem_fnc_addEventHandler
           b. X39_EventSystem_fnc_removeEventHandler
           c. X39_EventSystem_fnc_getEventHandlers
           d. X39_EventSystem_fnc_isEventExisting
   7. Using the XEventSystem without the need of a seperate addon

(1) Concept of the event system
   The idea behind this system is that you can create custom events in your very own namespace
   where you or another one can create handlers for those events you created before

   (1.A) What are namespaces?
       Namespaces are a sorting mechanic to seperate the different custom event handlers.
       Through an own namespace you can create a "fire" event in two different mods without
       having the problem of conflicts!
   (1.B) What are events?
       Events are things which can be triggered by the modder to provide other modders (or himself)
       a scaleable extension system on the base of a mod.
       For example: you create the event "gotKilled" in your mod
       Now a modder can register a handler for "gotKilled" which will be executed with the given
       parameters and will (if wanted) return a value.
       If you still dont know what events are ^^ then check out the ArmA events (as this is nothing
       different)
(2) Registering a namespace
   To register a new namespace you need to call "X39_EventSystem_fnc_registerNamespace" (see chapter 5 for parameters)
   by default there is the "mission" namespace already registred
(3) Registering an event
   To register a new event you need to call "X39_EventSystem_fnc_registerEvent" (see chapter 5 for parameters)
(4) Adding a handler
   To add a new eventHandler you need to call "X39_EventSystem_fnc_addEventHandler" (see chapter 5 for parameters)
   To remove an eventHandler you need to call "X39_EventSystem_fnc_removeEventHandler" (see chapter 5 for parameters)
(5) Triggering events
   To trigger an event you need to call "X39_EventSystem_fnc_triggerEvent" (see chapter 5 for parameters)

(6) Function Reference
   (6.A) Mod Initialization
       (6.A.a) X39_EventSystem_fnc_initMod
           Parameters:
               N/A
           Return value:
               N/A
           Notes:
               Initialize the XEventSystem

   (6.B) Base functionality
       (6.B.a) X39_EventSystem_fnc_getAvailableEvents
           Parameters:
               0. Optional Parameter: String - Name of the namespace - Default 'mission'
               1. Optional Parameter: Namespace - namespace to use - Default 'missionNamespace'
           Return value:
               Array - Array containing the Events of the given CustomNamespace
           Notes:
               get customEventHandlers in given namespace

       (6.B.b) X39_EventSystem_fnc_getAvailableNamespaces
           Parameters:
               0. Optional Parameter: Namespace - namespace to use - Default 'missionNamespace'
           Return value:
               Array - Array containing the registered namespaces
           Notes:
               get registered namespaces

       (6.B.c) X39_EventSystem_fnc_registerEvent
           Parameters:
               0. Required Parameter: String - Name of the custom event handler
               1. Optional Parameter: String - Name of the namespace
               2. Optional Parameter: Namespace - namespace to use. Default missionNamespace
           Return value:
               Boolean - false if event already existed or creation was not successfull true if not
           Notes:
               Add a CustomEvent to the mission

       (6.B.d) X39_EventSystem_fnc_registerNamespace
           Parameters:
               0. Required Parameter: String - Name of the namespace
               1. Optional Parameter: Namespace - namespace to use. Default missionNamespace
           Return value:
               Boolean - false if namespace already existed or creation was not successfull true if not
           Notes:
               Add a namespace to the mission

       (6.B.e) X39_EventSystem_fnc_syncEventBase
           -/- Not working currently!

       (6.B.f) X39_EventSystem_fnc_triggerEvent
           Parameters:
               0. Required Parameter: String - Name of the customEventHandler
               1. Required Parameter: Array - parameters for the customEventHandler
               2. Optional Parameter: Boolean - if true the event awaits a return value (see @Return), if false the EHs will be spawned asynchron
               3. Optional Parameter: String - Name of the namespace
               4. Optional Parameter: Namespace - namespace to use. Default missionNamespace
           Return value:
               Array - empty if not was fired or param 3 was false (so no return value was expected), will contain the last result of a customEventHandler if true
           Notes:
               Trigger an event

   (6.C) Further extending
       (6.C.a) X39_EventSystem_fnc_addEventHandler
           Parameters:
               0. Required Parameter: String - Name of the custom event handler
               1. Required Parameter: Code - Code to handle the event
               2. Optional Parameter: String - Name of the namespace
               3. Optional Parameter: Namespace - namespace to use. Default missionNamespace
           Return value:
               Integer - >= 0 if was successfully which represents the ID of the EventHandler
           Notes:
               Add a handler to an event

       (6.C.b) X39_EventSystem_fnc_removeEventHandler
           Parameters:
               0. Required Parameter: Integer - EventHandler ID
               1. Required Parameter: String - Name of the custom event handler
               2. Optional Parameter: String - Name of the namespace
               3. Optional Parameter: Namespace - namespace to use. Default missionNamespace
           Return value:
               Boolean - true if the handler was removed, false if not
           Notes:
               Remove a handler from an event

       (6.C.c) X39_EventSystem_fnc_getEventHandlers
           Parameters:
               0. Required Parameter: String - Name of the custom event handler
               1. Optional Parameter: String - Name of the namespace
               2. Optional Parameter: Namespace - namespace to use. Default missionNamespace
           Return value:
               Array - free eventHandler slots are filled with -1
           Notes:
               get all handlers of an event

       (6.C.d) X39_EventSystem_fnc_isEventExisting
           Parameters:
               0. Required Parameter: String - Name of the custom event handler
               1. Optional Parameter: String - Name of the namespace
               2. Optional Parameter: Namespace - namespace to use. Default missionNamespace
           Return value:
               Boolean - true if event is existing, false if not
           Notes:
               Check if an event is existing
(7) Using the XEventSystem without the need of a seperate addon
   So you want to use the XEventSystem without an addon?
   Well that easy to realize :F
   Just unPBO the addon and put everything to your mission folder (!MISSION FOLDER! Addons need to be created through refering to this modification!).
   After you did, you just need to use the following commands to initialize the mod:
   {
       _res = [nil] execVM "\X39_EventSystem_Core\X39_EventSystem\createFunctions.sqf";
       _res = [nil] execVM "\X39_EventSystem_Core\X39_EventSystem\Functions\initMod.sqf";
   }
   NOW you can use the mod as usual ^^
   have fun

Changelog

1.0.0

  • RELEASE

Edited by X39

Share this post


Link to post
Share on other sites

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Hey X39, is XEventSystem kinda substitute for CBA_A3??? (without the dash bug on A2 maps, mods that doesn´t load arter reloading a mission etc)

Share this post


Link to post
Share on other sites
;2583557']Hey X39' date=' is XEventSystem kinda substitute for CBA_A3??? (without the dash bug on A2 maps, mods that doesn´t load arter reloading a mission etc)[/quote']

i cant anser your question (as i never used CBA (i just hated it as it was spamming my chat with messages))

sorry

i mainly developed this for my mod

XMedSys

to provide all those modders out there a way to add content to the mod (which is not important at the current state but it will get later)

Share this post


Link to post
Share on other sites
(as i never used CBA (i just hated it as it was spamming my chat with messages))

No mate, You can't say that.... :p

Share this post


Link to post
Share on other sites
No mate, You can't say that.... :p

*never used it for scripting*

better?

i know that i had used it (ACRE and ACE needed to have ... so there was no way around) but i still just hate it and was never happy about using it!

Share this post


Link to post
Share on other sites

XEventSystem is now part of XLib >0.1.1

can be closed so

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×