Jump to content
Zenophon

Zenophon's ArmA 3 Co-op Mission Making Framework

Recommended Posts

Guest

Thanks for informing us of the new version :)

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites
Awesome, cannot wait to try out the new custom loadouts tonight!

Zen, another question for you: In my mission, I am using the variable ENEMY SIDE which is set to East. This means that all of my enemy soldiers are middle eastern - but my mission is set in Europe, so it does not look right. I know I could use RESISTANCE to make them all independent (which has a less middle eastern looking player model) but ideally I would like to keep the enemy as Opfor but switch the player models. Reading the Zen_SpawningFunctions.txt, I think I could do it like this?

// Example 1 - current spawning code
_enemyGroup = [_spawnPos, ENEMY_SIDE, AI_SKILL, [4,8]] call Zen_SpawnInfantry; 

// Example 2 - modified spawning code
_enemyGroup = [_spawnPos, ENEMY_SIDE, AI_SKILL, [4,8],"Men", "IND_F"] call Zen_SpawnInfantry; 

If I understand correctly, the side would be opfor but the unit would be an independant model, but appearing as an opfor unit - is this correct? Is this the best way to do that?

Argument 6 of Zen_SpawnInfantry is an additional config filter value, along with the side and type ('Men' in this case). However, there are no objects of faction 'IND_F' on the East side. Thus the search will return nothing, and Zen_SpawnInfantry should print an error.

In order to change the objects being spawned, you need to filter based upon valid config combinations. This involves looking through the config files for the values. All of this is explained in a lot more detail in the Zen_RandomBattle demonstration.

The alternative is to use loadouts to change the appearance of units. You can apply uniforms from any side to spawned units; the loadout functions will force them on. Players will see no difference between true Resistance side units and East units wearing Indfor equipment, except for the voices (that can changed as well).

Share this post


Link to post
Share on other sites

Hi Zen,

The custom loadout changes work great - thanks!

Re the unit selection, that kind of makes sense - I need a little help to understand this better. First off, the only way I could address this through custom loadouts would be to give all of the enemy units balaclavas! As you can see from the screenshot below, the enemy units look middle eastern, not european:

2014-09-20_00001_zpsfcd531a5.jpg

So I understand I need a valid config combination. I am using the Swedish Forced Mod due to the large number of thematically appropriate units. This mod adds an EAST faction of russians - perfect for what I want to do. I have all of the class names for these units, and the custom loadout will take care of the gear - but how do I call them in? Their faction name is "sfp_rus_faction", in the editor they are listed as OPFOR units. When i use this code:

 _enemyGroup = [_spawnPos, ENEMY_SIDE, AI_SKILL, [4,8], "men", "sfp_rus_faction"] call Zen_SpawnInfantry; 

I get Zen_CheckArgument Error - Argument 2 is void 6.915 [[],<NULL-group>]

Would I be better served using Zen_ConfigGetVehicleClasses to pull their classnames into an array - but how would I target just the sfp_ units?

Any advice would be gratefully received!

// EDIT /////////////////////

So I finally got time to do another group playtest tonight, with Zen_TrackInfantry enabled. After hitting a couple of towns, 2 grids failed to turn green (the other 6 DID turn green). How do I go about isolating this bug? I examined the rpt file from the server, but I could see no reference to the framework in there... I am not sure how to proceed from here, can you advise me please?

Aside from this issue, the mission played great! As soon as I clear these last bits up I will be ready to release.I

Edited by CallMeSarge
Typos & new info

Share this post


Link to post
Share on other sites

hello zen and users

i would like if you wouldn't mind some more information on using Zen_ConfigGetLocations

from what i understand is that it should spawn markers at locations around altis and would allow me to spawn infantry and motorized groups around towns while using strategic areas for enemy armour and reinforcements

so from this piece of code taken from the infantry patrol demo i should be able to spawn infantry at towns and villages easily

// spawning cars in towns, it is done this way so we don't spawn in one town twice, as calling Zen_SpawnAmbientVehicles twice would
   _a_m_remove = [];
   {
       if ((([_x, _p_ret_playerCenter] call Zen_Find2dDistance) < 1500) || (([_x, _p_ret_objective] call Zen_Find2dDistance) < 1500)) then {
           _a_m_remove set [(count _a_m_remove), _x];
           for "_j" from 0 to (2 + random 2) do {
               _p_ret_spawnCar = [_x, 0, [], 1, [2, 500], 0, [1,0,15]] call Zen_FindGroundPosition;
               _s_ret_vehType = [CIV_VEHICLES] call Zen_ArrayGetRandom;
               _o_ret_civVeh = [_p_ret_spawnCar, _s_ret_vehType, 0, random 360] call Zen_SpawnVehicle;
               // 0 = [_p_ret_spawnCar] call Zen_SpawnMarker; // debug
           };
       };
   } forEach _a_m_towns;
   _a_m_towns = _a_m_towns - _a_m_remove;



_a_m_towns = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

however i change it to this but i have no luck

    _a_m_remove = [];
   {
       if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
           _a_m_remove set [(count _a_m_remove), _x];
           for "_j" from 0 to (2 + random 2) do {
               _spawnPos = [_x] call Zen_FindGroundPosition;
               _enemyGroup = [_spawnPos, east, AI_SKILL, [4,8]] call Zen_SpawnInfantry;
               0 = [_TownArray, _enemyGroup] call Zen_ArrayAppend;
               // 0 = [_spawnPos] call Zen_SpawnMarker; // debug
           };
       };
   } forEach _a_m_towns;
   _a_m_towns = _a_m_towns - _a_m_remove;



_a_m_towns = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

Share this post


Link to post
Share on other sites
Hi Zen,

The custom loadout changes work great - thanks!

Re the unit selection, that kind of makes sense - I need a little help to understand this better. First off, the only way I could address this through custom loadouts would be to give all of the enemy units balaclavas! As you can see from the screenshot below, the enemy units look middle eastern, not european:

So I understand I need a valid config combination. I am using the Swedish Forced Mod due to the large number of thematically appropriate units. This mod adds an EAST faction of russians - perfect for what I want to do. I have all of the class names for these units, and the custom loadout will take care of the gear - but how do I call them in? Their faction name is "sfp_rus_faction", in the editor they are listed as OPFOR units. When i use this code:

 _enemyGroup = [_spawnPos, ENEMY_SIDE, AI_SKILL, [4,8], "men", "sfp_rus_faction"] call Zen_SpawnInfantry; 

I get Zen_CheckArgument Error - Argument 2 is void 6.915 [[],<NULL-group>]

