Profiling unit spawned by script

  1. 9 years ago

    Hi,
    I had a question.
    If I set the virtual profile module to profile non sync unit, will it profile unit that get spawn by script mid game?

    Thanks.

  2. No you will need to run some additional code to add spawned units to ALiVE.. .check here for more info:

    http://alivemod.com/wiki/index.php/Script_Snippets

  3. Yeah I took a look at it, no clue how to use it.

  4. Edited 9 years ago by SavageCDN

    Drop this in your init.sqf (or your initServer.sqf if you have one):

    if (isServer) then {
        [] spawn {
            while {true} do {
                sleep 60;
                [] call ALiVE_fnc_createProfilesFromUnitsRuntime;
            };
        };
    };
  5. Edited 9 years ago by ElectroEsper

    Another question in link with this.

    If I sync unit to the Virtual AI System (while it being set to not virtualise sync groups), will that make so that said units won't be profiled and/or cached? Even with that script you posted?

  6. No it will not ignore those units.. it will indeed profile them after 60 seconds... reply from dev:

    "init will happen, profile will profile, ignore units synced, then 60 sec later the script will run and profile everything. Better to use that function at the group level as they are spawned"

  7. Edited 9 years ago by ElectroEsper

    Not entirely sure how to proceed then.

    I do not understand at all the script "Spawn & Profile Group Script By Jman" here : http://alivemod.com/wiki/index.php/Script_Snippets

    I use this to spawn what I have to spawn:

    _grp2 = [getMarkerPos "amb2", _side, (configfile >> "CfgGroups" >> "EAST" >> "OPF_G_F" >> "Infantry" >> "ORG_InfTeam")] call BIS_fnc_spawnGroup;

    How then would that translate over? Because I need 5 units to not get cached/profiled absolutly(editor placed), but the rest needs to be(spawned by alive and by script).

    Nevermind, found out.

 

or Sign Up to reply!