Script Defined Factions / Groups

  1. 8 years ago
    Edited 8 years ago by looter

    It would be incredibly useful if inside of a missions init.sqf , we could call an alive function that allows us to define custom factions that aren't defined inside of CfgFactions of addons. It would accept a multidimensional array of Faction->Groups->Units, which would allow this faction name to be specified in ALiVE's modules for spawning, etc.

    Example

    private ["_MyFactions", "_factionone", "_factiontwo"];
    
    _factionone = [
      "custom_faction", [
        ["customgroup", "Infantry", ["unitclass1", "unitclass2"]], 
        ["customgroup2", "Armored", ["unitclass1", "unitclass2"]]
      ]
    ];
    
    _factiontwo = [
      "custom_faction2", [
        ["customgroup", "Infantry", ["unitclass1", "unitclass2"]], 
        ["customgroup2", "Armored", ["unitclass1", "unitclass2"]]
      ]
    ];
    
    _MyFactions = [_factionone, _factiontwo];
    
    [_MyFactions] call ALIVE_fnc_DefineCustomFaction;
  2. Friznit

    8 Feb 2016 Administrator

    Have you checked this? http://alivemod.com/wiki/index.php/Declaring_Faction_Mappings

  3. Edited 8 years ago by looter

    @Friznit Have you checked this? http://alivemod.com/wiki/index.php/Declaring_Faction_Mappings

    This looks very close to what I need, does it allow you to specify the individual units that are in the groups, and is there a way I could use these mappings inside of ALiVE modules like I would a normal addon faction?

  4. Friznit

    8 Feb 2016 Administrator

    Not quite. ALiVE still needs a group config to read. In theory you should be able to create a group config calling from any set of addons and as long as you format it correctly and give it a unique name, ALiVE should recognise it. You'd need to get familiar with out configs work - probably some stuff on the BI Wiki about that somewhere.

  5. ^ factions mixed with other factions nice

 

or Sign Up to reply!