Jump to content
Sign in to follow this  
Quagmire

[co-op-8]-Granma

Recommended Posts

This is my first mission. I'll just copy the description I used on armaholic.

DOWNLOAD LINK

This mission is loosely based on the Cuban revolution, more specifically the landing of the yacht "Granma" in south eastern Cuba and the consequent guerilla war. Roughly 2 - 3 hours playtime. Balanced emphasis on offensive and defensive. Future versions may include a currently work in progress m1 carbine addon and a smith and wesson handgun addon by Harry in the authentic version.

Two variants of the mission are included: the authentic version which uses the weapon addons by gms, and the lite version which doesn't.

Readme:

[co-op-8]-Granma mission for arma 2.

by Mazdak (enquiries: scoped_python357@hotmail.com or post on http://www.harrysite.net/forums/)

version 0.91

two variants are included in this package:

- the lite version ([co-op-8]-Granma-lite.Sara.pbo)

- and the "authentic" version ([co-op-8]-Granma-authentic.Sara.pbo)

future versions will hopefully use an m1 carbine addon and a smith and wesson handgun mod by Harry.

Requirements (lite version):

- ArmA 2 v.1.05 or higher.

- Community based addons build 51 or higher.

- caa1 project

- oac

Extra requirements for the "authentic version":

- "Mauser 98K" by gms

- "MP40" by gms

Version History:

0.9 - first release (22 / 1 / 2010)

0.91 - startup kits changed in authentic version so that only "authentic" weapons can be used.

- now uses Ultra Simple Patrol Script v1.0 by JW Custom, standard cyclic waypointed patrol paths removed.

- error referring to 1911 magazines no longer exists.

- the area around each village which must be clear of enemy for it to be considered liberated has been extended

- ambient animals module used

- medic modules used

Known issues:

- weapons chosen in the briefing in the authentic version will not correspond to the weapons which players will actually start with

- some strange behaviour in the movement of the respawn point and spontaneous repeatition of triggered text displays

Thanks to:

- toadlife and norrin for the "Universal Weapons Respawn Script"

- the OFPEC community for assising me in my endevour to learn to make missions.

- JW Custom for the Ultra Simple Patrol Script

So far, the known issues are an error at mission start up about 1911 magazines which seems to have no consequence, and the fact that by default players will have modern weapons equipped in the authentic version (but can manually choose appropriate weapons in the briefing).

If anyone knows how to modify player's starting kits in multiplayer, it would be helpful.

Red text = issue resolved

edit: updated to 0.91 (download link updated).

changes:

0.91 - startup kits changed in authentic version so that only "authentic" weapons can be used.

- now uses Ultra Simple Patrol Script v1.0 by JW Custom, standard cyclic waypointed patrol paths removed.

- error referring to 1911 magazines no longer exists.

- the area around each village which must be clear of enemy for it to be considered liberated has been extended

- ambient animals module used

- medic modules used

Known issues:

- weapons chosen in the briefing in the authentic version will not correspond to the weapons which players will actually start with

- some strange behaviour in the movement of the respawn point and spontaneous repetition of triggered text displays

Edited by Quagmire

Share this post


Link to post
Share on other sites

In init.sqf:

if (isServer) then
{
isJIP=false;
publicVariable "isJIP";
[] spawn
{
	sleep 1;
	isJIP=true;
};
};
onPlayerConnected "
publicVariable 'isJIP';
";

In assigngear.sqf (adjust/add/remove loadouts as you see fit):

private ["_unit", "_strLoadout"];
waitUntil {!isNil "isJIP"};
if (!isServer && isJIP) exitWith {};
if (!isServer) then
{
waitUntil {!isNull player};
};
waitUntil {!isNil "ace_sys_ruck"};
waitUntil {ace_sys_ruck};
sleep .1;
_unit = _this select 0;
_strLoadout = _this select 1;

if (!isNull player) then
{
if ((!isPlayer _unit) && (player == leader group _unit)) then
{
	waitUntil {local _unit};
};

if (_unit==player) then
{
	waitUntil {local _unit};
};
};

if (local _unit) then
{
removeAllWeapons _unit;
};

switch (_strLoadout) do
{   
case "cmd_US":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		{_unit addMagazine "1Rnd_HE_M203"} forEach [1,2,3,4,5];
		_unit addMagazine "1Rnd_Smoke_M203";
		_unit addMagazine "1Rnd_SmokeRed_M203";
		_unit addMagazine "1Rnd_SmokeGreen_M203";
		_unit addWeapon "M4A1_RCO_GL";
		{_unit addMagazine "HandGrenade_West";} forEach [1,2];
		_unit addMagazine "SmokeShell";
		_unit addMagazine "SmokeShellGreen";
		_unit addMagazine "PipeBomb";
		_unit addWeapon "ACE_Rucksack_MOLLE_ACU";
	};
	[_unit, "1Rnd_HE_M203", 10] call ACE_Sys_Ruck_fnc_AddMagToRuck;
	[_unit, "1Rnd_SmokeRed_M203", 1] call ACE_Sys_Ruck_fnc_AddMagToRuck;
	[_unit, "1Rnd_SmokeGreen_M203", 1] call ACE_Sys_Ruck_fnc_AddMagToRuck;
};