Would I be better served using Zen_ConfigGetVehicleClasses to pull their classnames into an array - but how would I target just the sfp_ units?

Any advice would be gratefully received!

// EDIT /////////////////////

So I finally got time to do another group playtest tonight, with Zen_TrackInfantry enabled. After hitting a couple of towns, 2 grids failed to turn green (the other 6 DID turn green). How do I go about isolating this bug? I examined the rpt file from the server, but I could see no reference to the framework in there... I am not sure how to proceed from here, can you advise me please?

Aside from this issue, the mission played great! As soon as I clear these last bits up I will be ready to release.I

You can try:

_classList = ["Men", east, "All", "sfp_rus_faction"] call Zen_ConfigGetVehicleClasses;

You can find the correct arguments in the config for the addon units; the first argument is called 'vehicleClass', the second is 'side', ignore the third, the fourth is 'faction'. Since you have the faction right, I can only guess that they are not 'Men'.

For the grids not clearing, I would use Zen_TrackInfantry to debug where exactly all Opfor units are. Don't worry about spawning many threads; it's just debug. Then in the loop that checks each spawned marker for being clear, put in some debug like:

diag_log (_townPatrolsArray select _forEachIndex);
diag_log _groupsArray;
diag_log _x;
diag_log (getMarkerPos _x);
diag_log (getMarkerColor _x);
diag_log ([_x, [], east] call Zen_GetAllInArea);
// After check
diag_log "Area Clear";

If there are no unit alive or in the marker, and it's not cleared, then the fault is with the check. If nothing prints out for those markers, then the problem is with how they are being created and appended to the arrays.

hello zen and users

i would like if you wouldn't mind some more information on using Zen_ConfigGetLocations

from what i understand is that it should spawn markers at locations around altis and would allow me to spawn infantry and motorized groups around towns while using strategic areas for enemy armour and reinforcements

so from this piece of code taken from the infantry patrol demo i should be able to spawn infantry at towns and villages easily

// spawning cars in towns, it is done this way so we don't spawn in one town twice, as calling Zen_SpawnAmbientVehicles twice would
   _a_m_remove = [];
   {
       if ((([_x, _p_ret_playerCenter] call Zen_Find2dDistance) < 1500) || (([_x, _p_ret_objective] call Zen_Find2dDistance) < 1500)) then {
           _a_m_remove set [(count _a_m_remove), _x];
           for "_j" from 0 to (2 + random 2) do {
               _p_ret_spawnCar = [_x, 0, [], 1, [2, 500], 0, [1,0,15]] call Zen_FindGroundPosition;
               _s_ret_vehType = [CIV_VEHICLES] call Zen_ArrayGetRandom;
               _o_ret_civVeh = [_p_ret_spawnCar, _s_ret_vehType, 0, random 360] call Zen_SpawnVehicle;
               // 0 = [_p_ret_spawnCar] call Zen_SpawnMarker; // debug
           };
       };
   } forEach _a_m_towns;
   _a_m_towns = _a_m_towns - _a_m_remove;

_a_m_towns = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

however i change it to this but i have no luck

    _a_m_remove = [];
   {
       if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
           _a_m_remove set [(count _a_m_remove), _x];
           for "_j" from 0 to (2 + random 2) do {
               _spawnPos = [_x] call Zen_FindGroundPosition;
               _enemyGroup = [_spawnPos, east, AI_SKILL, [4,8]] call Zen_SpawnInfantry;
               0 = [_TownArray, _enemyGroup] call Zen_ArrayAppend;
               // 0 = [_spawnPos] call Zen_SpawnMarker; // debug
           };
       };
   } forEach _a_m_towns;
   _a_m_towns = _a_m_towns - _a_m_remove;

_a_m_towns = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

Try running the code just once without anything else, possibly in its own test mission. You can add in some debug to show if something is really happening. Also, make sure that all the variables are defined, arrays declared before appending to them, etc.

_a_m_towns = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

_player = player;
_TownArray = [];
_a_m_remove = [];
{
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _a_m_remove pushBack _x;
       for "_j" from 1 to (3 + random 2) do {
           _spawnPos = [_x] call Zen_FindGroundPosition;
           0 = [_spawnPos] call Zen_SpawnMarker; // debug

           _enemyGroup = [_spawnPos, east, 0.5, [4,8]] call Zen_SpawnInfantry;
           0 = [_TownArray, _enemyGroup] call Zen_ArrayAppend;
       };
   };
} forEach _a_m_towns;

_a_m_towns = _a_m_towns - _a_m_remove;
player sideChat str _TownArray;

This code should put a marker on each group's spawn position, then print out all of the groups at the end.

Share this post


Link to post
Share on other sites

Thanks Zen - I just realised you had given me a similar debug code in post #120 and I had not implemented it (Herp de Derp) - will test further and report back!

Share this post


Link to post
Share on other sites

OK, testing complete. I had all of the debug code in place as follows:

    { 
       // _townMkArraySpawned lines up with _townPatrolsArray 
       // _groupsArray is the array of groups patrolling the current town 
       _groupsArray = [(_townPatrolsArray select _forEachIndex)] call Zen_ArrayRemoveDead; 

       // Checks if the enemy is gone or dead 
           if ([_groupsArray, _x] call Zen_AreNotInArea) then { 
           _x setMarkerColor "colorGreen"; 
           diag_log (format["Marker %1 clear, changing color to green", _x]); 

		diag_log (_townPatrolsArray select _forEachIndex); 
		diag_log _groupsArray; 
		diag_log _x; 
		diag_log (getMarkerPos _x); 
		diag_log (getMarkerColor _x); 
		diag_log ([_x, [], east] call Zen_GetAllInArea); 
		// After check 
		diag_log "Area Clear"; 

           // 0 the indexes for this town 
           _townMkArraySpawned set [_forEachIndex, 0]; 
           _townPatrolsArray set [_forEachIndex, 0]; 

           // Anything else to be done upon clearing the area 
       }; 
   } forEach _townMkArraySpawned; 

I tested the mission for about 15 minutes. Krasnostav has two markers, InfMk1 & 2. I cleared all enemies spawned (using track infantry to double check this). I cleared InfMk2 around 18.00 - nothing is reported in the rpt. I cleared InfMk1 at 18:04:38 and it reported correctly. RPT file is here, all the action is at the bottom. What have I done wrong here?

Share this post


Link to post
Share on other sites

that piece of code worked like a charm and made spawning alot easier and faster without the need to place markers all over altis

i did how ever make a few minor changes

i know have enemy infantry groups spawning around towns and villages

however when i attempt to spawn enemy infantry around strategic locations nothing appears to happen

