WHAT I'M TRYING TO ACHIEVE
OK, so, I'm currently writing a script that will achieve the following;
Every 5 minutes (arbitrary number) the AI will post in side chat a "Battlefield Update" showing the current force pool and current number of profiles for BLUFOR.
However, I cannot for the life of me get it to pickup the values for force pool and profile count.
Some things to consider:
- I'd like this to show for every player in the game (hence the initPlayerLocal.sqf)
- If possible, I'd like this to run regardless of host type (i.e. a dedicated server or someone just hosting a multiplayer game from within the client)
MY CURRENT CODE
In my initPlayerLocal.sqf (this just pulls from a param, the host can turn these updates on/off;
// Battlefield updates Param if ((paramsArray select 12) == 1) then { [] execVM "battleUpdates.sqf"; };
In battleUpdates.sqf;
// Get number of BLUFOR profiles _profilesBySide = [ALiVE_profileHandler,"profilesBySide"] call ALIVE_fnc_hashGet; _profilesBySide = _profilesBySide select 1; // Get current BLUFOR force pool _currentBLUFORForcepool = [ALIVE_globalForcePool,"BLU_F"] call ALIVE_fnc_hashGet; // While loop to display chat from HQ using above variables while {true} do { sleep 10; [west, "HQ"] sideChat "BATTLEFIELD STATUS UPDATE"; [west, "HQ"] sideChat "We have " + str _profilesBySide + " units currently deployed in the AO. Our reinforcement pool currently stands at " + str _currentBLUFORForcepool + "."; if (_currentBLUFORForcepool < 20) then { [west, "HQ"] sideChat "Our reinforcement pool is low soldier!"; }; if (_currentBLUFORForcepool > 100) then { [west, "HQ"] sideChat "We have a surplus of reinforcements. Put them to work soldier!"; }; };
The problem
The error I get is _currentBLUFORForcepool and _profilesBySide are undefined, even though they are defined at the top of the file?
I really appreciate anyone who can help me with this :)
Thanks all!