Forum Jump :

Author Message


Posts: 25
Rank:


Level: Member

Country: us
Location: In the dungeon to hell!
Occupation:
Age: 32
In-game name:

 
#1 Posted at 2015-12-30 10:59        
     
I cannot find a dynamic mission tutorial to save my life, could someone help find (me/others) a tutorial on how to create dynamic missions. Thanks in advance to any who reply.

P.S.: Sorry if this is a double post. I did run a search and came up with quite a few pages on dynamic missions, but
to no avail. In other words, I didn't find anything about what I'm asking.

EDIT: A dynamic mission is like, http://www.armaholic.com/page.php?id=9581&highlight=FLASHPOINT

This post was edited by theplague1988 (2015-12-30 20:18, ago)

Philip "5n4k3" Simonson

Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 23
In-game name: Wak

 
#2 Posted at 2015-12-30 12:30        
     
Can you explain what a Dynamic mission is? Maybe using a tool like MCC or Zeus?

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 2872
Rank:


Level: Member

Country: cn
Location: PRC
Occupation:
Age: 39
In-game name: DarkXess

 
#3 Posted at 2015-12-30 14:43        
     
# 654wak654 : Can you explain what a Dynamic mission is? Maybe using a tool like MCC or Zeus?

It can't be Zeus or MCC as they wasnt made for ArmA 2 in which this has been posted. If this is in the correct section and it is indeed ArmA 2 then the only dynamic mission making I can suggest is DAC. Not a guide much but impliment it in your missions and your good to go :-)

1st - Check The Rules! 2nd - Use The Search!

Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 23
In-game name: Wak

 
#4 Posted at 2015-12-30 20:15        
     
# DarkXess : It can't be Zeus or MCC as they wasnt made for ArmA 2 in which this has been posted. If this is in the correct section and it is indeed ArmA 2 then the only dynamic mission making I can suggest is DAC. Not a guide much but impliment it in your missions and your good to go :-)

At least there is an MCC for arma 2 too:
http://www.armaholic.com/page.php?id=15546

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 2872
Rank:


Level: Member

Country: cn
Location: PRC
Occupation:
Age: 39
In-game name: DarkXess

 
#5 Posted at 2015-12-31 01:45        
     
# 654wak654 : At least there is an MCC for arma 2 too:
http://www.armaholic.com/page.php?id=15546

