Zenophon

Zenophon's ArmA 3 Co-op Mission Making Framework

690 posts in this topic

10 hours ago, Mr. Lt. said:

 

Thanks it worked. I did try putting 4 men in there it just didnt work the 1st time.

 

the zen_spawninfantry is easier as it can put number of units with just the the scalar value but I cant get it to work with the addon units. I have ready somewhere here i need to look at the cfg file of the addon? then put the faction name of that unit and its corresponding classname?

 

 

 

Yes. Using addons you'll have to look for the correct parameters for options 5, 6 and 8 for it to work correctly.

Share this post


Link to post
Share on other sites

Thanks. Another one... i think i found some sqf in the frame where u can make the AI be a pilot and take players from base to a certain LZ depending where the active mission is. But now i cant find it in the framework. Not sure if its within this framework or another script. Can someone walk me through this please?

 

Thanks

Share this post


Link to post
Share on other sites

can this framework be used to make capture the town where red marker is on the map when not conquered and will turn green when conquered?

also how do I do this what scripts to use?

Share this post


Link to post
Share on other sites
17 hours ago, cdn_biggdogg said:

Yes. Using addons you'll have to look for the correct parameters for options 5, 6 and 8 for it to work correctly.

how do i find out the correct parameters for these?

Share this post


Link to post
Share on other sites
23 hours ago, Mr. Lt. said:

Thanks. Another one... i think i found some sqf in the frame where u can make the AI be a pilot and take players from base to a certain LZ depending where the active mission is. But now i cant find it in the framework. Not sure if its within this framework or another script. Can someone walk me through this please?

 

Thanks

 

You mean a one-way insertion that waits for the players to get in the helicopter?  As an example, I cut this out of the Abduction mission from ZMCM:

_heli = ["mkBase", "b_heli_transport_01_f", 0, random 360] call Zen_SpawnHelicopter;

waitUntil {
    sleep 2;
    ([_players] call Zen_AreInVehicle)
};

_h_insert = [_heli, [_lzPos, "mkBase"], _players, "full"] spawn Zen_OrderInsertion;

How you determine _lzPos is based upon the mission; it could be random, given by player input, etc.

 

22 hours ago, Mr. Lt. said:

can this framework be used to make capture the town where red marker is on the map when not conquered and will turn green when conquered?

also how do I do this what scripts to use?

 

A self-contained function for that is not provided by the framework, but the logical parts required to do it are.  You can use Zen_GetAllInArea to find the units inside the marker, as well as Zen_AreInArea and Zen_AreNotInArea to check for specific units being inside.

 

The exact logic of the script depends upon what you consider to be 'conquered' as well as if the Opfor can recapture the zone, but for as a simple example of one-time capture

// let's call it "mkTown"
waitUntil {
    sleep 2;
    (count (["mkTown", [], east] call Zen_GetAllInArea) == 0)
};

"mkTown" setMarkerColor "colorBlufor";

If you are using the task system, the above code is basically the same logic as that of Zen_TriggerAreaClear.

 

22 hours ago, Mr. Lt. said:

how do i find out the correct parameters for these?

 

Using the config viewer in the editor, 5, 6, and 8 would be 'vehicleClass', 'faction', and 'expansion' data fields.  Note that units are sorted and categorized in the editor based upon these, so e.g. all the Apex guerrilla units share the same 3 values (and thus are all in the same unit submenu).  You can also make use the blacklist argument to exclude any units from that set you don't want.  The code for those Apex units would be:

_group = [_pos, resistance, "infantry", [3,4], "Men", "IND_C_F", ["I_C_Soldier_base_unarmed_F", "I_C_Pilot_F"], "Expansion"] call Zen_SpawnInfantry;

where we've left out the unarmed unit and the pilot (and confusingly the expansion value is 'Expansion', but that's the value for all Apex classes).

 

1 person likes this

Share this post


Link to post
Share on other sites
2 hours ago, Zenophon said:

 

You mean a one-way insertion that waits for the players to get in the helicopter?  As an example, I cut this out of the Abduction mission from ZMCM:


_heli = ["mkBase", "b_heli_transport_01_f", 0, random 360] call Zen_SpawnHelicopter;

