Jump to content
Sign in to follow this  
avibird 1

How do you create two Markers from a players position at a different distance away!

Recommended Posts

I am working on dynamic base building mission/script using the ARMA2 compositions I have no issue when using only one composition that will spawn at the players current location using the set marker command in a SQF. My issues is I want to use two different compositions at the same dynamic base BUT I can't get the compositions to spawn at a small distance away from each other or get two different markers down using the same SQF to call the script during the mission.

The first Hqd2 works fine but the second one will not show up.

	player sideChat "Requesting British Outpost to build in our Area Of Operations";
sleep 2;
PAPABEAR=[West,"HQ"]; 
PAPABEAR SideChat "Roger that, Sparrow 2 will be operational soon";
sleep 5;

hqd2 = createMarker ["hqd2", position player];
hqd2 setMarkerType "Select";
hqd2 setMarkerText "Sparrow 2";
hqd2 setMarkerColor "ColorBlue";
hqd2 = "SmokeShellPurple" createVehicle (position player);
hqd2 = "SmokeShellOrange" createVehicle (position player);


hqd3 = createMarker ["hqd3", position player,25];
hqd3 setMarkerType "Headquarters";
hqd3 setMarkerText "new base location";
hqd3 setMarkerColor "ColorRED";
hqd3 = "SmokeShellYellow" createVehicle (position player,25);
hqd3 = "SmokeShellGreen" createVehicle (position player,25);

This is what I use to call the compositions.

hq2d = createVehicle ["Land_radar", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 0, "NONE"];
deleteVehicle hq2;
sleep 3;

