Jump to content
Zenophon

Zenophon's ArmA 3 Co-op Mission Making Framework

Recommended Posts

@eaglezero6205  in one of the sample missions (maybe more) there is an example of a group insertion by boat and helicopter.

You could have a look at those to get some ideas. the framework has been set up so that it works in multiplayer very well.

 

try the tutorial MultiSquadObjectives.Altis in the framework documentation folder. 

 

Share this post


Link to post
Share on other sites

Hello everybody,

 

I have a problem.

I use the example mission (Zen_RespwanPartrol.Altis)

But I get an error displayed!
Unfortunately, I'm not that good at scripting yet, so please help me!

 

Log:

2062.58
12:22:42 [<NULL-object>,[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>]]
12:22:42 ["Zen_CheckArguments",[<NULL-object>,[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>]],2062.58]
12:22:42 ["Zen_ValueIsInArray",[<NULL-object>,[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>]],2062.58]
12:22:42 ["Zen_ArrayRemoveDuplicates",[[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>,<NULL-object>,X,B Infantry:5,1d67c4f4c40# 1790891: b_soldier_02.p3d,B Infantry:6,B Infantry:2,B Infantry:4]],2062.46]
12:22:42 ["Zen_InvokeAction",["Zen_Action_ID_,375:6caB=",[B Infantry:4]],2062.46]
12:22:42 ["Zen_AddRepackMagazines",[B Infantry:4],2062.46]
12:22:43 Error in expression <ps);
_vehicle setVelocity (([(_velocity select 0) * cos (_velocity select 1), (_>
12:22:43   Error position: <select 0) * cos (_velocity select 1), (_>
12:22:43   Error select: Typ Zahl, erwartet Array,Zeichenfolge,Config entry
12:22:43 File C:\Users\-----\Documents\Arma 3 - Other Profiles\Wolf\mpmissions\Zen_SampleMissions\Zen_RespawnPatrol.Altis\Zen_FrameworkFunctions\Zen_ObjectFunctions\Zen_ObjectFunctionsCompile.sqf, line 131

The error is probably in the "Zen_ObjectFunctionsCompile.sqf" line 131

Maybe someone has ever had the same mistake?

 

Greetings Wolf

Share this post


Link to post
Share on other sites

Hallo Zenophon and everybody else,

 

I m one of this you describe in your read.me as an beginner... So perhaps my questions are allready answered but I was really searching a lot... 

 

I want to create coop-Missions for me and two friends. I have no expirience in mission making. So I m watching a lot of tutorials and found your framework 

 

My questions are simple. I wanted to start with the tutorials: First thing I noticed was this in the tutorial: "Copy the Zen_FrameworkFunctions directory from the Shell.Stratis directory to ..."

 

But there is no directory "Shell.Stratis". So I used the one from the "Shell" directory. I guess thats right, or?

 

Second think: For the Arma Eden Editor Markers doesnt work like in the tutorial. I think in the past it was like this but now the markers are just for the maps, or? I can use the markers anyway but for the area setting its a bit weared. Can I use triggers instead. Or someting else? 

 

And then there is a central question... is your framework still the thing? I have the feeling that some modules in the Eden Editor are made for multiplayer stuff. It is quite confusing for me that there hundrets of tutorials but a lot are out of date because things work different now.

 

Nice, if you could answer my question and even that I dont understand so much about mission making... I see how much work you put in this...Thank you for that!

 

Share this post


Link to post
Share on other sites
On 4/15/2018 at 4:07 AM, pat2381 said:

Hello everybody,

 

I have a problem.

I use the example mission (Zen_RespwanPartrol.Altis)

But I get an error displayed!
Unfortunately, I'm not that good at scripting yet, so please help me!

 

Log:


2062.58
12:22:42 [<NULL-object>,[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>]]
12:22:42 ["Zen_CheckArguments",[<NULL-object>,[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>]],2062.58]
12:22:42 ["Zen_ValueIsInArray",[<NULL-object>,[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>]],2062.58]
12:22:42 ["Zen_ArrayRemoveDuplicates",[[X,1d65b33cb40# 1779932: b_soldier_01.p3d,B Infantry:3,<NULL-object>,<NULL-object>,<NULL-object>,P,B Crew:2,<NULL-object>,1d67c9e8800# 1785002: b_soldier_01.p3d,<NULL-object>,<NULL-object>,<NULL-object>,X,B Infantry:5,1d67c4f4c40# 1790891: b_soldier_02.p3d,B Infantry:6,B Infantry:2,B Infantry:4]],2062.46]
12:22:42 ["Zen_InvokeAction",["Zen_Action_ID_,375:6caB=",[B Infantry:4]],2062.46]
12:22:42 ["Zen_AddRepackMagazines",[B Infantry:4],2062.46]
12:22:43 Error in expression <ps);
_vehicle setVelocity (([(_velocity select 0) * cos (_velocity select 1), (_>
12:22:43   Error position: <select 0) * cos (_velocity select 1), (_>
12:22:43   Error select: Typ Zahl, erwartet Array,Zeichenfolge,Config entry
12:22:43 File C:\Users\-----\Documents\Arma 3 - Other Profiles\Wolf\mpmissions\Zen_SampleMissions\Zen_RespawnPatrol.Altis\Zen_FrameworkFunctions\Zen_ObjectFunctions\Zen_ObjectFunctionsCompile.sqf, line 131

The error is probably in the "Zen_ObjectFunctionsCompile.sqf" line 131

Maybe someone has ever had the same mistake?

 

Greetings Wolf

There are two separate errors starting in the f_HandleRespawn function.  First, Zen_InvokeAction is confused by null objects in the list of objects that already have the action (I'm guessing those units died); I'll need to modify the action system to clean its data as necessary.

 

Second, Zen_TransformObject is given the wrong arguments on line 92; it should be

                0 = [_unit, (((units group _unit) - [_unit]) call Zen_FindAveragePosition), 500, 0, random 360] call Zen_TransformObject;

where the fourth arg is a 0 to skip the velocity transform rather than the 'random 360' direction transform; Zen_TransformObject was also incorrect in letting a number get through to the setVelocity command.

7 hours ago, Melange said:

Hallo Zenophon and everybody else,

 

I m one of this you describe in your read.me as an beginner... So perhaps my questions are allready answered but I was really searching a lot... 

 

I want to create coop-Missions for me and two friends. I have no expirience in mission making. So I m watching a lot of tutorials and found your framework 

 

My questions are simple. I wanted to start with the tutorials: First thing I noticed was this in the tutorial: "Copy the Zen_FrameworkFunctions directory from the Shell.Stratis directory to ..."

 

But there is no directory "Shell.Stratis". So I used the one from the "Shell" directory. I guess thats right, or?

 

Second think: For the Arma Eden Editor Markers doesnt work like in the tutorial. I think in the past it was like this but now the markers are just for the maps, or? I can use the markers anyway but for the area setting its a bit weared. Can I use triggers instead. Or someting else? 

 

And then there is a central question... is your framework still the thing? I have the feeling that some modules in the Eden Editor are made for multiplayer stuff. It is quite confusing for me that there hundrets of tutorials but a lot are out of date because things work different now.

 

Nice, if you could answer my question and even that I dont understand so much about mission making... I see how much work you put in this...Thank you for that!

 

Shell.Stratis was renamed to Shell and the mission.sqm removed some time ago to prevent confusion since there are many maps now (long ago Stratis was the only map in A3).  The current instructions are based around creating a blank mission on the desired map using the editor, then copying framework files (as opposed to creating the mission files, then opening them in the editor).  Some/all of the tutorial pdf's were never updated.

 

For the markers, Eden editor has a map view ('M' by default or whatever your in-game map key is; there's probably a button on the interface as well) that makes placing markers easier (there's also a stretch tool for sizing markers accurately).  Markers are preferable to triggers for use in external scripts since triggers have unnecessary complexity and overhead; it is also simpler to dynamically create markers and alter/inspect their properties in scripts.

 

The framework isn't updated frequently because it's basically finished; the goal is to provide a robust set of tools for external scripts as well as major systems for common/standard things.  Over the years, my style of coding some parts (e.g. remote execution) has become old fashioned; however, everything still works (if not, report it and I'll fix it) and you won't notice when using the functions.  I still read all official patches notes for potential incompatibilities and new script commands.  With the most recent bug report I'll probably release the accumulated fixes/improvements soon.

 

The documentation talks about this much more, but essentially my framework/library is giving you a large code base and detailed documentation (and my assistance with any errors or questions) for you to learn and script missions with.  The more you learn to program in SQF, the more use you will get out of the framework.  The first tutorial is showing you how little code you need to create a basic mission; the amount of code will go up from there.

Share this post


Link to post
Share on other sites

Been a long time since I've messed with computers or games. A little something called a divorce grabbed my attention, not to mention older kids needs.

 

Anyhow, I was itching for a little ArmA action, and decided to update one of my missions with the latest framework. I don't remember all the sqf stuff I used to know, but enough. I am encountering a similar issue as described above.

 

Perhaps you can elaborate on your fix you mentioned, regarding a unit that is referenced but now null. It happens when calling AddGiveMagazine. It appears to be that an array of named objects (playable units) is passed to CheckArguments or ConvertToObjectArray (or others) is found by ZCA (check args) as OK, but a later call there are null objects (dead units), so ZCA fails with (usually) a void (typeName) error.

 

Example errors (I have been adding code to track it, but there's a lot of calls going on)

 

 

20:45:37 "-->>>> FUNC respawn - Begin call Z Add Giv Mag !! the unit is :: x12 :: <<<<--"
20:45:37 "---->>>> FUNC Begin - Z Add Giv Mag - :: [[x12]]"
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[[x12]],[[""VOID""]],[],1] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "------>>>> FUNC Begin - Z Con To Obj Arr - _this is :: [[x12]] :: <<<<..."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[[x12]],[[""VOID""]],[],1] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "------>>>> FUNC End - Z Con To Obj Arr - _return is :: [x12] :: <<<<..."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[[x12]],[[""ARRAY""]],[],1] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[x12,[]],[[""VOID""],[""VOID""]],[],2] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "------>>>> FUNC End - Z Con To Obj Arr - _return (remove dupes) is :: [x12] :: <<<<..."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[""Zen_Action_ID_PWMi].pav?"",[x12]],[[""STRING""],[""VOID""]],[],2] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "------>>>> FUNC Begin - Z Con To Obj Arr - _this is :: [[x12]] :: <<<<..."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[[x12]],[[""VOID""]],[],1] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "------>>>> FUNC End - Z Con To Obj Arr - _return is :: [x12] :: <<<<..."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[[x12]],[[""ARRAY""]],[],1] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[x12,[]],[[""VOID""],[""VOID""]],[],2] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "------>>>> FUNC End - Z Con To Obj Arr - _return (remove dupes) is :: [x12] :: <<<<..."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[""Zen_Action_ID_PWMi].pav?""],[[""STRING""]],[],1] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[[""Zen_Action_ID_PWMi].pav?"",""<t color='#2D8CE0'>Give Magazine</t>"",""Zen_GiveMagazine"",[],[1,false,true,"""",""((_target == _this) && !(surfaceIsWater (getPosATL _this)) && (vehicle _this == _this) && {(({(side _x == side _this) && ([_this, _x, 120] call Zen_IsFacing)} count (((getPosATL _target) nearEntities ['Man', 3]) - [_this])) > 0)})""],[x11,<NULL-object>,x13,x14,x21,x22,x31,x32,<NULL-object>,x12,x12],[],[]],0,5],[[""ARRAY""],[""SCALAR""],[""SCALAR""]],[],2] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[[x11,<NULL-object>,x13,x14,x21,x22,x31,x32,<NULL-object>,x12,x12,x12]],[[""ARRAY""]],[],1] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[x11,[]],[[""VOID""],[""VOID""]],[],2] <<<<<....."
20:45:37 "__>> FUNC End - Z Chk Arg == return (_match) is :: true <<<<<....."
20:45:37 "__>> FUNC Z Chk Arg - Begin !! == _this is :: [[<NULL-object>,[x11]],[[""VOID""],[""VOID""]],[],2] <<<<<....."
20:45:37 "----->>> FUNC Z Chk Arg - typeName !! ==  is :: <NULL-object> && OBJECT <<<<<....."
20:45:37 "-- Zen_CheckArguments Error --"
20:45:37 "Argument 1 is void (typeName)"
20:45:37 383.533
20:45:37 [<NULL-object>,[x11]]
20:45:37 ["Zen_CheckArguments",[<NULL-object>,[x11]],383.533]
20:45:37 ["Zen_ValueIsInArray",[<NULL-object>,[x11]],383.533]
20:45:37 ["Zen_ArrayRemoveDuplicates",[[x11,<NULL-object>,x13,x14,x21,x22,x31,x32,<NULL-object>,x12,x12,x12]],383.533]
20:45:37 ["Zen_InvokeAction",["Zen_Action_ID_PWMi].pav?",[x12]],383.533]
20:45:37 ["Zen_AddGiveMagazine",[[x12]],383.533]

You can see that each unit is valid, yet at times not. I don't think a check of player==alive or similar would work, as the whole call begins on a respawn handle, so the unit/body has already been spawned/created by the engine?

 

The last time I was doing anything with Arma I was using your version 5/6/15 lol. It does not give this error, but then ZCA is different.

 

I'm no slouch in program logic, but without having to reinvent the wheel here, what were you eluding to in the form of a cleanup of code to fix the issue which sounds a lot like the post above.

 

Pretty please?

Share this post


Link to post
Share on other sites

I was a bit vague about cleaning because I had to work out the details of implementing it.  The action system is a manager and locality wrapper for addAction; it tracks global information about an abstract action as well as local information from addAction.  The error is from the system's global tracking of which objects have the action; that server based list has to be cleaned of null objects.

 

Any action system function that uses or updates the server data now calls Zen_ArrayRemoveDead 'on demand' so that the system cleans itself as it is used (Zen_DeleteActionClient already did this for local data).  For example, Zen_InvokeAction would look like

_nameString = _this select 0;
_units = [(_this select 1)] call Zen_ConvertToObjectArray;

_actionData = [_nameString] call Zen_GetActionDataGlobal;
_text = _actionData select 1;
_addActionArgs = _actionData select 4;

// I've added this filter for null objects
_oldObjects = [(_actionData select 5)] call Zen_ArrayRemoveDead;
_allUnits = [_oldObjects + _units] call Zen_ArrayRemoveDuplicates;

Zen_ConvertToObjectArray will filter the argument for null objects as well.  Zen_RemoveAction and Zen_DeleteAction will use Zen_ArrayRemoveDead similarly.  I've also changed Zen_InvokeActionClient to clean the local data and prevent duplicate actions.  Don't worry about changing all this yourself, I'm going to release a new framework version in a couple days (after I test this and a few other things).

Share this post


Link to post
Share on other sites

Oooh... nice. It's come a long way since the last time I used it for sure! But it still works really well.

Share this post


Link to post
Share on other sites

Update and Release #52
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 links 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 will be on Armaholic soon. Please bring any technical issues or mistakes to my attention, so e.g. people don't download the wrong version etc.

 

Changelog

 

It's been a while, and this update addresses all bug reports and requests since last release as well as keeping the framework up to date with the latest ArmA version.  There's always little things like helicopter pods spawning as vehicles and ropeCreate not working.

 

The action system will be much more robust about removing null objects from its local and server lists.  This does not include objects that are not alive (hence the new parameter for Zen_ArrayRemoveDead); you can put actions on destroyed objects (the transition from alive to dead may not preserve actions; this is the engine creating a new object).  I've also added a check for duplicate actions; changing an action then invoking it again is still considered a duplicate action (create a new action or use Zen_UpdateAction's refresh argument).

 

Zen_CreateObjective and the trigger functions it uses account for newly spawned units or JIP players being added to groups; previously they only scanned for new units when a entire side was given.

 

Zen_SpawnConvoy will no longer spawns guerrilla factions or DLC factions unless you specifically input that faction.  Zen_SpawnVehicleCrew will print a proper error if a very strange object spawns as a vehicle; please report any spawns that obviously are not an appropriate vehicle so I can add a special filter in Zen_ConfigGetVehicleClasses.

 

5/2/18

 1. Fixed: Zen_ConfigGetVehicleClasses filters cargo helicopter attachment pods
 2. Fixed: Zen_InvokeAction, Zen_DeleteAction, and Zen_RemoveAction filter null objects
 3. Fixed: Zen_OrderFastRope did not create its ropes correctly
 4. Fixed: Zen_SpawnConvoy spawned mixed factions for east and resistance sides when the faction argument was not given
 5. Fixed: Zen_TransformObject argument checking allowed a scalar as the fourth argument
 6. Added: Zen_ArrayRemoveDead argument to check for objects being alive
 7. Improved: Zen_CreateObjective, Zen_TriggerAreDead, Zen_TriggerAreNear, Zen_TriggerAreRescued, Zen_TriggerAreaClear, and Zen_TriggerAreaSecure dynamically update the units they are considering for all inputs
 8. Improved: Zen_InvokeAction prevents duplicate actions
 9. Improved: Zen_OrderVehicleMove stops ground vehicles and boats at a reasonable distance from their waypoint
10. Improved: Zen_SpawnVehicleCrew prints an error and returns null if no crew can be created
11. Documentation: Fixed Zen_RespawnPatrol.Altis used Zen_TransformObject wrong
12. Documentation: Updated for Zen_ArrayRemoveDead
13. Documentation: Updated Notepad++ SQF language and autocompletion file with ArmA 1.74, 1.76, 1.78, 1.82 stable commands

Share this post


Link to post
Share on other sites
On 5/2/2018 at 5:57 PM, Zenophon said:

For those looking for older versions, go to file>revisions.

Hi. I'm just getting started with your Foundation.  I fixed a few function renames  in the init.sqf for the AltisPatrol tutorial, however, the provided ReinforceGroups.sqf script is failing.  Maybe I should try the foundation version that the tutorials were originally developed for until I get more familiar with the system.  I checked the InfantryPatrol sample mission and it does not use the same script.  Do you recall the foundation version that the tutorials were developed with? Thanks!

 

EDIT: Hmmm. Or, is only the tutorial PDF outdated? I am not at home, but I see now that that the Solution.sqf appear to have the updated fcn names.

 

EDIT: After testing more, I'm pretty sure that ReinforceGroups.sqf is buggy.   Using the provided init solution file I get this:

 

0 = [_reinforceGroup, _group, [#]_h_insert, _reinforceHeli] spawn f_sy...

Error undefined variable in expression: _h_insertion

...\ReinforceGroups.sqf, line 83

 

-Zen_CheckArguments Error -

Argument 6 is the wrong type

 1505.08

[B Alpha 2-1:1,[[6080.766,15577.2,0]],[0,0,0]], B Alpha

2-3,"normal",30,true]

 

EDIT - Made this correction in ReinforceGroups.sqf - missing argument "fastrope".
 

            // fastrope insertion and retreat, recall that _h_insertion is finished when heli is at [0,0,0]
            _h_insertion = [_reinforceHeli, [_landPos, [0,0,0]], _reinforceGroup, "normal", 30, "fastrope", true] call Zen_OrderInsertion;

 

Now replacements are inserted but do not join the existing group and own the mission until they die. 

Share this post


Link to post
Share on other sites

Have you tested the framework with CUP terrains?  It seems like there may be something funky with the CUP terrains that is affecting the framework's ground position functions and placing Ifrits and mortar emplacements under the sea for CUP islands.  Thanks.

Share this post


Link to post
Share on other sites

Very small detail, but this:

 

23V01hX.jpg?1

 

Is making me go crazy.

This happens when using Zen_SpawnGroup or Zen_SpawnInfantry and Zen_OrderInfantryPatrol, the second man is too close to the first one.

Have tried with setFormation and setWaypointFormation, doesn't seem to be the problem. Any ideas?

Also vehicles tend to drive too... erratically, even though they are set to 'SAFE' and 'LIMITED'.

 

Cheers!

 

EDIT: Lazy me. Found the source.

 

Quote

//                                _group move _mpos;
//                                (leader _group) doMove _mpos;

 

Lines 76, 77, Zen_OrderInfantryPatrol.sqf.

Now a question.

What is the motive of this two lines? @Zenophon

Isn't it enough with the waypoint?

Share this post


Link to post
Share on other sites

Update and Release #53
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 links 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 will be on Armaholic soon. Please bring any technical issues or mistakes to my attention, so e.g. people don't download the wrong version etc.

 

Changelog

 

This release marks the beginning of the framework's fifth year; for this milestone I want to offer a new level of randomness that is accessible and fits with existing functions (i.e. Zen_FindGroundPosition).  The new feature is called Zen_FindLinePosition.

 

Zen_FindLinePosition's first feature is to find a random point on any curve.  This curve is any function that accepts an X value and returns a Y value.  It can also find a random point between any two such curves.

 

While the function itself is not very complex, it is fully integrated into Zen_FindGroundPosition, including verifying that road positions lie inside the curve and limiting the angles around the center.  By using blacklist markers, angle limits, and every other Zen_FindGroundPosition filter, you can create a much greater variety of areas more efficiently.  Some examples of this are:
 

Spoiler

 


f_line1 = {
    50*sin(_this)
};

f_line2 = {
    50*cos(_this)
};

for "_i" from 0 to 100 do {
    0 = [([player, [-50, 50], "f_line1"] call Zen_FindLinePosition)] call Zen_SpawnMarker;
};

for "_i" from 0 to 1000 do {
    0 = [([player, [-50, 50], "f_line1", "f_line2"] call Zen_FindLinePosition), "", "colorRed"] call Zen_SpawnMarker;
};

for "_i" from 0 to 100 do {
    0 = [([[player, "f_line1", "f_line2"], [-100, 100], 0, 1, 0] call Zen_FindGroundPosition), "", "colorBlack"] call Zen_SpawnMarker;
};

0 = [([[player, "f_line1", "f_line2"], [-100, 100], 0, 2, 0] call Zen_FindGroundPosition), "", "colorRed"] call Zen_SpawnMarker;

for "_i" from 0 to 100 do {
    0 = [([[player, "f_line1", "f_line2"], [-100, 100], 0, 1, [1, 25]] call Zen_FindGroundPosition), "", "colorBlue"] call Zen_SpawnMarker;
};

for "_i" from 0 to 100 do {
    0 = [([[player, "f_line1", "f_line2"], [-100, 100], 0, 1, [2, 25]] call Zen_FindGroundPosition), "", "colorYellow"] call Zen_SpawnMarker;
};

for "_i" from 0 to 100 do {
    0 = [([[player, "f_line1"], [-100, 100], 0, 1, [2, 25]] call Zen_FindGroundPosition), "", "colorGreen"] call Zen_SpawnMarker;
};

for "_i" from 0 to 100 do {
    0 = [([[player, "f_line1", "f_line2"], [-100, 100], 0, 1, [3, 30]] call Zen_FindGroundPosition), "", "colorCivilian"] call Zen_SpawnMarker;
};

 

 

 

The calculation of roads includes a buffer to account for the discrete nature of road objects in ArmA; when the single line (green dots) crosses a road, it should find one or two road points to use.  It is important to note that all Zen_FindGroundPosition options still use the given center position, so shifting the X limits far away from this may cause odd behavior.

 

Also, consider that the function itself can be random, allowing you to weight the distribution of points within the area or around a central curve in any way you want.  E.g. using the built-in random:

Spoiler

 

 


f_line3 = {
    50*sin(_this) + (random 50)*sin(_this)
};

f_line4 = {
    50*sin(_this) + (random [1, 25, 50])*sin(_this)
};

f_line5 = {
    _this + (random _this)
};

for "_i" from 0 to 1000 do {
    0 = [([player, [-200, 200], "f_line3"] call Zen_FindLinePosition), "", "colorRed"] call Zen_SpawnMarker;
};

for "_i" from 0 to 1000 do {
    0 = [([player, [-200, 200], "f_line4"] call Zen_FindLinePosition), "", "colorYellow"] call Zen_SpawnMarker;
};

for "_i" from 0 to 1000 do {
    0 = [([player, [-200, 200], "f_line5"] call Zen_FindLinePosition)] call Zen_SpawnMarker;
};

 

 

 

7/10/18
 1. New Function. Zen_FindLinePosition
 2. Fixed: Zen_FindGroundPosition road argument force and avoid options failed in some cases
 3. Added: Zen_FindGroundPosition can use Zen_FindLinePosition
 4. Improved: Zen_AddFireSupportAction and Zen_AddSupportActionCustom include the map on the support selection dialog
 5. Documentation: Fixed for Zen_InvokeDialog
 6. Documentation: Fixed tutorial AltisPatrol script errors
 7. Documentation: Added for Zen_FindLinePosition
 8. Documentation: Updated for Zen_FindGroundPosition

 

On 6/29/2018 at 8:34 AM, AndyB1580 said:

Hi. I'm just getting started with your Foundation.  I fixed a few function renames  in the init.sqf for the AltisPatrol tutorial, however, the provided ReinforceGroups.sqf script is failing.  Maybe I should try the foundation version that the tutorials were originally developed for until I get more familiar with the system.  I checked the InfantryPatrol sample mission and it does not use the same script.  Do you recall the foundation version that the tutorials were developed with? Thanks!

 

EDIT: Hmmm. Or, is only the tutorial PDF outdated? I am not at home, but I see now that that the Solution.sqf appear to have the updated fcn names.

 

EDIT: After testing more, I'm pretty sure that ReinforceGroups.sqf is buggy.   Using the provided init solution file I get this:

 

0 = [_reinforceGroup, _group, [#]_h_insert, _reinforceHeli] spawn f_sy...

Error undefined variable in expression: _h_insertion

...\ReinforceGroups.sqf, line 83

 

-Zen_CheckArguments Error -

Argument 6 is the wrong type

 1505.08

[B Alpha 2-1:1,[[6080.766,15577.2,0]],[0,0,0]], B Alpha

2-3,"normal",30,true]

 

EDIT - Made this correction in ReinforceGroups.sqf - missing argument "fastrope".
 

            // fastrope insertion and retreat, recall that _h_insertion is finished when heli is at [0,0,0]
            _h_insertion = [_reinforceHeli, [_landPos, [0,0,0]], _reinforceGroup, "normal", 30, "fastrope", true] call Zen_OrderInsertion;

 

Now replacements are inserted but do not join the existing group and own the mission until they die. 

 

The AltisPatrol tutorial is fixed; there were multiple errors in ReinforceGroups.sqf

 

On a more general note, I will be reviewing all documentation that uses code in the next few months to ensure that it adheres to current framework functions and styles.  The tutorials are the most out of date, but most of them should still work.

 

If anything is inconsistent or confusing in an example, just post and I can clarify.

 

On 7/2/2018 at 8:25 AM, AndyB1580 said:

Have you tested the framework with CUP terrains?  It seems like there may be something funky with the CUP terrains that is affecting the framework's ground position functions and placing Ifrits and mortar emplacements under the sea for CUP islands.  Thanks.

 

I have made missions on various CUP maps in the past; I think the latest CUP Terrains version I tested was 1.3.0.  I have looked at the changelog for 1.4 and I don't see anything that could cause such a significant problem.  Can you post which terrain you are using and what the code is?

 

24 minutes ago, Andres97 said:

Very small detail, but this:

 

23V01hX.jpg?1

 

Is making me go crazy.

This happens when using Zen_SpawnGroup or Zen_SpawnInfantry and Zen_OrderInfantryPatrol, the second man is too close to the first one.

Have tried with setFormation and setWaypointFormation, doesn't seem to be the problem. Any ideas?

Also vehicles tend to drive too... erratically, even though they are set to 'SAFE' and 'LIMITED'.

 

Cheers!

 

 

I can't see that picture, but Zen_SpawnGroup (which Zen_SpawnInfantry uses) spawns all units very close together.  Their AI should make them go into a normal formation immediately and maintain it when they move.  You might have to repeat setFormation every time the group gets a new waypoint.  Also, make sure you're not running any AI mods and that the group is local.  Do the AI demonstrate the same behavior when placed close together in the editor and with editor waypoints (which are ostensibly the same as scripted)?
 

Zen_OrderVehicleMove does everything it can for AI driving, but the issues are with lower level AI code; I consider it a success if the vehicle reaches it destination at all.

 

Edit: It's much better to repeat the commands and ensure that the AI comply than have a function that doesn't work.  The first priority is to make the functions always do what they say they will.  Especially for functions dealing with the AI, as I have learned not to trust them.

Edited by Zenophon
  • Like 1

Share this post


Link to post
Share on other sites

Removing doMove and Move commands from the infantry patrol one makes the group move with a normal column formation.

Whats the reason behind this commands for infantry?

Share this post


Link to post
Share on other sites

Hi Zenophon! I tried to display a jpg image inside a Picture control using the dialog system, in particular i wanted to display the "editor preview" (configFile >> "CfgVehicles" >> "vehicleclass" >> "editorPreview"), but i had to change line 249 inside Zen_InvokeDialog.sqf from this:

//(lines from 243 to 253 inside "\Zen_FrameworkFunctions\Zen_DialogSystem\Zen_InvokeDialog.sqf"
case "PICTURE": {
if ((toUpper _controlType) in ["LIST","DROPLIST"]) then {
		for "_i" from 0 to (lbSize _control - 1) do {
		_control lbSetPicture [_i, _data select _i];
		};
} else {
		if ([".paa", _data] call Zen_StringIsInString) then {
			_control ctrlSetText _data;
		};
	};
};

to this:

//(lines from 243 to 253 inside "\Zen_FrameworkFunctions\Zen_DialogSystem\Zen_InvokeDialog.sqf"
case "PICTURE": {
if ((toUpper _controlType) in ["LIST","DROPLIST"]) then {
		for "_i" from 0 to (lbSize _control - 1) do {
		_control lbSetPicture [_i, _data select _i];
		};
} else {
		if ([".paa", _data] call Zen_StringIsInString || [".jpg", _data] call Zen_StringIsInString) then {
			_control ctrlSetText _data;
		};
	};
};

Is there a reason for display only paa images inside a "Picture" control?

Share this post


Link to post
Share on other sites

I cannot remember a specific reason for excluding .jpg; I didn't even include the check for pictures in a list.  Maybe I thought .paa was preferred or .jpg wouldn't work for some control types; it appears that .jpg is perfectly fine though.  I'll change it to allow .jpg in the next update.

Share this post


Link to post
Share on other sites

I am recently returned Arma fan and mission maker.  I am looking for something comprehensive like invade and annex type zone spawning.  I know this is not that however in looking over some scripts these could be placed in a "mission center" type file and with some additions like markers etc I think I could do this with some help.  I thought I would ask first to see if anyone else has done this or if anyone has some ideas on how to do this efficiently?  Thanks for the framework and am optimistic on creating this type of persistent mission. Thanks.

Share this post


Link to post
Share on other sites

You are pretty much in right place. Even if with your ugly face.

  • Haha 1

Share this post


Link to post
Share on other sites
On 10/3/2018 at 8:51 AM, davidoss said:

You are pretty much in right place. Even if with your ugly face.

 

Lol.  Did you get the reinforcements sqf to work? If so could you link a mission example.

 

It would be great if mission makers could link some vanilla missions already made up with this code.  Missions that deal with multiple markers, zones, unit spawns, etc.  I'd love to see it in action and possibly learn this library that way.  Your mission examples are good as well.

 

Please mission makers post some of your user missions for reference.

Share this post


Link to post
Share on other sites

The mission is not done yet  but i can give you reinforcement function if that will really help you.

Best way IMHO is  to read the framework documentary first.

	fnc_reinforcment = {

	params ["_ao"];

		missionNamespace setVariable [format ["reinforce_%1",markerText _ao], true, false];
			
		private _hspawnPos = ["mkReinfSpawn", [0, 200], [], 1] call Zen_FindGroundPosition;
		private _insertionPos = [_ao, [40, 120], [], 1, [2,100],[250,370,'compass']] call Zen_FindGroundPosition; 

		private _heli = [_hspawnPos,[
		
			"B_Heli_Transport_03_unarmed_F",
			"B_Heli_Transport_01_F",
			"B_Heli_Transport_01_camo_F",
			"B_CTRG_Heli_Transport_01_sand_F",
			"B_CTRG_Heli_Transport_01_tropic_F"
			
		],40,90] call Zen_SpawnHelicopter;
		
			null = [_heli, _ao] spawn {
				
				waitUntil {sleep 10; !(alive (_this select 0)) || (isNull (_this select 0))};
				missionNamespace setVariable [format ["reinforce_%1",markerText (_this select 1)], false, false];

			};
		
		private _gsits = [_heli, ['All']] call Zen_GetFreeSeats;
		private _sitscnt = count (_gsits select 2);
		
		private _reinf_grp = [_hspawnPos, WEST, "Infantry", _sitscnt, "Men", "BLU_F", [
		
			//blacklisted
			"B_soldier_UAV_F","B_soldier_PG_F","B_soldier_AA_F","B_soldier_AT_F","B_soldier_LAT_F","B_CTRG_soldier_GL_LAT_F","B_diver_F","B_diver_TL_F",
			"B_diver_exp_F","B_spotter_F","B_sniper_F","B_ghillie_sard_F","B_ghillie_ard_F","B_ghillie_lsh_F","B_recon_LAT_F","B_Protagonist_VR_F","B_Soldier_VR_F"

		],"All"] call Zen_SpawnInfantry;
		
		sleep 2;

		{
			_x assignAsCargo _heli;
			_x moveInCargo _heli;
			
		} foreach (units _reinf_grp);
		
		sleep 2;
			
		null = [_heli, _insertionPos, 10, "MOVE", "CARELESS", "GREEN", "FULL", "COLUMN",
			"
				(vehicle this) land 'LAND'

			"
		] call CBA_fnc_addWaypoint;
		
		
		private _heliPad = "Land_HelipadEmpty_F" createVehicle _insertionPos;

		waitUntil {sleep 5; ((getPos _heli) select 2) < 2};
		
		if (alive _heli) then {

			_reinf_grp leaveVehicle _heli;
			
			waitUntil {sleep 5; ([_reinf_grp, _heli]) call Zen_AreNotInVehicle};
		
			if (({alive _x} count (units _reinf_grp)) > 0) then {
						
				_wp = [_reinf_grp, _ao, 10, "MOVE", "AWARE", "WHITE", "FULL", "COLUMN",
				"
					private _marker = ([allMapMarkers, {((getMarkerPos _this) distance this) > 200}] call Zen_ArrayFilterCondition) select 0;
					null = [this, _marker, 50, 5, false] call CBA_fnc_taskDefend

				",[0,0,0],5] call CBA_fnc_addWaypoint;
			};
			
			sleep 5;
		
			null = [_heli, _hspawnPos, 10, "MOVE", "CARELESS", "GREEN", "FULL", "COLUMN",
			"

				deleteVehicle (vehicle this);
				{deleteVehicle _x;} forEach thislist

			"
			] call CBA_fnc_addWaypoint;

		};
		
		deleteVehicle _heliPad;
		(_reinf_grp)
	};

 

  • Thanks 1

Share this post


Link to post
Share on other sites

first off.... WOW... the example missions are scripted very nice. am impressed in your functions. a lot can happen inside your code. you sneaky man. :)

 

It makes me wonder how it is you have not made a bigger mission type to really showcase your work. There is invade and annex, patrol ops, king of the hill... all those are big time stuff for arma 3. 

 

I think you definitely have something to go that direction.

 

A few questions. I do not see you occupyhouse script. was it turned in to infantrygarrison script?

 

I was thinking about having a spawning mechanism based on editor placed markers defined by markerShape.

 

I am looking in to this type of spawning method how this is kind of how I think it will go.

 

1. Place 3 different kinds of markershapes on any map covering cities, military and small towns / industry.

 

2. Once mission starts a random marker is chosen and depending on its markerShape a specific mission type will spawn.

 

Once a trigger / mission is cleared the process starts over.  Eventually this and side missions will make it a persistent mission. The idea came from an older invade and annex type mission script.  

 

Are any of your functions designed for this?

 

 I have a feeling I will be asking you some additional questions. lul this is your only warning. get out while you can. lol

 

edited due to confusion.

Share this post


Link to post
Share on other sites

Occupy House is a separate script that doesn't require the framework (thread link in my signature); it tries to position units at windows and in the right direction.  It also relies on the built in positions defined by the building (buildingPos command); the framework offers Zen_FindBuildingPositions for any random point in a building (though the quality may vary).  Of course, you can combine these in a mission or even edit Occupy House to use Zen_FindBuildingPositions.

 

For placing markers, the editor is of course easier for visual placement, but you can use Zen_SpawnMarker if you want to create/delete lots of markers dynamically.

 

Once you have the markers, you can put them into an array and use Zen_ArrayGetRandom, Zen_ArrayGetRandomSequence, and Zen_ArrayShuffle to randomly use them one at a time or in a random order.  For a particular order, Zen_ArraySort can be given any comparator/hash function (there are a few macros for this).  If some markers have to be removed later, Zen_ArrayFilterCondition can help.

 

With the marker selected, Zen_FindGroundPosition (some argument macros offered here as well) is the main system for generating positions.  You might also use Zen_IsUrbanArea etc. (these scale with area/objects and might not run very fast) to determine what kind of filters you need.

 

You can then put this into a loop to repeat the objective.  Zen_CreateObjective offers some presets for you; for scripting your own, Zen_TriggerAreDead etc. can be surprisingly flexible.

 

I recommend browsing through the Index.txt in the root documentation folder; most of the functions have straightforward names, and it's much easier to find one there than looking through each full function documentation files.  The tutorials, demonstrations, and sample missions have a readme/intro with a short description of what's in each one; all the documentation tries to make it clear when previous knowledge is required.  As always, you can ask here for more examples or specific answers.

Share this post


Link to post
Share on other sites

Can you offer any guidelines on getting your foundation to work with IFA3?  East, West and Independent default to the vanilla  unit types when using your spawn functions.

Thanks.

 

Share this post


Link to post
Share on other sites

This is in the FAQ.txt under "Q: Can the framework easily spawn addon units?".  The Zen_RandomBattle demonstration explains how to use Zen_ConfigGetVehicleClasses to search for vanilla vehicles; you can just replace the keywords with those of addon vehicles/people.  This approach is meant to be very flexible and requires using the editor's config viewer.

 

If you have classnames for specific vehicles, you can given them directly to Zen_SpawnAircraft, Zen_SpawnGroundVehicle, etc..  Zen_SpawnGroup and Zen_SpawnVehicle are the more basic functions that actually do the spawning, if you want to use them directly.

 

For loadouts, the Zen_CustomLoadout demonstration explains how to get (with Zen_GetUnitLoadout) and format weapon/item/ammo classnames.

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

×