:-[ hehe forgot that one....

1st - Check The Rules! 2nd - Use The Search!

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 60
In-game name: Kobayashi Maru

 
#6 Posted at 2015-12-31 08:38        
     
Or... if you don't want to depend on addons but script yourself, you should learn how to spawn groups.
You can imagine how to randomize your groups, their skills, their numbers, something like:
_my_prefered_units = [all class units you want here but belonging to your configfile/cfgVehicles (depending on your addons) "B_Soldier_AT","B_Medic_F"...]; I don't know the classes of Arma2 but that's the principle.
Randomize a position also, depending on triggers, markers, or locations. The easiest way is to place triggers or markers on map editor, name them, make a list (array) and randomize as well (of course you can have different lists for different sides).

Randomization:
- With an array, say of n elements (0 to n-1), the best way to pick one at random:
_my_randomized_element = _my_array select floor random n;
NB: At this time selectRandom is in dev branch.
- for a value from 0 to 1 with lower & upper limits (0.1 to 0.5 here) : {_x setskill ((floor random 6)/10) max 0.1} forEach units _first_group;

For example:
_my_prefered_units = [n classes of units like "rhsusf_usmc_marpat_d_rifleman" (RHS addon)];
_my_positions = [N positions of markers on your map like "marker1"...];

Say you want a group of 4 to 10 units:
_first_group = [];
For "_i" from 4 to (4 + floor random 7) do {
_first_group pushback _my_prefered_units select _i;
};
_the_group_position = _my_positions select floor random N;
NB: If your want a mandatory officer or else: initialize the variable as: _first_group = ["B_officer_F"]; then dim down the randomization (for "_i" from 3 to (3 + floor random 7)...

then your spawning group should look like:
[_the_group_position, east (or other sides), _first_group, [], [], [], [], [], 0] call BIS_fnc_spawnGroup ;
NB: side is important and overwhelm the type of unit (you can have a red group with blufor or resistance units!)

So, as you can see, this is a first step for custom randomized mission.
Next step is to place tasks, like in this example:
_tsk1 = ["task1", [west,resistance], ["You must clear this area first","Establish your FOB",""],_the_group_position, "ASSIGNED", 1, true, true,"",true] call BIS_fnc_setTask;
waitUntil {sleep 0.5; ([_tsk1] call BIS_fnc_taskState) == "Succeeded"};
// your code here!

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 25
Rank:


Level: Member

Country: us
Location: In the dungeon to hell!
Occupation:
Age: 32
In-game name:

 
#7 Posted at 2015-12-31 23:48        
     
@Pierre MGI,

Thank you for a point in the right direction, you know exactly what I'm looking for. A custom
dynamic mission, without the use of special addons like DAC and MCC.

Philip "5n4k3" Simonson

Author Message


Posts: 2872
Rank:


Level: Member

Country: cn
Location: PRC
Occupation:
Age: 39
In-game name: DarkXess

 
#8 Posted at 2016-01-01 00:44        
     
# theplague1988 : Thank you for a point in the right direction, you know exactly what I'm looking for. A custom
dynamic mission, without the use of special addons like DAC and MCC.

DAC is basically what its all about anyway, your going to need to script the mission and or units to do something dynamic, hence DAC which has it all ready for you to just plug and play.

1st - Check The Rules! 2nd - Use The Search!

Author Message


Posts: 25
Rank:


Level: Member

Country: us
Location: In the dungeon to hell!
Occupation:
Age: 32
In-game name:

 
#9 Posted at 2016-01-04 22:54        
     
I've been trying to create units in a for loop... please help. I cannot figure out what is wrong.
It says something about, created scalar unit. in my simple debug hint.

private ["_group","_side","_cnt","_min_range","_max_range","_positions","_westUnits","_eastUnits","_cntPos","_center","_i","_unit"];
_side = _this select 0;
_cnt = _this select 1;
_min_range = _this select 2;
_max_range = _this select 3;
_positions = _this select 4;

_westUnits = ["USMC_Soldier","USMC_Soldier2","USMC_SoldierM_Marksman","USMC_SoldierS","USMC_SoldierS_Engineer","USMC_SoldierS_Sniper","USMC_SoldierS_SniperH","USMC_SoldierS_Spotter","USMC_Soldier_AA","USMC_Soldier_AR","USMC_Soldier_AT","USMC_Soldier_Crew"];
_eastUnits = ["RU_Soldier","RU_Soldier2","RU_Soldier_Crew","RU_Soldier_GL","RU_Soldier_AR","RU_Soldier_HAT","RU_Soldier_LAT","RU_Soldier_MG","RU_Soldier_Marksmen"];

_cntPos = count _positions;
_center = _positions select floor(random(_cntPos));

switch (_side) do
{
	case EAST:
	{
		if ({side _x == EAST} count allUnits == 0) then
		{
			_eastHQ = createCenter EAST;
		};
	};
	case WEST:
	{
		if ({side _x == WEST} count allUnits == 0) then
		{
			_westHQ = createGroup WEST;
		};
	};
};

hint format ["Created Center: %1",_side];
sleep 1;

_group = createGroup _side;

for [{_i=0}, {_i<_cnt}, {_i=_i+1}] do
{
	if (_side == WEST) then
	{
		_unit = _westUnits select floor(random(count _westUnits)) createUnit [[(_center select 0+_min_range+_max_range),(_center select 1+_min_range+_max_range)], _group, "", random(6)/10, "corporal"];
		[_unit] join _group;
	};
	if (_side == EAST) then
	{
		_unit = _eastUnits select floor(random(count _eastUnits)) createUnit [[(_center select 0+_min_range+_max_range),(_center select 1+_min_range+_max_range)], _group, "", random(6)/10, "corporal"];
		[_unit] join _group;
	};
	hintSilent format ["Created %1 unit", {alive _x} count _unit];
	sleep 1;
	hint "";
};

_group;

Nevermind I figured out what the problem was it was, something
to do with the min range and max range... the code below works fine
but without min and max ranges.

private ["_group","_side","_cnt","_radius","_min_range","_max_range","_positions","_westUnits","_eastUnits","_cntPos","_center","_i","_unit"];
_side = _this select 0;
_cnt = _this select 1;
_min_range = _this select 2;
_max_range = _this select 3;
_positions = _this select 4;

_radius = 360;
_westUnits = ["USMC_Soldier","USMC_Soldier2","USMC_SoldierM_Marksman","USMC_SoldierS","USMC_SoldierS_Engineer","USMC_SoldierS_Sniper","USMC_SoldierS_SniperH","USMC_SoldierS_Spotter","USMC_Soldier_AA","USMC_Soldier_AR","USMC_Soldier_AT","USMC_Soldier_Crew"];
_eastUnits = ["RU_Soldier","RU_Soldier2","RU_Soldier_Crew","RU_Soldier_GL","RU_Soldier_AR","RU_Soldier_HAT","RU_Soldier_LAT","RU_Soldier_MG","RU_Soldier_Marksman"];

_cntPos = count _positions;
_center = _positions select floor(random(_cntPos));

switch (_side) do
{
	case EAST:
	{
		if ({side _x == EAST} count allUnits == 0) then
		{
			_eastHQ = createCenter EAST;
		};
	};
	case WEST:
	{
		if ({side _x == WEST} count allUnits == 0) then
		{
			_westHQ = createCenter WEST;
		};
	};
};

_group = createGroup _side;

for [{_i=0}, {_i<_cnt}, {_i=_i+1}] do
{
	if (_side == WEST) then
	{
		_unit = _westUnits select floor(random count _westUnits) createUnit [[(_center select 0)+sin(random(_radius))*(_min_range+_max_range-_min_range+1),(_center select 1)+cos(random(_radius))*(_min_range+_max_range-_min_range+1)], _group, "", random 6/10, "corporal"];
	};
	if (_side == EAST) then
	{
		_unit = _eastUnits select floor(random count _eastUnits) createUnit [[(_center select 0)+sin(random(_radius))*(_min_range+_max_range-_min_range+1),(_center select 1)+cos(random(_radius))*(_min_range+_max_range-_min_range+1)], _group, "", random 6/10, "corporal"];
	};
	[_unit] join _group;
	sleep 0.3;
};

_group;

Just in case someone else wants a custom random unit spawning script.
That doesn't use BIS_fnc_spawnGroup. Because if you script for ArmA 1 that don't have
BIS functions. But this has only units for ARMA 2 in it right now. So you'd have
to change the units for other ARMA versions.

_westUnits and _eastUnits variables..

This post was edited by theplague1988 (2016-01-05 21:46, ago)

Philip "5n4k3" Simonson