hq2sb = [getPos hq2d, random 360, "cityBase04"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

hq3sb = [getPos hq3d, random 360, "cityBase03"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

I can only get the first one to spawn any help would be great!

Share this post


Link to post
Share on other sites

At first glance, a couple of formatting issues. You need to use getMarkerPos, not getPos, the getMarkerPos part needs to be in parentheses, and marker names need to be in quotes:

hq2sb = [(getMarkerPos "hq2d"), random 360, "cityBase04"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

hq3sb = [(getMarkerPos "hq3d"), random 360, "cityBase03"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

Not sure what's going on here:

hq2d = createVehicle ["Land_radar", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 0, "NONE"];
deleteVehicle hq2;

hqd2 is already defined (it's the name of one of your markers). Also, where is hq2 defined?

Edited by Harzach

Share this post


Link to post
Share on other sites

@Harzach hey thank you for your reply. First the formatting issues of not using getMarkerPos is not a major problem the script works fine. if I am using only one marker at a time. I will switch it out if you say it is not the proper formatting Syntax (:

____________________________________________________________________________________________

Not sure what's going on here:

PHP Code:

hq2d = createVehicle ["Land_radar", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 0, "NONE"];

deleteVehicle hq2;

hqd2 is already defined (it's the name of one of your markers). Also, where is hq2 defined?

____________________________________________________________________________________________

The hq2 is a part of the scripts that allows the player to call for the FOB to be build during the mission. Actually you are using two SQF's to call/build the FOB's. The first part calls the marker and adds a action menu to an object that allows the player to call in various support units from the base the second SQF builds the base using the compositions. Hope you understand what I am saying.

Let me restated How can I call a marker position not using the players exact location.

I want the marker to be placed down like 25 meters away from the player. I have attempted to use the

[(player ModelToWorld [0,+25,0]), 0]

and

[ position player, 25];

This is the first part that calls the marker on the map

player sideChat "Requesting British Outpost to build in our Area Of Operations";

sleep 2;

PAPABEAR=[West,"HQ"];

PAPABEAR SideChat "Roger that, Sparrow 2 will be operational soon";

sleep 5;

hqd2 = createMarker ["hqd2", position player];

hqd2 setMarkerType "Select";

hqd2 setMarkerText "Sparrow 2";

hqd2 setMarkerColor "ColorBlue";

hqd2 = "SmokeShellPurple" createVehicle (position player);

hqd2 = "SmokeShellOrange" createVehicle (position player);

GroupHQ2 = CreateGroup WEST;

hq2 = createVehicle ["BAF_Merlin_HC3_D", [(getpos player) select 0,(getpos player) select 1,0], [], 0, "FLY"];

lav21 = GroupHQ2 createUnit ["BAF_Pilot_DDPM", [0,0,1], [], 0, "CAN_COLLIDE"];

lav21 moveInDriver hq2;

hq2 FlyInHeight 400;

wp1 = GroupHQ2 addwaypoint [position player, 0];

wp1 setwaypointtype "MOVE";

wp2 = GroupHQ2 addwaypoint [position player, 1];

wp2 setwaypointtype "GETOUT";

wp2 setWaypointBehaviour "CARELESS";

wp2 setWaypointSpeed "LIMITED" ;

h1 = "HeliH" createVehicle (position player);

hq2 setVehicleLock "LOCKED";

hq2ac1 = hq2 addaction ["Deploy Base", "Avisupport\fob\hq2.sqf"];

the second one will build the FOB ie composition and add the menu to the to allow the player to call in other support units.

hq2 removeaction hq2ac1;

hint "Building British Outpost...";

{deleteVehicle _x} forEach (units GroupHQ2);

GroupHQ2Inf = CreateGroup WEST;

BAFHQ1 = GroupHQ2Inf createUnit ["BAF_Soldier_Officer_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 0, "NONE"];

BAFHQ2 = GroupHQ2Inf createUnit ["BAF_Soldier_SL_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ3 = GroupHQ2Inf createUnit ["BAF_Soldier_Marksman_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ4 = GroupHQ2Inf createUnit ["BAF_Soldier_MG_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ5 = GroupHQ2Inf createUnit ["BAF_Soldier_AR_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ6 = GroupHQ2Inf createUnit ["BAF_Soldier_AT_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ7 = GroupHQ2Inf createUnit ["BAF_Soldier_AT_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ8 = GroupHQ2Inf createUnit ["BAF_Soldier_GL_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ9 = GroupHQ2Inf createUnit ["BAF_Soldier_FAC_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ10 = GroupHQ2Inf createUnit ["BAF_Soldier_AT_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ11 = GroupHQ2Inf createUnit ["BAF_Soldier_AT_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ12 = GroupHQ2Inf createUnit ["BAF_Soldier_EN_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ13 = GroupHQ2Inf createUnit ["BAF_Soldier_Medic_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ14 = GroupHQ2Inf createUnit ["BAF_Soldier_AA_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ15 = GroupHQ2Inf createUnit ["BAF_Soldier_AA_DDPM", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 10, "NONE"];

BAFHQ1 = leader BAFHQ1;

{

_x setSkill 1;

[_x, 2] spawn grantUnlimitedAmmo;

} foreach units GroupHQ2Inf;

wp1 = GroupHQ2Inf addwaypoint [position hq2d, 0];

wp1 setwaypointtype "SENTRY";

wp1 setWaypointCombatMode "YELLOW";

wp1 setWaypointFormation "DIAMOND";

wp1 setWaypointSpeed "FULL";

wp1 setWaypointBehaviour "AWARE";

wp2 = GroupHQ2Inf addwaypoint [position hq2d, 400];

wp2 setwaypointtype "SAD";

wp2 setWaypointCombatMode "YELLOW";

wp2 setWaypointFormation "WEDGE";

wp2 setWaypointSpeed "FULL";

wp2 setWaypointBehaviour "AWARE";

wp2 setWaypointCompletionRadius 50;

wp2 = GroupHQ2Inf addwaypoint [position hq2d, 0];

wp2 setwaypointtype "CYCLE";

wp2 setWaypointCombatMode "YELLOW";

wp2 setWaypointFormation "VEE";

wp2 setWaypointSpeed "FULL";

wp2 setWaypointBehaviour "AWARE";

sleep 3;

deleteVehicle chkhq2a;

deleteVehicle chkhq2;

hq2d = createVehicle ["M1130_HQ_unfolded_Base_EP1", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 0, "NONE"];

deleteVehicle hq2;

sleep 3;

hq2sb = [getPos hq2d, random 360, "cityBase04"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

sleep 3;

"respawn_west_2" setMarkerPos getMarkerPos "hqd2";

respawn_west_2 setMarkerType "Town";

respawn_west_2 setMarkerColor "ColorBlue";

hq2dac1 = hq2d addAction ["FOB Menu", "Avisupport\menu\hq_menu2.sqf", [], 0, true, true, "", ""];

coin2 setPos (getPos hq2d);

[] execVM "Avisupport\menu\hq_var2.sqf";

hint "British Outpost Sparrow 2 has been constructed"

I just need a way to add a marker X meters away from the players location when he calls for the marker location dynamically during the mission. Can this be done?

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites

You simply can't getPos/setPos a marker - you must use getMarkerPos/setMarkerPos.

Do you want the marker created 25 meters away in a specific direction? The direction the player is facing? A random direction?

//_markDir = ###; 					//script-defined
//_markDir = getDir player;  		 //direction player is facing
//_markDir = (0 + (random 359));  	//random direction

//use only one of the above!

_markDist = 25;
_distX = round(_markDist * sin _markDir);
_distY = round(_markDist * cos _markDir);
deleteMarker "hq2d";
hqd2 = createMarker ["hq2d", [(getPos player select 0) + _distX, (getPos player select 1) + _distY, 0]];

Tested and working. I added a deleteMarker so that the script can be run multiple times if needed.

Edited by Harzach

Share this post


Link to post
Share on other sites

Hey sorry I am still a little lost!

I attempted to use this

hqd2 = createMarker ["hqd2", position player];

hqd2 setMarkerType "Select";

hqd2 setMarkerText "Sparrow 2";

hqd2 setMarkerColor "ColorBlue";

hqd2 = "SmokeShellPurple" createVehicle (position player);

hqd2 = "SmokeShellOrange" createVehicle (position player);

_markDist = 40;

_distX = round(_markDist * cos _markDir);

_distY = round(_markDist * sin _markDir);

hqd3 = createMarker [(getPos player select 0) + _distX, (getPos player select 1) + _distY, 0];

hqd3 setMarkerType "Select";

hqd3 setMarkerText "new marker 2";

hqd3 setMarkerColor "ColorRED";

hqd3 = "SmokeShellPurple" createVehicle (position player);

hqd3 = "SmokeShellOrange" createVehicle (position player);

My first marker gets placed down but no second marker noted on the map! the script works fine but I need a second marker to be able to have a second composition spawn when the base is build using this

hq2sb = [getPos hq2d, random 360, "cityBase04"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

hq3sb = [getPos hq3d, random 360, "cityBase03"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

help lol

Share this post


Link to post
Share on other sites

Which option are you using for markDir? Note that I made some corrections since I first posted that code.

If you want it where the player is facing:

hqd2 = createMarker ["hqd2", position player];
hqd2 setMarkerType "Select";
hqd2 setMarkerText "Sparrow 2";
hqd2 setMarkerColor "ColorBlue";
hqd2 = "SmokeShellPurple" createVehicle (position player);
hqd2 = "SmokeShellOrange" createVehicle (position player);

_markDir = getDir player;
_markDist = 40;
_distX = round(_markDist * sin _markDir);
_distY = round(_markDist * cos _markDir);

hqd3 = createMarker ["hqd3", [(getPos player select 0) + _distX, (getPos player select 1) + _distY, 0]];  
hqd3 setMarkerType "Select";
hqd3 setMarkerText "new marker 2";
hqd3 setMarkerColor "ColorRED";
hqd3 = "SmokeShellPurple" createVehicle (position player);
hqd3 = "SmokeShellOrange" createVehicle (position player);

---------- Post added at 21:21 ---------- Previous post was at 21:15 ----------

Also, you have to use getMarkerPos and marker names in quotes for these to work, else your compositions will spawn at [0,0,0]:

hq2sb = [getMarkerPos "hqd2", random 360, "cityBase04"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf "));

hq3sb = [getMarkerPos "hqd3", random 360, "cityBase03"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf "));

---------- Post added at 21:31 ---------- Previous post was at 21:21 ----------

Some confusion there regarding naming - just cleaned some things up.

Edited by Harzach

Share this post


Link to post
Share on other sites

Hey Harzach I want to thank you for your replies and help on this road block. My issue of spawning two compositions while using my dynamic base building/support script/mission is solved. It was quite simple.

hq2d = createVehicle ["FlagCarrierWhite_EP1", [(getpos hq2) select 0,(getpos hq2) select 1,0], [], 0, "NONE"];

deleteVehicle hq2;

sleep 3;

hq2sb = [getPos hq2d, random 0, "CityBase02_EP1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

hq3sb = [position Player, 20, "CityBase04_EP1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

The first composition will get Spawned at the hq2d object which is the hq2 marker location from the first SQF that is called by the player.

The second composition will get Spawned 20 meters away from the first composition which will make a good size FOB for the players.

The hq2d object will have a menu attached to it that will allow the player to spawn various support units and other base objects.

Having two markers placed down on the map was never the main focus it was getting the two compositions to spawn at slightly different locations from the same SQF to make one big fortification for the FOB. My issues was the two compositions would spawn on each other with my attempts. Now if I want to spawn three compositions to make a very large fortification dynamically I see no other way but to use different markers locations to spawn them into the mission.However three is just to big giving the fact it will take up to much terrain and it would be hard during a dynamic mission to find that much flat area always were you would need to build the FOB's.

You keep saying the You simply can't getPos/setPos a marker - you must use getMarkerPos/setMarkerPos.

But you really can. My script works fine using it my way however YOUR WAY is most likely more efficient and I will change the code lines that you have provided to me (:

I again thank you for your time and help. I have one more questions and major problem. I have the coin interface attached to an object that gets spawned inside the FOB's all works fine but after the player moves the FOB's to a new location the coin menu will not show up anymore. I can get the coin interface menu attached to a player and after death it will show up again but not an object ie flag pole. Do you have any clue why. I know the coin interface was never completed finished by BOHEMIA like the HC. I don't know if that is a bug or not for ARMA2/OA. Avibird. My mission is a domination/warfare/insurgency type mission hybrid that can be played COOP or P vs P.

Share this post


Link to post
Share on other sites

Happy to help where I can!

I'd be very interested to see your finished scripts, so as to determine what is actually happening there with getPos and markers. It literally should not work, so something else must be going on.

As for the COIN module, I have never really messed around with the default BIS modules much, so I don't know how they behave or what their properties as objects are. From what I do understand, it must be synchronized to a player/players. Hopefully someone can chime in on that...

Share this post


Link to post
Share on other sites

Couldn't you just use an offset such as:

_posOk = [getMarkerPos "checkpointmkr" select 0,getMarkerPos "checkpointmkr" select 1,0];
_posOkOffset = [getMarkerPos "checkpointmkr" select 0, (getMarkerPos "checkpointmkr" select 1) - 20,0];

Though I'm not sure that would work. As I always use a logic like invisible helipad for getPos object when placing compositions.

---------- Post added at 07:48 PM ---------- Previous post was at 07:34 PM ----------

As for finding a large and clear enough area you can use isFlatEmpty

_candidate_fnc = {
_goodPos = nil;
_dis = 4500;
_cooX = (getPos makemarker select 0);
_cooY = (getPos makemarker select 1);
_wheX = random (_dis*2)-_dis;
_wheY = random (_dis*2)-_dis;
_TskmarkerRandomPos = [_cooX+_wheX,_cooY+_wheY,0];
_newPos = _TskmarkerRandomPos isFlatEmpty [20,50,0.7,2,0,false,player]; //isFlatEmpty when given position _newPos should return a flat and empty area close by if it can. If it cannot it returns an empty variable presumably. You may want to alter the values inside the square brackets.
while {(count _newPos) < 1} do {//Loop the following code so long as isFlatEmpty cannot find a valid position near the current _TskmarkerRandomPos.
	_newPos = _TskmarkerRandomPos isFlatEmpty [27,384,0.7,2,0,false,player];
	//hint "searching suitable pos for checkpoint";
	sleep 2.4;
};
_marker2 = createMarkerLocal ["checkpointmkr", _newPos];
_marker2 setMarkerShapeLocal "ELLIPSE";
"checkpointmkr" setMarkerSizeLocal [1, 1];
"checkpointmkr" setMarkerShapeLocal "ICON";
"checkpointmkr" setMarkerTypeLocal "EMPTY";

_sudoNewPos = [ getMarkerPos "checkpointmkr" select 0, ( getMarkerPos "checkpointmkr" select 1)];

_goodPos = _sudoNewPos;

//deleteMarkerLocal "checkpointmkr";	
};

while {sleep 0.2; isNil "_goodPos"} do 
{
call _candidate_fnc;
sleep 2.4;
};

Just change the first parameter of isFlatEmpty from 20 to however large an area you need.

makemarker is a invisible helipad located in the center of the map.

This will search up to 4500 meters away from that logic.

Edited by Jigsor

Share this post


Link to post
Share on other sites

@Harzach I have been working on this script/misson for a long time! I no clue what I am doing when it comes down to any real scripting a lot of trial and error on my part lol but the mission is shaping up very well I must say. If you ever want to help test play and see what I going on just look for my host server Avibird-PC

@Jigsor the compositions are not placed down via editor the FOB's can be build any where the commanders want dynamically during the mission.

Share this post


Link to post
Share on other sites

Right, I understand how the compositions are made via script. I was referring to an central object used as a logic placed on the map in the editor.

Here is an example of a working script I have That does exactly what you are trying to do. Its in my mission Over_The_Reich

Its got some extra stuff in there as this is actually a script for an objective. It basically spawns a Checkpoint composition on a road and detects when its vehicles are destroyed.

/*
Checkpoint.sqf mission by Jigsor=BMR= http://bmr-squad.com/ dcofield67@yahoo.com
Starts in playertasks.sqf
*/

if (!isServer) exitWith {};

private ["_goodPos","_dis","_cooX","_cooY","_wheX","_wheY","_newPos","_marker","_marker2","_TskmarkerRandomPos","_Target1","_VarName2","_sudoNewPos","_eastbase1a","_westbase1a","_westbase2a","_lake","_candidate_fnc","_posOk","_posOkOffset","_pad","_Jig_Composition","_roads","_roadPos","_roadDir"];

markersready = false;
publicVariable "markersready";
//hint "checkpoint markersready false";//debug

_candidate_fnc = {
_goodPos = nil;
_dis = 4500;
_cooX = (getPos makemarker select 0);
_cooY = (getPos makemarker select 1);
_wheX = random (_dis*2)-_dis;
_wheY = random (_dis*2)-_dis;
_TskmarkerRandomPos = [_cooX+_wheX,_cooY+_wheY,0];
_newPos = _TskmarkerRandomPos isFlatEmpty [20,50,0.7,2,0,false,player]; //isFlatEmpty when given position _newPos should return a flat and empty area close by if it can. If it cannot it returns an empty variable presumably. You may want to alter the values inside the square brackets.
while {(count _newPos) < 1} do {//Loop the following code so long as isFlatEmpty cannot find a valid position near the current _TskmarkerRandomPos.
	_newPos = _TskmarkerRandomPos isFlatEmpty [27,384,0.7,2,0,false,player];
	//hint "searching suitable pos for checkpoint";
	sleep 2.4;
};
_marker2 = createMarkerLocal ["tempcheckpointmkr", _newPos];
_marker2 setMarkerShapeLocal "ELLIPSE";
"tempcheckpointmkr" setMarkerSizeLocal [1, 1];
"tempcheckpointmkr" setMarkerShapeLocal "ICON";
"tempcheckpointmkr" setMarkerTypeLocal "EMPTY";

_sudoNewPos = [ getMarkerPos "tempcheckpointmkr" select 0, ( getMarkerPos "tempcheckpointmkr" select 1)];
_eastbase1a = [ getMarkerPos "eastbase1" select 0, (getMarkerPos "eastbase1" select 1)];
_westbase1a = [ getMarkerPos "westbase1" select 0, (getMarkerPos "westbase1" select 1)];
_westbase2a = [ getMarkerPos "westbase2" select 0, (getMarkerPos "westbase2" select 1)];
_lake = [ getMarkerPos "Topolkalake" select 0, (getMarkerPos "Topolkalake" select 1)];

if (_sudoNewPos distance _eastbase1a >2900) then
{
	if (_sudoNewPos distance _westbase1a >2900) then 
	{
		if (_sudoNewPos distance _westbase2a >2900) then
		{
			if (_sudoNewPos distance _lake >50) then
			{
				_goodPos = _sudoNewPos;// minimum distance from a base is 2900
			};
		};
	};
};
deleteMarkerLocal "tempcheckpointmkr";	
};

while {sleep 0.2; isNil "_goodPos"} do 
{
call _candidate_fnc;
sleep 2.4;
};

_roads = _newPos nearRoads 600;
_roadPos = _roads call BIS_fnc_selectRandom;
_roads = _roads - [_roadPos];
_roadPos = _roads select 0;

//diag_log format["Position of Road Block is %1", getpos _roadPos];

if (!isNil "_roadPos") then
{	
if (!isNil "checkpointmkr") then {deleteMarker "checkpointmkr";};
_marker = createMarker ["checkpointmkr", _roadPos];
_marker setMarkerShape "ELLIPSE";
"checkpointmkr" setMarkerSize [1, 1];
"checkpointmkr" setMarkerShape "ICON";
"checkpointmkr" setMarkerType "Empty";
"checkpointmkr" setMarkerColor "ColorOrange";//ColorRed,ColorOrange,ColorGreen
"checkpointmkr" setMarkerText "     Check Point";
"checkpointmkr" setMarkerDir ((direction _roadPos) -289);// point marker in direction of road
publicVariable "checkpointmkr";
sleep 0.2;
} else {
if (!isNil "checkpointmkr") then {deleteMarker "checkpointmkr";};
_marker = createMarker ["checkpointmkr", _newPos];
_marker setMarkerShape "ELLIPSE";
"checkpointmkr" setMarkerSize [1, 1];
"checkpointmkr" setMarkerShape "ICON";
"checkpointmkr" setMarkerType "Empty";// set DOT after composition creation
"checkpointmkr" setMarkerColor "ColorOrange";//ColorRed,ColorOrange,ColorGreen
"checkpointmkr" setMarkerText "     Check Point";	
publicVariable "checkpointmkr";
sleep 0.2;
};

// Move task marker and logics to the newly chosen random location
"task5mkr" setMarkerPos (getmarkerPos "checkpointmkr");
oa1invhelipad setPosATL (getmarkerPos "checkpointmkr");
H3 setPosATL (getmarkerPos "checkpointmkr");
damage_pos_logic setPosATL (getmarkerPos "checkpointmkr");
if (!isNil "_roadPos") then
{	
damage_pos_logic setDir ((direction _roadPos) -289);// point logic in direction of road
_roadDir = getDir damage_pos_logic;
//diag_log format["Direction of Road Block is %1", _roadDir];
};

// Spawn a composition class name
// syntax:	_newComp = [(getPos this), (getDir this), "fuelDepot_us"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

//_Bis_Composition = checkpoint1_us;
_Jig_Composition = JigCheckpointE;

_posOk = [getMarkerPos "checkpointmkr" select 0,getMarkerPos "checkpointmkr" select 1,0];
_posOkOffset = [getMarkerPos "checkpointmkr" select 0, (getMarkerPos "checkpointmkr" select 1) - 20,0];

_VarName2="opforcheckpoint";

//_Target1 = [_posOkOffset, 359, "fuelDepot_us"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
//null= ["MyComposition", 0, getpos this] execVM "Createcomposition.sqf"; 

if (!isNil "_roadPos") then
{	
null = ["JigCheckpointE", _roadDir, getpos damage_pos_logic] execVM "Scripts\j_server\Createcomposition.sqf";
} else {
null = ["JigCheckpointE", 109, getpos damage_pos_logic] execVM "Scripts\j_server\Createcomposition.sqf";
};
sleep 2;

_Jig_Composition setvariable ["VehicleInit","_this SetVehicleVarName _VarName2;"];
processInitCommands;
sleep 1;

_pad = createVehicle ["HeliHEmpty", getMarkerPos "checkpointmkr", [], 0, "CAN_COLLIDE"];

waitUntil {alive (nearestObject [damage_pos_logic, "I44_Tank_G_StuH42_G_SS"])};
waitUntil {alive (nearestObject [damage_pos_logic, "I44_ACar_G_SdKfz234_2_WH"])};
sleep 0.5;

markersready = true;
publicVariable "markersready";
//hint "fueldepot markersready true";//debug
sleep 2;

timesup2 = 0;// dedicated taylored
"timesup2" addPublicVariableEventHandler {call compile format ["%1",_this select 1]};

"checkpointmkr" setMarkerType "DOT";
publicVariable "checkpointmkr";
sleep 5;	

while {(!isnull _pad)} do
{
private ["_vec1destroyed","_vec2destroyed"];	
{if (typeof _x == "pipebomb") then {deleteVehicle _x}} forEach (NearestObjects [damage_pos_logic, [], 40]);
sleep 1;
if (!alive (nearestObject [damage_pos_logic, "I44_Tank_G_StuH42_G_SS"])) then
{
	_vec1destroyed = true;
} else {
	_vec1destroyed = false;
};
sleep 2;
if (!alive (nearestObject [damage_pos_logic, "I44_ACar_G_SdKfz234_2_WH"])) then
{
	_vec2destroyed = true;
} else {
	_vec2destroyed = false;
};
if ((_vec1destroyed) && (_vec2destroyed)) then
{
	checkpointedead = 1;
	publicVariable "checkpointedead";
	damage_pos_logic setPos [13462.297,48.012741,13443.76];
	deleteMarker "checkpointmkr";
	deleteVehicle _pad;		
};	
sleep 3;
if (timesup2 == 1) exitWith {deleteVehicle _pad};
sleep 1;
};

Share this post


Link to post
Share on other sites

Do you have a link for your mission. I would like to check it out!

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
Sign in to follow this  

×