_player = player;

//start off Town infantry spawns 

_altistownMarkers = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

_populatedTowns = [];
   {
if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
	_populatedTowns set [(count _populatedTowns), _x];
	for "_j" from 0 to (6 + random 3) do {
		_TownspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
		_EnemyOpfTownGroup = [_TownspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
	};
};
   } forEach _altistownMarkers;
   _altistownMarkers = _altistownMarkers - _populatedTowns;

//start off Strategic infantry spawns 

_altisstrategicMarkers = [["Strategic", "StrongpointArea"]] call Zen_ConfigGetLocations;

_populatedStrategic = [];
   {
if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
	_populatedStrategic set [(count _populatedStrategic), _x];
	for "_j" from 0 to (8 + random 6) do {
		_StrategicspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
		_EnemyOpfStrategicGroup = [_StrategicspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
	};
};
   } forEach _altisstrategicMarkers;
   _altisstrategicMarkers = _altisstrategicMarkers - _populatedStrategic;

if i can get this sorted then finishing shouldn't be much off a problem

Share this post


Link to post
Share on other sites
OK, testing complete. I had all of the debug code in place as follows:

    {
       // _townMkArraySpawned lines up with _townPatrolsArray
       // _groupsArray is the array of groups patrolling the current town
       _groupsArray = [(_townPatrolsArray select _forEachIndex)] call Zen_ArrayRemoveDead;

       // Checks if the enemy is gone or dead
           if ([_groupsArray, _x] call Zen_AreNotInArea) then {
           _x setMarkerColor "colorGreen";
           diag_log (format["Marker %1 clear, changing color to green", _x]);

           diag_log (_townPatrolsArray select _forEachIndex);
           diag_log _groupsArray;
           diag_log _x;
           diag_log (getMarkerPos _x);
           diag_log (getMarkerColor _x);
           diag_log ([_x, [], east] call Zen_GetAllInArea);
           // After check
           diag_log "Area Clear";

           // 0 the indexes for this town
           _townMkArraySpawned set [_forEachIndex, 0];
           _townPatrolsArray set [_forEachIndex, 0];

           // Anything else to be done upon clearing the area
       };
   } forEach _townMkArraySpawned; 

I tested the mission for about 15 minutes. Krasnostav has two markers, InfMk1 & 2. I cleared all enemies spawned (using track infantry to double check this). I cleared InfMk2 around 18.00 - nothing is reported in the rpt. I cleared InfMk1 at 18:04:38 and it reported correctly. RPT file is here, all the action is at the bottom. What have I done wrong here?

Sorry, I meant to split up the debug before and after the check:

   {
       // _townMkArraySpawned lines up with _townPatrolsArray
       // _groupsArray is the array of groups patrolling the current town
       _groupsArray = [(_townPatrolsArray select _forEachIndex)] call Zen_ArrayRemoveDead;

       diag_log (_townPatrolsArray select _forEachIndex);
       diag_log _groupsArray;
       diag_log _x;
       diag_log (getMarkerPos _x);
       diag_log (getMarkerColor _x);
       diag_log ([_x, [], east] call Zen_GetAllInArea);

       // Checks if the enemy is gone or dead
           if ([_groupsArray, _x] call Zen_AreNotInArea) then {
           _x setMarkerColor "colorGreen";

           // After check
           diag_log (format["Marker %1 clear, changing color to green", _x]);

           // 0 the indexes for this town
           _townMkArraySpawned set [_forEachIndex, 0];
           _townPatrolsArray set [_forEachIndex, 0];

           // Anything else to be done upon clearing the area
       };
   } forEach _townMkArraySpawned;

When the area clears correctly, all of it prints out as expected. The key is if it prints something different when it fails. This will also print a lot more debug, 6 lines for every spawned marker every ten seconds.

that piece of code worked like a charm and made spawning alot easier and faster without the need to place markers all over altis

i did how ever make a few minor changes

i know have enemy infantry groups spawning around towns and villages

however when i attempt to spawn enemy infantry around strategic locations nothing appears to happen

_player = player;

//start off Town infantry spawns

_altistownMarkers = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

   _populatedTowns = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedTowns set [(count _populatedTowns), _x];
       for "_j" from 0 to (6 + random 3) do {
           _TownspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyOpfTownGroup = [_TownspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
       };
   };
   } forEach _altistownMarkers;
   _altistownMarkers = _altistownMarkers - _populatedTowns;

//start off Strategic infantry spawns

_altisstrategicMarkers = [["Strategic", "StrongpointArea"]] call Zen_ConfigGetLocations;

   _populatedStrategic = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedStrategic set [(count _populatedStrategic), _x];
       for "_j" from 0 to (8 + random 6) do {
           _StrategicspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyOpfStrategicGroup = [_StrategicspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
       };
   };
   } forEach _altisstrategicMarkers;
   _altisstrategicMarkers = _altisstrategicMarkers - _populatedStrategic;

if i can get this sorted then finishing shouldn't be much off a problem

I would put in some debug to show what the code is doing:

_altisstrategicMarkers = [["Strategic", "StrongpointArea"]] call Zen_ConfigGetLocations;
_populatedStrategic = [];