waitUntil {
    sleep 2;
    ([_players] call Zen_AreInVehicle)
};

_h_insert = [_heli, [_lzPos, "mkBase"], _players, "full"] spawn Zen_OrderInsertion;

How you determine _lzPos is based upon the mission; it could be random, given by player input, etc.

 

 

A self-contained function for that is not provided by the framework, but the logical parts required to do it are.  You can use Zen_GetAllInArea to find the units inside the marker, as well as Zen_AreInArea and Zen_AreNotInArea to check for specific units being inside.

 

The exact logic of the script depends upon what you consider to be 'conquered' as well as if the Opfor can recapture the zone, but for as a simple example of one-time capture


// let's call it "mkTown"
waitUntil {
    sleep 2;
    (count (["mkTown", [], east] call Zen_GetAllInArea) == 0)
};

"mkTown" setMarkerColor "colorBlufor";

If you are using the task system, the above code is basically the same logic as that of Zen_TriggerAreaClear.

 

 

Using the config viewer in the editor, 5, 6, and 8 would be 'vehicleClass', 'faction', and 'expansion' data fields.  Note that units are sorted and categorized in the editor based upon these, so e.g. all the Apex guerrilla units share the same 3 values (and thus are all in the same unit submenu).  You can also make use the blacklist argument to exclude any units from that set you don't want.  The code for those Apex units would be:


_group = [_pos, resistance, "infantry", [3,4], "Men", "IND_C_F", ["I_C_Soldier_base_unarmed_F", "I_C_Pilot_F"], "Expansion"] call Zen_SpawnInfantry;

where we've left out the unarmed unit and the pilot (and confusingly the expansion value is 'Expansion', but that's the value for all Apex classes).

 

 

Thanks. I have figured out the spawn infantry, in have used the view CFG in editor and to find out the paratmeters and it worked.

 

regarding the capturable town, how would I make it so if the AI counter attacks and players are killed it will turn into their side. wanted it recapturable by East side again when no blu for are present.

trying to find tutorial for this but cant find any.

 

Share this post


Link to post
Share on other sites
2 hours ago, Mr. Lt. said:

 

Thanks. I have figured out the spawn infantry, in have used the view CFG in editor and to find out the paratmeters and it worked.

 

regarding the capturable town, how would I make it so if the AI counter attacks and players are killed it will turn into their side. wanted it recapturable by East side again when no blu for are present.

trying to find tutorial for this but cant find any.

 

Look in the object functions section. You can use:

Zen_AreInArea

Determines whether all (1) are inside (2) or the logical polygon.
Usage : Call
Params: 1. Array, group, object, side, objects to test
    AND
        2. String, a marker
 (opt.) 3. Array, markeMy Activity Streams rs units cannot be in, (default: [])
    OR
        2. Array, group, object, string, the center of the polygon
        3. Array, the dimensions of the polygon
            1. Scalar, the horizontal radius
            2. Scalar, the vertical radius
        4. Scalar, the angle of the polygon as rotated from 0 degrees
        5. String, the shape of the polygon, only 'ellipse' or 'rectangle'
 (opt.) 6. Array, markers units cannot be in, (default: [])
Return: Boolean, true if all are inside

and/or (probably this one)

Zen_AreNotInArea

Determines whether none of (1) is inside (2) or the logical polygon.
Usage : Call
Params: 1. Array, group, object, side, objects to test
    AND
        2. String, a marker
 (opt.) 3. Array, markers units cannot be in, (default: [])
    OR
        2. Array, group, object, string, the center of the polygon
        3. Array, the dimensions of the polygon
            1. Scalar, the horizontal radius
            2. Scalar, the vertical radius
        4. Scalar, the angle of the polygon as rotated from 0 degrees
        5. String, the shape of the polygon, only 'ellipse' or 'rectangle'
 (opt.) 6. Array, markers units cannot be in, (default: [])
Return: Boolean, true if none is in the given area

to create logic in your mission to change colour of the marker and set conditions as you want them for who has control.

 

