How to Extend Antistasi?
With the convertion to a mod Antistasi has added a lot of support for 3rd party mods to add to or alter its behaviour, this includes adding and overwriting Templates and Maps in the provided example on Github we have a example of doing just that, along with all the tools and steps to fully make your own mod to extend Antistasi
Once you have made your own mod with the additions or changes you wanted, simply load it alongside Antistasi the mod and voila you have succesfully added/changed a template/map to Antistasi.
An example Code for extending the Antistasi-mod can be found on Github.
Important things to modify
Important things to modify
Under addons/core/Includes you need to adapt
script_mod.hpp
to have a uniquePREFIX
andMODFOLDER
.Under all addons EXCEPT core you need to update
script_component.hpp
to have updateded path to match theMODFOLDER
define inscript_mod.hpp
.
#include "\x\${MODFOLDER}\addons\core\Includes\script_mod.hpp"
- Next you need to update all
$PBOPREFIX$
with the new pathx${MODFOLDER}addons${COMPONENT}
.All ${Something} should be replaced with their corresponding elements.
Example
If MODFOLDER is A3AE
you would replace all ${MODFOLDER} with A3AE.
#include "\x\A3AE\addons\core\Includes\script_mod.hpp"
Example additions
Example additions
Maps
mapInfo
and navGrid
data as well as global overwrite/addition.A3AE/addons/maps
.Templates
A3AE/addons/templates/Templates/Templates.hpp
.templates
addon to not miss important steps.Event-System
Mod integrated event system
Antistasi’s functionality is extendable by 3rd party mods through the events system, where you can subscribe to events whitin antistasi like for example vehicle initilisation.
A record of the events and their arguments can be found in the config under A3A >> Events
where the class name is the event name and the sub class params contains a list of the arguments in order of argument index, each element of this list contains a description
, a list of valid types
(array, string, number, …) and a flag for if it is optional
(not guarented to be passed along). In addition to this class of arguments is a flag for the execution location of the event (isLocal
, 1 = local, 0 = global)
Subscribe to an Event
To subscribe to an event you use the A3A_Events_fnc_addEventListener
.
/**
Description:
Add a listener to an event, allowing you to trigger functions when that event occurs
Arguments:
0. <String> Event identifier, as registered in configFile >> A3A >> Events
1. <String> Unique identifier of listener
2. <String|Code> Code block or name of function to excecute on event occurance
Return Value:
<Array<Event, ID>> data needed to remove listener
Scope: Any
Environment: unscheduled
Public: Yes
Dependencies:
Example:
*/
["AIVehInit", "A3A_Events_example", "someFuncName"] call A3A_Events_fnc_addEventListener;
["AIVehInit", "A3A_Events_example", {systemChat "Example event listener triggered!"}] call A3A_Events_fnc_addEventListener;
["AIVehInit", "A3A_Events_example", someFunc] call A3A_Events_fnc_addEventListener;
Unsubscribe an Event
To remove an event listener use the A3A_Events_fnc_removeEventListener
function.
/**
Description:
Removes a event listener
Arguments:
0. <String> Event the listener is subscribed to
1. <String> The event listeners unique identifier
Return Value:
<Nil|Array> Nil if failed, deleted event listener otherwise
Scope: Any
Environment: unscheduled
Public: Yes
Dependencies:
*/
Example: ["AIVehInit", "A3A_Events_example"] call A3A_Events_fnc_removeEventListener;
Unsubscribe all Events
To remove all event listener of a type use the A3A_events_fnc_removeAllEventListeners
function.
/**
Description:
Removes all event listeners subscribed to a particular event
Arguments:
0. <String> Event to remove listeners from
Return Value: <Nil|Array> Nil if failed, the removed listeners otherwise
Scope: Any
Environment: unscheduled
Public: Yes
Dependencies:
*/
Example: ["AIVehInit"] call A3A_Events_fnc_removeAllEventListeners;
Building the mod
Building the mod
ToolsBuilder
and edit buildAddons.ps1
.$addonName = "A3AE"
with $addonName = "${your addons main folder name}"
, so if you name your extension A3A-AltisRemade then the line would be $addonName = "A3A-AltisRemade"
, save the file and close it.Arma 3 Tools
-> DSUtils
& Publisher
).