case "M4A1":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		_unit addWeapon "ACE_M4A1_Eotech";
		{_unit addMagazine "HandGrenade_West";} forEach [1,2,3];
		{_unit addMagazine "SmokeShell";} forEach [1,2];
	};
};

case "crew":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6];
		_unit addWeapon "M4A1";
		{_unit addMagazine "SmokeShell";} forEach [1,2];
	};
};

case "M4A1M136":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		_unit addWeapon "ACE_M4A1_Eotech";
		{_unit addMagazine "HandGrenade_West";} forEach [1,2,3];
		_unit addMagazine "SmokeShell";
		_unit addMagazine "PipeBomb";
		_unit addWeapon "M136";
	};	
};

case "M4A1HEDPammo":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		_unit addWeapon "ACE_M4A1_Eotech";
		_unit addMagazine "HandGrenade_West";
		_unit addMagazine "SmokeShell";
		_unit addMagazine "SMAW_HEDP";
		_unit addMagazine "SMAW_HEDP";
	};
};

case "M4A1HEDP":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		_unit addWeapon "ACE_M4A1_Eotech";
		{_unit addMagazine "SMAW_HEDP";} forEach [1,2];
		{_unit addMagazine "ACE_SMAW_Spotting";} forEach [1,2,3];
		_unit addWeapon "SMAW";
	};
};

case "M4A1762":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		_unit addWeapon "ACE_M4A1_Eotech";
		_unit addMagazine "HandGrenade_West";
		{_unit addMagazine "100Rnd_762x51_M240";} forEach [1,2];
	};
};

case "M4A1M203":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		{_unit addMagazine "1Rnd_HE_M203"} forEach [1,2,3,4,5,6,7,8];
		_unit addWeapon "M4A1_RCO_GL";
		_unit addMagazine "HandGrenade_West";
		_unit addMagazine "SmokeShell";
		_unit addMagazine "PipeBomb";
		_unit addWeapon "ACE_Rucksack_MOLLE_ACU";
	};
	[_unit, "1Rnd_HE_M203", 12] call ACE_Sys_Ruck_fnc_AddMagToRuck;
};

case "MMG":
{
	if (local _unit) then
	{
		{_unit addMagazine "100Rnd_762x51_M240";} forEach [1,2,3,4,5,6];
		_unit addWeapon "MK_48";
		{_unit addMagazine "HandGrenade_West";} forEach [1,2];
	}
};

case "LMG":
{
	if (local _unit) then
	{
		{_unit addMagazine "200Rnd_556x45_M249";} forEach [1,2,3,4,5];
		_unit addWeapon "ACE_M249Para";
		{_unit addMagazine "HandGrenade_West";} forEach [1,2];
	};
};

case "medic_US":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
		_unit addWeapon "ACE_M4A1_Eotech";
		{_unit addMagazine "HandGrenade_West";} forEach [1,2];
		{_unit addMagazine "SmokeShell";} forEach [1,2];
		_unit addMagazine "SmokeShellGreen";
	};
};

  	case "SPRSD":
  	{
  		if (local _unit) then
  		{
  			{_unit addMagazine "30Rnd_556x45_Stanag";} forEach [1,2,3,4,5,6,7];
  			_unit addWeapon "ACE_M4A1_Eotech";
  			_unit addMagazine "SmokeShell";
  			_unit addMagazine "PipeBomb";
  			if (!isNull player) then
  			{
  				if (_unit == player) then {hint "SPR SD on your back";};
  			};
  		};
  		_unit setVariable ["ACE_WeaponOnBack", "ACE_M4SPR_SD"];
};

case "AK47":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_762x39_AK47";} forEach [1,2,3,4,5,6];
		_unit addWeapon "AK_47_M";
		{_unit addMagazine "HandGrenade_East";} forEach [1,2];
	};
};