I highly recommend going through all the documentation Zenophon has provided and you will find that most of the questions are answered in there! He's sub-divided it smartly into sections of what the functions do (e.g. spawning, positioning etc.)

Share this post


Link to post
Share on other sites

Yes thanks. Im going through it everyday. But i do encounter problems when i wanted to use addon units/vehicles.

 

I have encounterrd a problem when doing the helicopter insertion where it calls the zenspawnheli which is also connected to spawnvehicle crew.

 

I have used the classname for huey helicopter from unsung mod and used pilot from unsung. But when i start the mission me and my squad are in the heli for insertion but no pilot so we crashed to death. But when i use the heli from vanilla i can see the addon pilot driving the heli. 

 

So i think the problem is using the addon heli? How do i overcome this?

 

Thanks

Share this post


Link to post
Share on other sites
1 hour ago, Mr. Lt. said:

Yes thanks. Im going through it everyday. But i do encounter problems when i wanted to use addon units/vehicles.

 

I have encounterrd a problem when doing the helicopter insertion where it calls the zenspawnheli which is also connected to spawnvehicle crew.

 

I have used the classname for huey helicopter from unsung mod and used pilot from unsung. But when i start the mission me and my squad are in the heli for insertion but no pilot so we crashed to death. But when i use the heli from vanilla i can see the addon pilot driving the heli. 

 

So i think the problem is using the addon heli? How do i overcome this?

 

Thanks

 

I don't use the unsung mod so I'm not sure why the pilot isn't there. The way around it would be to spawn the heli and then spawn the pilot on the ground then move him into the vehicle using:

 

Zen_MoveInVehicle

Places all (1) in (2) instantly.  It is fully multiplayer compatible and synch'd.  Extra
units will be left behind.
Usage : Spawn
Params: 1. Array, group, object, side, units
        2. Object, the vehicle
 (opt.) 3. String, where to put the units, 'Cargo', 'Driver', 'Turret', 'All', (default: 'Cargo')
 (opt.) 4. Array, string, turret to put units, 'All' 'Commander' 'Gunner' 'CargoFFV', (default: ['All'])
Return: Void

I have used this method in several missions and it works fine (I recommend putting a sleep of 0.2 to 0.5 between spawning the heli and the pilot but you need to move the pilot quickly if the heli is airborne). This works especially well when you want to spawn a vehicle and put units in from another faction or side.

Share this post


Link to post
Share on other sites

