Skip to content
Cyruz143 edited this page Apr 13, 2016 · 4 revisions

Admiral let's you to register scripts to different events in the mission. The script will be called when the event happens with specific arguments related to the event.

To register a script to an event, simply add a config with the event's name and set it's value to the script file's path. Example:

class Admiral {
    ...
    class Events {
        admiral_initialized = "path/to/admiral_initialized.sqf";
        zone_spawned_vehicle = "path/to/zone_spawned_vehicle.sqf";
        cqc_spawned_unit = "path/to/cqc_spawned_unit.sqf";
    };
};

Note that event's are executed in a non-sheduled enviroment, so if you want to use for example the sleep, waitUntil commands, you have to create a sheduled enviroment with the spawn command for them to work.

##Events

####admiral_initialized

  • Arguments: None
  • Locality: machine running Admiral

Called when all Admiral functions are compiled and all init function were called. Only called on the server or on HC machine if exists.

####zone_initialized

  • Arguments: [_zone]
    • _zone - The zone object that was initialized
  • Locality: machine running Admiral

Called when a zone object is initialized.

####zone_spawned_group

  • Arguments: [_group, _groupType, _zone]
    • _group - The group that was spawned
    • _groupType - The type of the group that spawned
    • _zone - The zone object that spawned the group
  • Locality: machine running Admiral

Called when a zone spawns a group.

####zone_spawned_unit

  • Arguments: [_unit, _unitType, _zone]
    • _unit - The unit that was spawned
    • _unitType - The type of the unit that spawned
    • _zone - The zone object that spawned the unit
  • Locality: machine running Admiral

Called when a zone spawns a unit.

####zone_spawned_vehicle

  • Arguments: [_vehicle, _groupType, _zone]
    • _vehicle - The vehicle that was spawned
    • _groupType - The type of the vehicle's group that spawned
    • _zone - The zone object that spawned the vehicle
  • Locality: machine running Admiral

Called when a zone spawns a vehicle.

####zone_spawned_crew

  • Arguments: [_crew, _unitType, _zone]
    • _crew - An array of units, the crew of the vehicle that was spawned
    • _unitType - The type of the crew units that spawned
    • _zone - The zone object that spawned the vehicle
  • Locality: machine running Admiral

Called when a zone spawns a crew for a vehicle.

####cqc_spawned_groups

  • Arguments: [_groups, _zone]
    • _groups - The array of groups that were spawned
    • _zone - The zone object that spawned the group
  • Locality: machine running Admiral

Called when a CQC zone spawns groups.

####cqc_spawned_group

  • Arguments: [_group, _building, _zone]
    • _group - The group that was spawned
    • _building - The bulding that the group spawned in
    • _zone - The zone object that spawned the group
  • Locality: machine running Admiral

Called when a CQC zone spawns a group.

####zone_spawned_unit

  • Arguments: [_unit, _building, _position, _unitType, _zone]
    • _unit - The unit that was spawned
    • _building - The bulding that the unit spawned in
    • _position - The building position that the unit was spawned at
    • _unitType - The type of the unit that spawned
    • _zone - The zone object that spawned the unit
  • Locality: machine running Admiral

Called when a CQC zone spawns a unit.

####patrol_spawned_groups

  • Arguments: [_infantryGroups, _technicalGroups, _armourGroups, _zone]
    • _infantryGroups - The array of infantry groups that were spawned
    • _technicalGroups - The array of technical groups that were spawned
    • _armourGroups - The array of armour groups that were spawned
    • _zone - The zone object that spawned the group
  • Locality: machine running Admiral

Called when a Patrol zone spawns groups.

####patrol_spawned_group

  • Arguments: [_group, _groupType, _zone]
    • _group - The group that was spawned
    • _groupType - The type of the group that spawned
    • _zone - The zone object that spawned the group
  • Locality: machine running Admiral

Called when a Patrol zone spawns a group.

####patrol_spawned_unit

  • Arguments: [_unit, _building, _position, _unitType, _zone]
    • _unit - The unit that was spawned
    • _building - The bulding that the unit spawned in
    • _position - The building position that the unit was spawned at
    • _unitType - The type of the unit that spawned
    • _zone - The zone object that spawned the unit
  • Locality: machine running Admiral

Called when a CQC zone spawns a unit.

####camp_spawned_groups

  • Arguments: [_infantryGroups, _technicalGroups, _armourGroups, _zone]
    • _infantryGroups - The array of infantry groups that were spawned
    • _technicalGroups - The array of technical groups that were spawned
    • _armourGroups - The array of armour groups that were spawned
    • _zone - The zone object that spawned the group
  • Locality: machine running Admiral

Called when a Camp zone spawns groups.

Clone this wiki locally