Navigation menu

WildStar:AddOn loading process: Difference between revisions

Jump to navigation Jump to search
Created page with "{{WildStar/uiaddon}} This document describes the WildStar load order for loading AddOns. It covers when the WS client first starts up, when AddOns load for the first ..."
(Created page with "{{uiaddon}} This document describes the WildStar load order for loading AddOns. It covers when the WS client first starts up, when AddOns load for the first time, and...")
 
(Created page with "{{WildStar/uiaddon}} This document describes the WildStar load order for loading AddOns. It covers when the WS client first starts up, when AddOns load for the first ...")
Line 1: Line 1:
{{uiaddon}}
{{../uiaddon}}


This document describes the [[WildStar]] load order for loading [[AddOn]]s. It covers when the WS client first starts up, when AddOns load for the first time, and when user or WS reloads the [[UI]]. The availability of the Lua environment at various points in the process is also detailed. The term '[[WS Client]]' means: the WS game program that's launched to play WildStar.  
This document describes the [[w:c:wildstaronline:WildStar|WildStar]] load order for loading [[AddOn]]s. It covers when the WS client first starts up, when AddOns load for the first time, and when user or WS reloads the [[UI]]. The availability of the Lua environment at various points in the process is also detailed. The term 'WildStar Client' means: the WildStar game program that's launched.


== General steps ==
== General steps ==
Line 11: Line 11:
* PreGame - First, the WS client loads a few pre-game UI AddOn components for the login, and other pre-game screens, from the same sets of UI files used for general AddOns, which are located in both "[usersettings]\NCSOFT\WildStar\AddOns" directory and the game data files in the asset path "UI".  
* PreGame - First, the WS client loads a few pre-game UI AddOn components for the login, and other pre-game screens, from the same sets of UI files used for general AddOns, which are located in both "[usersettings]\NCSOFT\WildStar\AddOns" directory and the game data files in the asset path "UI".  


* Discovery - In the load process for any AddOn, the client looks for sub-folders containing a valid [[TOC file]]s, with a 'toc.xml' name and opens and executes the file to load the AddOn.  For a user AddOn to be considered valid, it must have a single word folder somewhere inside the "[usersettings]\...\AddOns" folder, and must have a file named 'toc.xml', such as a 'MyAddon' folder with a valid 'toc.xml' file underneath.  That is all that is required.
* Discovery - In the load process for any AddOn, the client looks for sub-folders containing a valid [[../TOC file/]]s, with a 'toc.xml' name and opens and executes the file to load the AddOn.  For a user AddOn to be considered valid, it must have a single word folder somewhere inside the "[usersettings]\...\AddOns" folder, and must have a file named 'toc.xml', such as a 'MyAddon' folder with a valid 'toc.xml' file underneath.  That is all that is required.


* Reload - During any load or reload of the UI, TOC files will be searched for again and AddOns or files that didn't exist during initial load, can be loaded by the game later on. This makes it possible to install additional AddOns, or load updated TOC files, without restarting the client.
* Reload - During any load or reload of the UI, TOC files will be searched for again and AddOns or files that didn't exist during initial load, can be loaded by the game later on. This makes it possible to install additional AddOns, or load updated TOC files, without restarting the client.
Line 30: Line 30:


== Inside loading the TOC file ==
== Inside loading the TOC file ==
Files within an AddOn are loaded in the order they're listed in the AddOn's [[TOC file]], named "toc.xml", and as a part of the AddOn itself, which is defined using the ''Addon'' attributes. See [[TOC file]] for reference.
Files within an AddOn are loaded in the order they're listed in the AddOn's [[../TOC file/]], named "toc.xml", and as a part of the AddOn itself, which is defined using the ''Addon'' attributes. See [[../TOC file/]] for reference.


* AddOn attributes - When the ''Addon'' element XML in the [[TOC file]] is loaded, only the Apollo ''AddOn'' item itself is created and its meta data like name, author, version, are available immediately to any subsequent Lua code by Name attribute through Apollo API.
* AddOn attributes - When the ''Addon'' element XML in the [[../TOC file/]] is loaded, only the Apollo ''AddOn'' item itself is created and its meta data like name, author, version, are available immediately to any subsequent Lua code by Name attribute through Apollo API.


* AddOn files - File are loaded through XML <Script file="src.lua" /> or <Form file="src.xml" /> and Script files are loaded at the time the tag is encountered while parsing. Form files are accounted for but not fully loaded and created until expressly requested in code.
* AddOn files - File are loaded through XML <Script file="src.lua" /> or <Form file="src.xml" /> and Script files are loaded at the time the tag is encountered while parsing. Form files are accounted for but not fully loaded and created until expressly requested in code.


* AddOn Scripts - The TOC file, for regular AddOns, is responsible for loading a Lua file to define register its actual AddOn Lua instance. During Lua file execution in the AddOn load process, the world has already been loaded, and most of the game state is known and available through the [[UI API]].
* AddOn Scripts - The TOC file, for regular AddOns, is responsible for loading a Lua file to define register its actual AddOn Lua instance. During Lua file execution in the AddOn load process, the world has already been loaded, and most of the game state is known and available through the [[../UI API/]].


* AddOn Forms - The TOC file, for regular AddOns, is responsible for itemizing Form .xml files to register AddOn relative Forms and UI widgets. Lua code can ask that an instance is generated from a registered form any time, which should normally be done during or after OnLoad.
* AddOn Forms - The TOC file, for regular AddOns, is responsible for itemizing Form .xml files to register AddOn relative Forms and UI widgets. Lua code can ask that an instance is generated from a registered form any time, which should normally be done during or after OnLoad.
Line 89: Line 89:


==== Instance transition ====
==== Instance transition ====
# {{api|API EVENT|ChangeWorld}}() - event
# {{../api|API EVENT|ChangeWorld}}() - event
#* This event fires after player has changed instance servers, like when entering or exiting a dungeon.
#* This event fires after player has changed instance servers, like when entering or exiting a dungeon.
#* Does not fire when player first enters game world from the character screen, as the UI and AddOns load after the player has entered. AddOns must register for this event.
#* Does not fire when player first enters game world from the character screen, as the UI and AddOns load after the player has entered. AddOns must register for this event.
Line 95: Line 95:


== See also ==
== See also ==
* [[Handling events]] for information on how to sign up to receive event
* [[../Handling events/]] for information on how to sign up to receive event