picthanks. i have tried it as soon as ive seen my reply. im not an expert as you can see, and i get an error message. so i have this code, but it manages to transport me to the insertion point and wait for me to get out then they take off. (that's good) but the error i get isn't ,check out the pic. thanks.

I had to spawn a group to be the heli pilot because the spawnvehiclecrew in the spawnhelicopter.sqf does not work for me. if anyone can show better solution it would be helpful thanks!"

 

_heliSpawnPos = ["lzblu", [1000,1200]] call
Zen_FindGroundPosition;
_helicopter = [_heliSpawnPos, "GR_UH1H_2", 80] call Zen_SpawnHelicopter;
sleep 0.5;
_grp1 = ["startblu", ["uns_pilot1","uns_pilot2"]] call Zen_SpawnGroup;
0 = [_grp1, _helicopter, "all"] call Zen_MoveInVehicle;
sleep 0.5;
0 = [_helicopter, ["startblu", _heliSpawnPos], (group player), "full", 80] spawn Zen_OrderInsertion;
sleep 0.5;
0 = [(group player), _helicopter] call Zen_MoveInVehicle;
sleep 120;

heres the pic

http://steamcommunity.com/sharedfiles/filedetails/?id=887339793

 

 

Share this post


Link to post
Share on other sites
15 hours ago, Mr. Lt. said:

picthanks. i have tried it as soon as ive seen my reply. im not an expert as you can see, and i get an error message. so i have this code, but it manages to transport me to the insertion point and wait for me to get out then they take off. (that's good) but the error i get isn't ,check out the pic. thanks.

I had to spawn a group to be the heli pilot because the spawnvehiclecrew in the spawnhelicopter.sqf does not work for me. if anyone can show better solution it would be helpful thanks!"

 

_heliSpawnPos = ["lzblu", [1000,1200]] call
Zen_FindGroundPosition;
_helicopter = [_heliSpawnPos, "GR_UH1H_2", 80] call Zen_SpawnHelicopter;
sleep 0.5;
_grp1 = ["startblu", ["uns_pilot1","uns_pilot2"]] call Zen_SpawnGroup;
0 = [_grp1, _helicopter, "all"] call Zen_MoveInVehicle;
sleep 0.5;
0 = [_helicopter, ["startblu", _heliSpawnPos], (group player), "full", 80] spawn Zen_OrderInsertion;
sleep 0.5;
0 = [(group player), _helicopter] call Zen_MoveInVehicle;
sleep 120;

heres the pic

http://steamcommunity.com/sharedfiles/filedetails/?id=887339793

 

 


 

Zen_SpawnHelicopter

Spawns a helicopter of side or type (2) at (1).  Spawns a crew of the correct side.
A height of 0 starts the helicopter on the ground, otherwise it starts with its
engines running and in flight. Does not work for UAV's.
Usage : Call
Params: 1. Array, group, object, string, the spawn point
    AND
        2. Side, the side of the random vehicle to spawn
    OR
        2. Array, strings, the classname(s) of vehicle(s) to randomly spawn
    AND
 (opt.) 3. Scalar, the height, (default: 40)
 (opt.) 4. Scalar, the direction that the vehicle is facing, in degrees, (default: 0)
    AND IF (2) == Side
 (opt.) 5. Array, string, the faction(s) of the random vehicle to spawn, (default: 'All')
 (opt.) 6. Array or string, DLC type(s), 'All' for all DLC, (default: '')
Return: Object

This will try to spawn the heli crew so I'm guessing that that helo is incorrectly configured. So to stop the error use :

 

_helicopter = [_heliSpawnPos, "GR_UH1H_2", 80] call Zen_SpawnVehicle;
Zen_SpawnVehicle

Spawns a vehicle of (2).  If the height is greater than 0, the vehicle starts in flight.
Uses ASL over the ocean.  Do not use a human classname, only inanimate objects.
Usage : Call
Params: 1. Array, group, object, string, the place to spawn
        2. String, the classname of the vehicle to spawn
 (opt.) 3. Scalar, the height above the ground to spawn the vehicle, (default: 0)
 (opt.) 4. Scalar, the direction the vehicle faces, in degrees, (default: 0)
 (opt.) 5. Boolean, true to set the vehicle's position exactly at the point, (default: false)
Return: Object

and then move the pilots into it!

Share this post


Link to post
Share on other sites

it worked for me. so after I got inserted, the heli goes back to spawn point.  and lands and waits forever, is there a way to despawn it? so if a new player joins midgame it will spawn again then despawn

Share this post


Link to post
Share on other sites
15 hours ago, Mr. Lt. said:

it worked for me. so after I got inserted, the heli goes back to spawn point.  and lands and waits forever, is there a way to despawn it? so if a new player joins midgame it will spawn again then despawn

 

Option 7!!

 

Zen_OrderInsertion

Orders (1) to go to each of (2) in order.  It waits for all (3) to get out of (1) at (2.1).
Then, if (2.2) is given, it goes there and waits forever; otherwise, it stops at (2.1)
forever.  Stops executing when (3) get out and (1) stops forever.  Works for all vehicles.
Usage : Spawn
Params: 1. Object, vehicle
    AND
        2. Array, the positions
            1. Array, group, object, string, the point to insert
     (opt.) 2. Array, group, object, string, where to land next
    OR
        2. Array, group, object, string, the position
    AND
        3. Array, object, group, side, the passengers to get off
 (opt.) 4. String, speed of (1), 'limited' 'normal' 'full', (default: 'normal')
    AND IF (1) is a helicopter
 (opt.) 5. Scalar, the height to fly at, (default: 40)
 (opt.) 6. String, insertion type, 'land', 'fastrope', 'parachute', (default: 'land')
 (opt.) 7. Boolean, true to delete (1) at the end, (default: false)
Return: Void

 

Share this post


Link to post
Share on other sites

thanks. I didnt see that one. i was looking at a different SQF

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