{
   player sidechat str _x;
   if ((([_x, player] call Zen_Find2dDistance) < 1500)) then {
       _populatedStrategic pushBack _x;
       for "_j" from 0 to (8 + random 6) do {
           _StrategicspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyOpfStrategicGroup = [_StrategicspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
           player sidechat str _StrategicspawnPosition;
           player sidechat str _EnemyOpfStrategicGroup;
       };
   };
} forEach _altisstrategicMarkers;
player sidechat str _populatedStrategic;
_altisstrategicMarkers = _altisstrategicMarkers - _populatedStrategic;

It should print out each marker, the positions found, each group spawned, then all the markers that had groups spawned in them. Even if the player is too far away, at least all of the markers should print out. If nothing prints then there are not markers.

Share this post


Link to post
Share on other sites

Introduction

Greetings fellow scripters and Armaholics, in this latest installment, I will continue to discuss the development of the framework and, of course, shamelessly advertise the framework in any way possible.

If this sounds boring, you can download the latest version from the original post. As always, the link to Google Drive for the .7z and .zip versions are already up to date. For those looking for older versions, go to file>revisions. The new version should be on Armaholic when Foxhound sees this or I PM him. Please bring any technical issues or mistakes to my attention, so e.g. people don't download the wrong version etc.

Changelog

This week features few changes but a lot of new additions. Zen_FindBuildingPositions is very effective at finding random positions inside any building. The positions will be at the correct height (i.e. for each floor) and not inside walls. You can also choose whether roof positions are returned.

As of now, I think allowing roof positions can give you positions on ground level outside the building. Also, not allowing roof positions will prevent positions on balconies. I am working on implementing some tweaks to fix those, but they're not show-stopping.

Six new macros have also been added, included three simple code snippets for insertions and spawning. This should remove some of the typing tedium for straightforward parts of your mission. For the avoidance of doubt, ZEN_STD_MTH_TPT is not the same as ZEN_STD_OBJ_TPT, the former transforms a position and returns it. The later moves an object and returns void.

Both Zen_OrderInfantryPatrolBuilding and Zen_SpawnInfantryGarrison are updated to use Zen_FindBuildingPositions. This means that units will spawn and patrol anywhere inside a building. The functions get a reasonable number of random positions, then use them as if they were fixed building positions.

Finally, Zen_ArraySort now supports both types of comparators. To be clear, a hash function that converts an argument to an arbitrary number, and a comparator is a ternary switch that returns -1, 0, or 1 if (1) is less, equal, or greater to (2). These are the best explanations I could find of each:

https://en.wikipedia.org/wiki/Hash_function

http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html

9/24/14

  1. New Function: Zen_FindBuildingPositions
  2. Added: Framework macro ZEN_FMW_CS_INS, code snippet for insertions
  3. Added: Framework macros ZEN_FMW_CS_SPM, ZEN_FMW_CS_SPP, code snippets for spawning infantry
  4. Added: Standard macro ZEN_STD_MSC_SF, Sleep for Frames
  5. Added: Standard macro ZEN_STD_MSC_WSD, waitUntil Script Done
  6. Added: Standard macro ZEN_STD_MTH_TPT, Transform Array Position ATL
  7. Improved: ZEN_FMW_MP_REA, ZEN_FMW_MP_REC, ZEN_FMW_MP_RED, ZEN_FMW_MP_RES, now use isMultiplayer
  8. Improved: Zen_ArraySort now accepts both true comparators and hashing comparators for sorting
  9. Improved: Zen_OrderInfantryPatrolBuilding and Zen_SpawnInfantryGarrison now use Zen_FindBuildingPositions
  10. Documentation: Fixed for ZEN_STD_OBJ_TPT
  11. Documentation: Added for Zen_FindBuildingPositions
  12. Documentation: Added for ZEN_FMW_CS_INS, ZEN_FMW_CS_SPM, ZEN_FMW_CS_SPP, ZEN_STD_MSC_SF, ZEN_STD_MSC_WSD
  13. Documentation: Updated for Zen_ArraySort

Beta

As already stated, the framework is in the beta stage of development. I am making every effort to quality control releases, but there will be bugs. Both new features and old ones could have bugs, issues, and things people just don't like.

There is no ETA or plan for a 'final' version. The framework is a work in progress, and it will continue to progress while there are improvements to be made (there always will be).

I want to thank everyone who has used and supported the framework.

Share this post


Link to post
Share on other sites
Guest

Thanks for informing us of the new version :)

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Thanks for the new version, Zen! The Zen_FindBuildingPositions fixed a lot of problems I was having with InfantryGarrison. Nice Job!

At this point, did you consider using a wiki for the docs?

Thanks!

Share this post


Link to post
Share on other sites

hey zen

i still seem to be having a problem with spawning units at strategic locations

this is what is used for spawning in infantry at strategic locations

_strategicMarkers = [["Strategic", "StrongpointArea"]] call Zen_ConfigGetLocations;

   _populatedStrategic = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedStrategic set [(count _populatedStrategic), _x];
       for "_j" from 0 to (5 + random 4) do {
           _StrategicspawnPosition = [_x, 0, [], 1, [2, 400], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyStrategicGroup = [_StrategicspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
		0 = [_populatedStrategic, _EnemyStrategicGroup] call Zen_ArrayAppend;
       };
	    _Patrol = [_populatedStrategic, _x, [], 0, "limited"] spawn Zen_OrderInfantryPatrol;
   };
   } forEach _strategicMarkers;
   _strategicMarkers = _strategicMarkers - _populatedStrategic; 

// Simple debug statements, making sure that your variables have the correct value
    player sidechat ("OPFOR Group " + str _EnemyStrategicGroup);
    player sidechat ("OPFOR Orders " + str _patrol);

// Track squads for demonstration and debug purposes
0 = [_populatedStrategic, "group"] call Zen_TrackInfantry;

and then this is what i have to spawn units around town and villages

the units spawn around the towns fine with only one exception they do spawn on the outskirts

_townMarkers = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

   _populatedTowns = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedTowns set [(count _populatedTowns), _x];
       for "_j" from 0 to (6 + random 3) do {
           _TownspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyTownGroup = [_TownspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
		0 = [_populatedTowns, _EnemyTownGroup] call Zen_ArrayAppend;
       };
	    _PatrolTown = [_populatedStrategic, _x, [], 0, "limited"] spawn Zen_OrderInfantryPatrol;
   };
   } forEach _townMarkers;
   _townMarkers = _townMarkers - _populatedTowns;

// Simple debug statements, making sure that your variables have the correct value
    player sidechat ("OPFOR Group " + str _EnemyTownGroup);
    player sidechat ("OPFOR Orders " + str _patrolTown);

as you can see there are only minor changes to the two codes

i have tried each piece off code on there own and i can only get units to spawn around towns and villages

i seem to be a a total loss as to why no units are spawning at strategic locations

i have also tried adding the strategic locations in to the same array as the town locations and still no joy

the only thing i can think off is that strategic locations are not being picked up on

Share this post


Link to post
Share on other sites

Hi Zen,

I went through and implemented the code as you suggested, and re-tested. On my first test, I was able to clear grid 1 & 2 fine. Here is the RPT from the successful test. On the second test, grid 1 cleared and grid 2 did not once all of the enemy were dead. Here is the RPT from the failed test. I have reviewed the RPTs but I am afraid I do not really understand what I am looking at. I know this thread is keeping you busy right now (the more posts the better I guess!), but if you can spare the time to review and advise, I really appreciate it!

Edit:

I am excited about finishing this mission! Here are a couple of screenshots from in the game I am planning to use later on:

2014-08-19_00001_zps47005b6d.jpg

2014-08-19_00002_zpsf158bed9.jpg

Edited by CallMeSarge
Added some pics...

Share this post


Link to post
Share on other sites
Thanks for the new version, Zen! The Zen_FindBuildingPositions fixed a lot of problems I was having with InfantryGarrison. Nice Job!

At this point, did you consider using a wiki for the docs?

