Jump to content
Sign in to follow this  
TheHutch

Using possession of assets as part of end conditions

Recommended Posts

I'm working on a mission in which Armenian backed forces try to seize supplies disabled Azerbaijani vehicles and bring them to hideouts after a half-finished ambush. I'm planning on assigning point values to various vehicles, supply crates, etc. and whoever gains "control" over the majority of the points from all the assets wins. In the case of Armenian forces, this would mean having brought the vehicles to a few pre-determined positions. For the Azeri forces, they would either bring assets back to their base or keep them in the area of the ambush while that area is under there control.  I admit this is quite complicated and I don't have much experience with such scripting, so if anyone has any suggestions or advice that would be greatly appreciated.

 

As a side note, if anyone knows of any off-the-beaten-path sources about squad structure, tactical doctrine, standard uniforms, etc. on the Azerbaijani Army or the Artsakh (Nagorno Karabakh) defense force, that would be super helpful too

Share this post


Link to post

well, top of my mind would be give these assets names and place a condition where they must be brought in a trigger area. 

Share this post


Link to post

so this is what I have so far:

_westCasualty = "Azerbaijan" call FNC_CasualtyPercentage; 
_eastCasualty = "Armenia" call FNC_CasualtyPercentage; 

_apc = ["namer1", "namer2", "namer3"];
_crate = ["crate1", "crate2", "crate3"];
_truck = ["ural1", "gaz1", "gaz2", "landrover"];
_reptruck = ["rep1", "rep2"];
_controlambush = ["WEST" == "ambush" call FNC_isCaptured];

_VPazeri = //ajerbaijan's victory points
		{alive _x} count [_apc inAreaArray azBase]*20 +\
		{alive _x} count [_crate inAreaArray azBase]*1 +\
		{alive _x} count [_truck inAreaArray azBase]*3 +\
		{alive _x} count [_reptruck inAreaArray azBase]*10 +\
		{alive _x} count [fueltruck inArea azBase]*10 +\
		{alive _x} count [tank inArea azBase]*15 +\
		{alive _x} count [BRDM inArea azBase]*8 +\

	while(_controlambush) do (
		{alive _x} count [_apc inAreaArray ambush]*20 +\
		{alive _x} count [_crate inAreaArray ambush]*1 +\
		{alive _x} count [_truck inAreaArray ambush]*3 +\
		{alive _x} count [_reptruck inAreaArray ambush]*10 +\
		{alive _x} count [fueltruck inArea ambush]*10 +\
		{alive _x} count [tank inArea ambush]*15 +\
		{alive _x} count [BRDM inArea ambush]*8
	);
;
	
_VParm = //armenia's victory points
		{alive _x} count [_apc inAreaArray hideout1]*20 +\
		{alive _x} count [_crate inAreaArray hideout1]*1 +\
		{alive _x} count [_truck inAreaArray hideout1]*3 +\
		{alive _x} count [_reptruck inAreaArray hideout1]*10 +\
		{alive _x} count [fueltruck inArea hideout1]*10 +\
		{alive _x} count [tank inArea hideout1]*15 +\
		{alive _x} count [BRDM inArea hideout1]*8 +\	
		
		{alive _x} count [_apc inAreaArray hideout2]*20 +\
		{alive _x} count [_crate inAreaArray hideout2]*1 +\
		{alive _x} count [_truck inAreaArray hideout2]*3 +\
		{alive _x} count [_reptruck inAreaArray hideout2]*10 +\
		{alive _x} count [fueltruck inArea hideout2]*10 +\
		{alive _x} count [tank inArea hideout2]*15 +\
		{alive _x} count [BRDM inArea hideout2]*8
;
	
_VPtot = //total victory points
		{alive _x} count [_apc, _crate, _truck, _reptruck, fueltruck, tank, BRDM];
		

if (_VParm/_VPtot >= 0.6) exitWith {
	
	"Decisive Armenian Victory<br />Materiel was successfully captured" call FNC_EndMission;
	
};
		
if (_westCasualty >= 80) exitWith {
	
	"Decisive Armenian Victory<br />Azerbaijani forces have retreated due to casualties." call FNC_EndMission;
	
};

if (_eastCasualty >= 80) exitWith {
	
	"Decisive Azerbaijani Victory<br />Armenian forces have retreated due to casualties." call FNC_EndMission;
	
};

if (_VPazeri/_VPtot >= 0.6 && _controlambush == false) exitWith {
	
	"Azerbaijani Victory<br />Materiel was successfully retrieved" call FNC_EndMission;
	
};

if (_VPazeri/_VPtot >= 0.6 && _controlambush == true) exitWith {
	
	"Decisive Azerbaijani Victory<br />Materiel was successfully retrieved and supply line secured" call FNC_EndMission;
	
};

sleep (60);

It doesn't work but it also doesn't throw any script errors. I am by no means a computer scientist so I'm sure this is horribly unoptimized

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...