Author: RAVEN
Author Website: http://www.armedassault.com.ar/

Requirements: No addons required

Version: 1.02

Short description: Function to generate combat units groups after a SP or MP mission already started

Date: 2009-06-29 07:20


Comments: (1)
Rating:



 

3-rav_01.jpg 3-rav_02.jpg 3-rav_03.jpg

CreatAll
by
RAVEN


Description:
It's a function to generate combat units groups after a SP or MP mission already started.
CreateAll, has in the same function call, the capacity to create groups with these features:
    - Any side.
    - Any place.
    - Any morphology (infantry, armour, trucks, choppers, etc.) or any combination of them.
    - With a crew number or not at all (empty vehicles), or with max capacity, not needing to know how many enters in any vehicle.
    - With official units (BIS) or custom ones (mod.)
    - Giving a name to the groups or not.
    - With any combat behavior (safe, aware, combat, etc.).
    - Any formation desired (wedge, column, V, etc.).
    - With an specific speed.
    - With a 'Way Points' route predefined.
    - Possibility to chain other actions through other functions or scripts.


Usage:
A typical call for CreateAll looks like:
_handler = [Bando, origen, TipoUnidades, CantUnidades, 
Skill/CantVehiculos, ArrayUnidades, NombreGrupo", EstadoGrupo, 
TipoFormacion, Velocidadgrupo, ArrayWPs] spawn handCreateAll; 

Before starting, something must be clear.
    1) CreateAll, as any other function must be pre-compiled to be exec in any mission. To do this you have to use the COMPILE command in the init.sqf and only after doing this we can use it in the mission:
    handCreateAll = compile preprocessFile "CreateAll.sqf"; 


    2) After compiling and BEFORE starting to create groups of units, we have to create
    the relationship between the different sides which will be in the mission.
    This is nothing but tell to CreateAll which sides are "friends" or "enemies".
    We do this by calling the function with an special parameters structure:
    _handler = ["setsides",[west, resistance],[east]] spawn handCreateAll; 
    This gives us the possibility to create unusual relationships between the different sides,
    we can set two sides which are "known" enemies (east and west) as friends and make the resistance
    be their enemies or even the civilians.
    We have so many options, that we can for example place civilian units in all sides
    and even make that all sides are enemies among them, having a game with 4 sides fighting each other.
    The first parameter(setsides) must be a character one and the next two must be arrays containing
    the names of the sides(without ""). An array for the friends and other for the enemies. IF we want
    more than 2 sides, we just have to repeat the process with the new sides.
    _handler = ["setsides",[west],[east]] spawn handCreateAll; 
    _handler = ["setsides",[resistance],[east]] spawn handCreateAll; 
    _handler = ["setsides",[resistance],[west]] spawn handCreateAll; 
    _handler = ["setsides",[east],[west]] spawn handCreateAll; 
    _handler = ["setsides",[civilian, west],[resistance, east]] spawn 
    handCreateAll; 
    (Last version CreateAll (v1.0) supposed that all sides where enemies among them).

    3) CreateAll uses, to create the objects, the names of the �tipos de unidades� (unit types), from a name array which can be specified in 2 zones:
      a) Before calling the function in the INIT.SQS:
      unidadesE = ["TeamLeaderE","SoldierEB","SoldierEB","SoldierEB"]; 
      b) In the call itself in an explicit form:
      _handler = [Bando, origen, TipoUnidades, CantUnidades, 
      Skill/CantVehiculos, ["TeamLeaderE","SoldierEB"], NombreGrupo", 
      EstadoGrupo, TipoFormacion, Velocidadgrupo, ArrayWPs] spawn 
      handCreateAll; 
Please read the manual included to learn about any of the 11 parameters this function can use and much more.


Notes:
The original manual is in Spanish and you can find it in the Manual_CreateAll.pdf file. I (Big) translated it and this translation can be found in the Manual_CreateAll(english).txt file.
As you can see i only translated the text so i suggest you to open both manuals and check both reads at the same time.
Please forgive any spelling mistakes as well as any translation errors which I'm sure exist.


Change log:
v1.02:
- code reworked
- more compatibility with external functions

v1.01:
- added possibility to create unusual relationships between the different sides
- fixed problem with mixed groups (infantry and aircraft) where the aircraft started on ground.


Forum topic:
- armedassault.com.ar (in Spanish)




Enable javascript to be able to download from Armaholic please!



Tags: No tags