case "RPG7":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_762x39_AK47";} forEach [1,2,3,4,5,6];
		_unit addWeapon "AK_47_S";
		{_unit addMagazine "PG7V";} forEach [1,2];
		_unit addWeapon "RPG7V";
	};
};

case "strela":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_762x39_AK47";} forEach [1,2,3,4,5,6];
  	   		_unit addWeapon "AK_47_S";
  	   		_unit addMagazine "strela";
   	  		_unit addWeapon "strela";
	};
};

case "AK74PSO":
{
	if (local _unit) then
	{
		{_unit addMagazine "30Rnd_545x39_AK";} forEach [1,2,3,4,5,6];
		_unit addWeapon "AKS_74_pso";
		_unit addMagazine "HandGrenade_East";
		_unit addMagazine "SmokeShell";
	};
};

case "SVD":
{
	if (local _unit) then
	{
		{_unit addMagazine "10Rnd_762x54_SVD";} forEach [1,2,3,4,5,6,7,8];
		{_unit addMagazine "SmokeShell"} forEach [1,2,3];
		_unit addWeapon "SVD";
		{_unit addMagazine "8Rnd_9x18_Makarov";} forEach [1,2];
		_unit addWeapon "Makarov";
	};
};

case "RPK":
{
	if (local _unit) then
	{
		{_unit addMagazine "75Rnd_545x39_RPK";} forEach [1,2,3,4,5];
		_unit addMagazine "HandGrenade_East";
		_unit addWeapon "RPK_74";
	};
};
};

if (local _unit) then
{
_unit addWeapon "itemGPS";
_unit addWeapon "binocular";
_primaryWeapon = primaryWeapon _unit;
_unit selectweapon _primaryWeapon;
// Fix for weapons with grenade launcher
_muzzles = getArray(configFile>>"cfgWeapons" >> _primaryWeapon >> "muzzles");
_unit selectWeapon (_muzzles select 0);
};

Use example:

Place the following in a unit's init line:

hNil = [this, "M4A1M203"] execVM "assigngear.sqf";

And the unit will be equipped with the loadout matching "M4A1M203".

This is meant to work properly and work around all JIP and locality issues, and is deisgned to work both in SP, hosted and dedicated server.

This is only meant to give units gear at mission start - you cannot use this script (in its current form) to gear units during the mission, as a part of it is actually meant to prevent giving JIP players gear. Of course you can easily modify it to give players their gear at any time by removing the JIP check, but usually what you need is assigning gear at mission start and mission start only.

Share this post


Link to post
Share on other sites

thanks for the help, but does that mean that any players joining in progress will just have the default kit for their unit type? Also, is there a way to disable kit selection in the briefing, so players don't get the false impression that which ever weapons they choose actually matters? In my mission in particular, players might be confused seeing themselves equipped with ak74GLs in the briefing, but then starting the mission with 98ks.

None the less, the starting kit issue is resolved, thanks.

Share this post


Link to post
Share on other sites

i find that using this script, units revert to their actual kit (as defined in the briefing) after dying and respawning. Is there a way to force units to respawn with the kit defined in assigngear.sqf after every respawn?

---------- Post added at 04:43 PM ---------- Previous post was at 04:26 PM ----------

never mind, problem solved by using the Universal Weapons Respawn Script.

Share this post


Link to post
Share on other sites

Yeah, to save the loadout for respawns you will have to use some kind of a save loadout / load loadout script that will "save" the gear right after the assigngear.sqf script assigns it and "loads" it on every respawn.

There is currently no way to make the weapons show in the briefing in a reliable fashion. The only way to make the weapons show in the briefing is to directly add the weapons in the unit's init line (or exec a script that does just that rather than execVM) but then all the things that make it work reliably for both players and AI while not giving weapons to JIP players cannot work as they require being in their own "thread".

Anyway, this script is designed for no-respawn missions with AI enabled - as you can see it will not run for JIP players. In a respawn mission with no AI you need to remove the JIP check so that it will run for JIP players as well, but then if they're commanding any AI that are present when they join you will have problems.

Share this post


Link to post
Share on other sites

sorry, which exact part of the script do I need to delete in order to "remove the JIP check"? Is it just

waitUntil {!isNil "isJIP"};

if (!isServer && isJIP) exitWith {};

?

Sorry, my scripting knowledge is limited.

btw, I've made enough changes that I think a patch is justified. I'll update the original post.

Share this post


Link to post
Share on other sites

Yes, that is the JIP check that is meant so that you don't get new weapons when you JIP into an already existing AI unit or into a leader of an already existing AI unit.

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  

×