Thanks!

That's strange, as Zen_FindBuildingPositions is fairly rough around the edges. I assumed it would cause more problems than using built in building positions.

Although a wiki or website for the documentation is possible sometime in the future, currently there would not be a lot for users to post. I have already written so much documentation that the only things left are lots of explanation and examples for various concepts and functions.

Because this is just the beginning of the framework's life-cycle, mission makers are still adjusting to using by asking questions, making missions, etc. Eventually some of the stuff posted in this thread should be generalized and put into a wiki or knowledge base of some kind.

hey zen

i still seem to be having a problem with spawning units at strategic locations

this is what is used for spawning in infantry at strategic locations

_strategicMarkers = [["Strategic", "StrongpointArea"]] call Zen_ConfigGetLocations;

   _populatedStrategic = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedStrategic set [(count _populatedStrategic), _x];
       for "_j" from 0 to (5 + random 4) do {
           _StrategicspawnPosition = [_x, 0, [], 1, [2, 400], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyStrategicGroup = [_StrategicspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
		0 = [_populatedStrategic, _EnemyStrategicGroup] call Zen_ArrayAppend;
       };
	    _Patrol = [_populatedStrategic, _x, [], 0, "limited"] spawn Zen_OrderInfantryPatrol;
   };
   } forEach _strategicMarkers;
   _strategicMarkers = _strategicMarkers - _populatedStrategic; 

// Simple debug statements, making sure that your variables have the correct value
    player sidechat ("OPFOR Group " + str _EnemyStrategicGroup);
    player sidechat ("OPFOR Orders " + str _patrol);

// Track squads for demonstration and debug purposes
0 = [_populatedStrategic, "group"] call Zen_TrackInfantry;

and then this is what i have to spawn units around town and villages

the units spawn around the towns fine with only one exception they do spawn on the outskirts

_townMarkers = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

   _populatedTowns = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedTowns set [(count _populatedTowns), _x];
       for "_j" from 0 to (6 + random 3) do {
           _TownspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyTownGroup = [_TownspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
		0 = [_populatedTowns, _EnemyTownGroup] call Zen_ArrayAppend;
       };
	    _PatrolTown = [_populatedStrategic, _x, [], 0, "limited"] spawn Zen_OrderInfantryPatrol;
   };
   } forEach _townMarkers;
   _townMarkers = _townMarkers - _populatedTowns;

// Simple debug statements, making sure that your variables have the correct value
    player sidechat ("OPFOR Group " + str _EnemyTownGroup);
    player sidechat ("OPFOR Orders " + str _patrolTown);

as you can see there are only minor changes to the two codes

i have tried each piece off code on there own and i can only get units to spawn around towns and villages

i seem to be a a total loss as to why no units are spawning at strategic locations

i have also tried adding the strategic locations in to the same array as the town locations and still no joy

the only thing i can think off is that strategic locations are not being picked up on

You have put both the groups of spawned units and markers into the same array. Try this code, and just change the location types and see if it works for both:

_townMarkers = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

_populatedTowns = [];
{
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedTowns set [(count _populatedTowns), _x];
       _groupsArray = [];
       for "_j" from 0 to (6 + random 3) do {
           _TownspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyTownGroup = [_TownspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
           0 = [_groupsArray, _EnemyTownGroup] call Zen_ArrayAppend;
       };
       _PatrolTown = [_groupsArray, _x, [], 0, "limited"] spawn Zen_OrderInfantryPatrol;
   };
} forEach _townMarkers;
_townMarkers = _townMarkers - _populatedTowns;

// Simple debug statements, making sure that your variables have the correct value
player sidechat ("OPFOR Group " + str _EnemyTownGroup);
player sidechat ("OPFOR Orders " + str _patrolTown);

You can also use 'diag_log' instead of 'player sideChat str' to print the debug to the log. If you send me the log I have no problem searching through thousands of lines for errors.

Trying to understand the Event Queue demonstration is giving me a headache :(

It's really just an approach using an alternative programming style (event-driven instead of function). Its implementation is complex because SQF is very functional, so things like strings and complex arrays must be used. If you don't like there's no reason to learn and use it. It would only be very useful for about 1% of missions.

Hi Zen,

I went through and implemented the code as you suggested, and re-tested. On my first test, I was able to clear grid 1 & 2 fine. Here is the RPT from the successful test. On the second test, grid 1 cleared and grid 2 did not once all of the enemy were dead. Here is the RPT from the failed test. I have reviewed the RPTs but I am afraid I do not really understand what I am looking at. I know this thread is keeping you busy right now (the more posts the better I guess!), but if you can spare the time to review and advise, I really appreciate it!

The bug appears random because it is caused by random vehicles spawning. The crew of the vehicle is being appended as an array of objects instead of a group. Somewhere in the spawning part you have something like these two lines:

0 = [_spawnedVehicle, ENEMY_SIDE] call Zen_SpawnVehicleCrew;
0 = [_groupsArray, (crew _spawnedVehicle)] call Zen_ArrayAppend;

They should be:

_crewGroup = [_spawnedVehicle, ENEMY_SIDE] call Zen_SpawnVehicleCrew;
0 = [_groupsArray, _crewGroup] call Zen_ArrayAppend;

For next release, I will make Zen_ArrayRemoveDead recursively filter nested arrays and remove empty nested arrays (a empty array is 'dead').

Share this post


Link to post
Share on other sites
The bug appears random because it is caused by random vehicles spawning. The crew of the vehicle is being appended as an array of objects instead of a group. Somewhere in the spawning part you have something like these two lines:

0 = [_spawnedVehicle, ENEMY_SIDE] call Zen_SpawnVehicleCrew;
0 = [_groupsArray, (crew _spawnedVehicle)] call Zen_ArrayAppend;

They should be:

_crewGroup = [_spawnedVehicle, ENEMY_SIDE] call Zen_SpawnVehicleCrew;
0 = [_groupsArray, _crewGroup] call Zen_ArrayAppend;

For next release, I will make Zen_ArrayRemoveDead recursively filter nested arrays and remove empty nested arrays (a empty array is 'dead').

Tested and works like a charm! Zen, I cannot thank you enough!

Share this post


Link to post
Share on other sites

i still seem to be having issues with the current code

while this does works to some degree units seem to only spawn at the two closest towns from the players position being gravia and tellos

with no infantry spawning at any other town or village when i progress closer

_altistownMarkers = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

   _populatedTowns = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedTowns set [(count _populatedTowns), _x];
	_groupsArray = [];
       for "_j" from 0 to (6 + random 3) do {
           _TownspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyTownGroup = [_TownspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
		0 = [_groupsArray, _EnemyTownGroup] call Zen_ArrayAppend;
		0 = [_TownspawnPosition] call Zen_SpawnMarker; // debug
       };
	_PatrolTown = [_groupsArray, _x, [], 0, "limited"] spawn Zen_OrderInfantryPatrol;
   };
   } forEach _altistownMarkers;
   _altistownMarkers = _altistownMarkers - _populatedTowns;

i am still unable to get units to spawn using strategic locations

i decided to run some debug on on location types

the only location types i could establish are NameVillage NameCity NameCityCapital NameLocal and NameMarine

its being going through my mind that perhaps it could be better to use markers the end result should prove the same and perhaps provide less hassle

Share this post


Link to post
Share on other sites
i still seem to be having issues with the current code

while this does works to some degree units seem to only spawn at the two closest towns from the players position being gravia and tellos

with no infantry spawning at any other town or village when i progress closer

_altistownMarkers = [["NameVillage", "NameCity", "NameCityCapital"]] call Zen_ConfigGetLocations;

   _populatedTowns = [];
   {
   if ((([_x, _player] call Zen_Find2dDistance) < 1500)) then {
       _populatedTowns set [(count _populatedTowns), _x];
	_groupsArray = [];
       for "_j" from 0 to (6 + random 3) do {
           _TownspawnPosition = [_x, 0, [], 1, [2, 500], 0, [1,0,10]] call Zen_FindGroundPosition;
           _EnemyTownGroup = [_TownspawnPosition, EAST, 0.6, [4,8]] call Zen_SpawnInfantry;
		0 = [_groupsArray, _EnemyTownGroup] call Zen_ArrayAppend;
		0 = [_TownspawnPosition] call Zen_SpawnMarker; // debug
       };
	_PatrolTown = [_groupsArray, _x, [], 0, "limited"] spawn Zen_OrderInfantryPatrol;
   };
   } forEach _altistownMarkers;
   _altistownMarkers = _altistownMarkers - _populatedTowns;

i am still unable to get units to spawn using strategic locations

i decided to run some debug on on location types

the only location types i could establish are NameVillage NameCity NameCityCapital NameLocal and NameMarine

its being going through my mind that perhaps it could be better to use markers the end result should prove the same and perhaps provide less hassle

I really don't know if there are any strategic locations on Altis, you can check that by seeing if Zen_ConfigGetLocations returns anything.

To spawn groups in markers as the player moves, you need to make sure that this code is running in a loop during the mission. That code runs only once and is designed to be put into . Checking about every 30 seconds should be fine, longer if the player doesn't have access to vehicles. Also, make sure _player is still the player object, or a human if this is for MP.

Share this post


Link to post
Share on other sites

Introduction

Greetings fellow scripters and Armaholics, in this latest installment, I will continue to discuss the development of the framework and, of course, shamelessly advertise the framework in any way possible.

If this sounds boring, you can download the latest version from the original post. As always, the link to Google Drive for the .7z and .zip versions are already up to date. For those looking for older versions, go to file>revisions. The new version should be on Armaholic when Foxhound sees this or I PM him. Please bring any technical issues or mistakes to my attention, so e.g. people don't download the wrong version etc.

Changelog

This week again contains few changes (more about that in the Roadmap section), involving various things that I found or thought of. Zen_FindBuildingPositions is continuing to improve by making sure that positions cannot be outside the building on ground level. It can also detect positions on balconies, walkways, etc. that are not on the roof.

The argument specific macros are extended with two condition filters for Zen_ArrayFilterCondition. Both of them are fairly straightforward, and they provide filtering options that other functions can't. ZEN_FMW_ZAF_FT works the opposite of Zen_ArrayGetType; it removes the type rather than returning it exclusively. ZEN_FMW_ZAF_FS applies Zen_StringIsInString to every element that is a string, leaving those that are not.

Zen_ArraySort never seems to disappear for too long (mostly because I really like sorting algorithms). It is now slightly faster when using a hashing function, and uses a less complex method when the given array is very small. That makes it even better at sorting e.g. 5-15 element arrays.

Due to a slightly unrelated user-reported bug, Zen_ArrayRemoveDead now removes dead elements recursively in all nested arrays. Dead elements now include empty arrays, including arrays of dead elements. Also, Zen_ArrayRemoveNonLocal now removes from nested arrays as well.

I also remembered that I keep forgetting to copy the Notepad++ SQF autocompletion file into the release folder. I apologize if you use Notepad++ with that; I would be lost without it. Finally, both FrameworkIntroduction.txt and the original post of this thread have been amended with a short description of the Preprocessor library.

10/1/14

  1. Fixed: Zen_FindBuildingPositions does not allow ground level positions outside the building when roof positions are allowed
  2. Added: Standard macros ZEN_FMW_ZAF_FT, ZEN_FMW_ZAF_FS, for Zen_ArrayFilterCondition
  3. Improved: Zen_ArrayFilterCondition now uses a code condition, which allows functions
  4. Improved: Zen_ArrayRemoveDead now removes empty nested arrays and nested arrays containing dead objects or groups
  5. Improved: Zen_ArrayRemoveDead and Zen_ArrayRemoveNonLocal now remove objects from nested arrays
  6. Improved: Zen_ArraySort slightly optimized when using a hashing function
  7. Improved: Zen_ArraySort slightly optimized by choosing an appropriate algorithm based upon array size
  8. Improved: Zen_FindBuildingPositions now allows balcony positions when no roof positions are allowed
  9. Documentation: Fixed Notepad++ autocompletion file is now up to date.
  10. Documentation: Added for ZEN_FMW_ZAF_FT, ZEN_FMW_ZAF_FS
  11. Documentation: Updated for Zen_ArrayFilterCondition, Zen_ArrayRemoveDead, Zen_ArrayRemoveNonLocal
  12. Documentation: Updated for FrameworkIntroduction.txt to include information on the Preprocessor library
  13. Documentation: Improved for Zen_ArraySort

Roadmap

As you may have noticed from the Roadmap of previous releases (or lack thereof), there is a dwindling (almost nonexistent) list of things I want to improve or add. While a lot of users have contributed to the development of the framework, not many suggestions about major functions or features have been made.

Because of the size of the framework and the time since release, I am not close to declaring a final release any time soon. The framework is entering a stage of extensive testing and refinement, more than I can accomplished by trying to break things with test scripts. Bugs and issues still exist, but not in the more popular functions or common combinations. Most of the issues users are having relate more to usage and general SQF coding than specific framework issues.

Therefore, I will be changing the release schedule to a release every 2 weeks. These will be known as bi-monthly releases, their numbers will continue to count sequentially, and they will contain more changes at the cost of a longer wait. The first bi-monthly release is scheduled for 10/15/14.

This does not preclude the interruption of this pattern by a release after one week (possibly changing the schedule of bi-monthly releases), if there are sufficient fixes and changes that have been well tested.

Function Spotlight

As users of my framework know, there is an enormous number of functions at your disposal. The amount of documentation that has to be sifted through can be extremely daunting. Each week I spotlight a function and talk about its usefulness. If you have found an obscure function (not in tutorials, barely seen in demonstrations or sample missions) that you think is useful, PM me and I can spotlight it.

The function chosen for this week is: Zen_SpawnConvoy. The premise of this function is simple: provide automatic vehicle selection based upon side to generate a small, believable convoy using the vanilla ArmA 3 vehicles. However, some of the details of how this is done are important.

_convoyVehicles = ["mkConvoy", west] call Zen_SpawnConvoy;

_leadVehicle = _convoyVehicles select 0;
_supplyVehicle = _convoyVehicles select 1;
_troopVehicle = _convoyVehicles select 2;

The entire crew of all of the vehicles are grouped together, such that an order directed at that group is carried out by the driver of the first vehicle, who is followed by the drivers of the other vehicles. Those trailing vehicles cannot take a different route unless their drivers are ordered to do so separately. The command 'move' gives orders to the entire group, and ordering a single unit is done with 'doMove'.

An additional feature of Zen_SpawnConvoy is the inclusion of a random number of troops in the last vehicle. Accessing them is fairly simple, as is making them get out. You must them split them off into their own group before giving them orders.

_troopUnits = (assignedCargo _troopVehicle);
_units orderGetIn false;
{
   unassignVehicle _x;
   _x leaveVehicle _vehicle;
} forEach _units;

_troopGroup = createGroup (side (_troopUnits select 0));
_troopUnits join _troopGroup;
0 = [_troopGroup, "mkDestination"] spawn Zen_OrderInfantryPatrol;

A similar process can be used to split up the other vehicles into their own groups, whether or not they disembark.

Beta

As already stated, the framework is in the beta stage of development. I am making every effort to quality control releases, but there will be bugs. Both new features and old ones could have bugs, issues, and things people just don't like.

There is no ETA or plan for a 'final' version. The framework is a work in progress, and it will continue to progress while there are improvements to be made (there always will be).

Some of the bugs have been pointed out by users, and those fixes are included in the changelog above. I want to thank everyone who has used/supported the framework.

Share this post


Link to post
Share on other sites
Guest

Thanks for informing us of the newest version :)

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Hi Zen,

So my mission is REALLY close to being complete now (I think I have been saying that for a month!) - if the next play test throws up no new issues I will release.

In this phase of the mission, i have split my code into 2 versions - modded and un-modded, and I am pouring my attention into the modded version. As advertised, the framework is compatible with all the unit, vehicle and weapon mods I have used with it so far - happy days.

What I would like to request is an easy way to swap some of the units from Zen Spawn functions to be modded units. Examples of this scenario are:

  • Convoy Vehicles and Units objective
  • Fortification static weapons
  • Wreck vehicle objective
  • Mortar objective
  • Officer objective

For example, it was easy to go into Zen_SpawnConvoy and switch the vehicles to the modded units I wised to use - my mission is set in present day Ukraine, so I added BTR60s and Ural trucks from the East v West mod. But the infantry units in the troop truck are still CSAT forces with funny helmets and obviously wrong uniforms. Similarly, I changed the mortars in Zen_SpawnMortar to be the excellent D30 artillery pieces from RDS static weapons - but the crew members are still CSAT. So my request is as follows:

  1. Is it possible to hold all of the vehicles/static weapons in one file in Zen framework ans defined global variables? That way when you want to add modded vehicles, you have one file to edit in one place, making staying abreast of the updates easier?
  2. Is it possible to globally define east faction in the zen framework, so I could make all the crew units and all of the convoy support troops the russian faction from East v West (or whatever faction)

2014-09-20_00010_zps8eaaa780.jpg

Convoy! But who is in the driving seat?

I would love to know your thoughts on this - is the correct implementation to make the changes by using the existing framework code in the init file?

Share this post


Link to post
Share on other sites

Many thanks for the update Zen.

Gotta an issue with the latest release. I deleted my Zen_FrameworkFunctions folder an replaced it with the latest version.

Now my mission fails to work. No Objectives are set. My team spawns and that's it.

Here's my arma.rpt file

["Zen_SpawnVehicleCrew",[6cd0d0c0# 1781175: heli_transport_01_f.p3d],2.14]
["Zen_SpawnHelicopter",[[8322.22,23282.4,0],"b_heli_transport_01_f"],2.053]
"Init"
Error in expression < 1;

_returnArray = [];

{
_bool = call compile _condition;
if (typeName _bool !>
 Error position: <compile _condition;
if (typeName _bool !>
 Error compile: Type code, expected String
File C:\...\mpmissions\Hopeless.Altis\Zen_FrameworkFunctions\Zen_DataFunctions\Zen_ArrayFilterCondition.sqf, line 19

Let me know if you want a copy of my mission for debug.

In the meantime...

Please PLEASE open up a donation link to you to thank you for your effort you've put in, in giving us this framework. Some of us may want to buy you a beer and thank you for all your hard work.

Please let us donate for all your efforts. Who knows, you might even raise enough to get the kids a new pair of socks.

But without a donation link, you're kids could end up going bare foot!!

And that would be all our fault!! :butbut:

Edited by Beerkan
Hide user details

Share this post


Link to post
Share on other sites
Hi Zen,

So my mission is REALLY close to being complete now (I think I have been saying that for a month!) - if the next play test throws up no new issues I will release.

In this phase of the mission, i have split my code into 2 versions - modded and un-modded, and I am pouring my attention into the modded version. As advertised, the framework is compatible with all the unit, vehicle and weapon mods I have used with it so far - happy days.

What I would like to request is an easy way to swap some of the units from Zen Spawn functions to be modded units. Examples of this scenario are:

  • Convoy Vehicles and Units objective
  • Fortification static weapons
  • Wreck vehicle objective
  • Mortar objective
  • Officer objective

For example, it was easy to go into Zen_SpawnConvoy and switch the vehicles to the modded units I wised to use - my mission is set in present day Ukraine, so I added BTR60s and Ural trucks from the East v West mod. But the infantry units in the troop truck are still CSAT forces with funny helmets and obviously wrong uniforms. Similarly, I changed the mortars in Zen_SpawnMortar to be the excellent D30 artillery pieces from RDS static weapons - but the crew members are still CSAT. So my request is as follows:

  1. Is it possible to hold all of the vehicles/static weapons in one file in Zen framework ans defined global variables? That way when you want to add modded vehicles, you have one file to edit in one place, making staying abreast of the updates easier?
  2. Is it possible to globally define east faction in the zen framework, so I could make all the crew units and all of the convoy support troops the russian faction from East v West (or whatever faction)

Convoy! But who is in the driving seat?

I would love to know your thoughts on this - is the correct implementation to make the changes by using the existing framework code in the init file?

You can edit Zen_SpawnVehicleCrew to change to classnames just like Zen_SpawnConvoy. That would affect every vehicle that Zen_SpawnVehicleCrew is used on, but since you don't want any CSAT at all there's no harm in changing those defaults. Obviously I would like to offer some feature that allows this without editing the source code, but this will work.

You can also get the same results by using lower level functions (Zen_SpawnVehicle, Zen_SpawnGroup, etc.) with addon unit classnames. It takes more coding than editing framework work functions, but then you don't have to worry about which framework functions you have edited, etc.

What I would want to do is put a lot of constants into a single header file and use the preprocessor, but because of an engine issue with the preprocessor, you have to copy that file into every directory so that the functions can use it. If users change it they would have to know it must be copied to take effect. This is already done with the existing preprocessor library; the difference is there's no reason to change those files. For function-specific constants, it might be better to put those into the compile scripts for each category.

Of course, using true variables would work fine; however, changing them during the mission would affect things (and they would have to be publicVariable'd). There are no constant or final variables in SQF. I will keep thinking about it and try to find the best solution for next release.

The only spawning functions that use hard-coded classnames are Zen_SpawnConvoy and Zen_SpawnVehicleCrew. For Zen_SpawnVehicleCrew, there are 5 classnames for 4 sides, so passing those as a argument is too much (documentation-wise). For Zen_SpawnConvoy, I am trying to use Zen_ConfigGetVehicleClasses to generalize what spawns, while keeping the default the same as it was hard-coded. That would allow giving a faction to Zen_SpawnConvoy.

The rest of the spawning functions spawn either exactly what they are given or something random using Zen_ConfigGetVehicleClasses. However, some of these (e.g. Zen_SpawnAircraft) don't offer an option for faction when they could. For next release, I will add a faction parameter for about five spawning functions.

Zen_CreateObjective being hard-coded is not that bad, as you are free to use the 'custom' objective type and spawn whatever you want, then take the spawned objects and manipulate them anyway you want (give them a crew, etc.). If I can add a way of changing fixed classnames, that will include changing e.g. officer classnames, etc.

For Zen_SpawnFortification, I can just add a parameter for the classname of the weapon, then then make it optional with a default of what's already there. Improvements like that are very easy to make.

Many thanks for the update Zen.

Gotta an issue with the latest release. I deleted my Zen_FrameworkFunctions folder an replaced it with the latest version.

Now my mission fails to work. No Objectives are set. My team spawns and that's it.

Here's my arma.rpt file

["Zen_SpawnVehicleCrew",[6cd0d0c0# 1781175: heli_transport_01_f.p3d],2.14]
["Zen_SpawnHelicopter",[[8322.22,23282.4,0],"b_heli_transport_01_f"],2.053]
"Init"
Error in expression < 1;

_returnArray = [];

{
_bool = call compile _condition;
if (typeName _bool !>
 Error position: <compile _condition;
if (typeName _bool !>
 Error compile: Type code, expected String
File C:\...\mpmissions\Hopeless.Altis\Zen_FrameworkFunctions\Zen_DataFunctions\Zen_ArrayFilterCondition.sqf, line 19

Let me know if you want a copy of my mission for debug.

In the meantime...

Please PLEASE open up a donation link to you to thank you for your effort you've put in, in giving us this framework. Some of us may want to buy you a beer and thank you for all your hard work.

Please let us donate for all your efforts. Who knows, you might even raise enough to get the kids a new pair of socks.

But without a donation link, you're kids could end up going bare foot!!

And that would be all our fault!! :butbut:

From the log it seems that the function is using old code, the latest Zen_ArrayFilterCondition should call '_condition' without compiling it. Try downloading again, the date on Zen_ArrayFilterCondition.sqf should be 9/30.

I would prefer not to accept donations, on the principle that creating the framework doesn't cost any money. However, seeing how my framework has helped mission makers is truly rewarding, and I am grateful for the appreciation and support of my users.

Share this post


Link to post
Share on other sites

Thanks Zen - all makes sense.

Like Beerkan, I have also had an issue since update - my .rpt is getting majorly spammed with this:

2014/10/03, 21:31:29 "-- Zen_CheckArguments Error --"
2014/10/03, 21:31:29 "Argument 2 is the wrong type"
2014/10/03, 21:31:29 29.066
2014/10/03, 21:31:29 [[b Alpha 1-1:1,B Alpha 1-1:3 (OhShitSarge) REMOTE],"!(isPlayer _x)"]
2014/10/03, 21:31:29 ["Zen_CheckArguments",[[b Alpha 1-1:1,B Alpha 1-1:3 (OhShitSarge) REMOTE],"!(isPlayer _x)"],29.066]
2014/10/03, 21:31:29 ["Zen_ArrayFilterCondition",[[b Alpha 1-1:1,B Alpha 1-1:3 (OhShitSarge) REMOTE],"!(isPlayer _x)"],29.066]
2014/10/03, 21:31:29 "Init"
2014/10/03, 21:31:29 "-- Zen_CheckArguments Error --"
2014/10/03, 21:31:29 "Argument 2 is the wrong type"
2014/10/03, 21:31:29 29.087
2014/10/03, 21:31:29 [[b Alpha 1-1:1,B Alpha 1-1:3 (OhShitSarge) REMOTE],"!(isPlayer _x)"]
2014/10/03, 21:31:29 ["Zen_CheckArguments",[[b Alpha 1-1:1,B Alpha 1-1:3 (OhShitSarge) REMOTE],"!(isPlayer _x)"],29.087]
2014/10/03, 21:31:29 ["Zen_ArrayFilterCondition",[[b Alpha 1-1:1,B Alpha 1-1:3 (OhShitSarge) REMOTE],"!(isPlayer _x)"],29.087]
2014/10/03, 21:31:29 "Init"

I can post the whole RTP if needed. I tested by rolling back to the previous version, and the issue went away. My init sqf is here. As usual, any advice would be appreciated.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×