Jump to content
Sign in to follow this  
Sc0rc3d

Random Mission (which not been completed)

Recommended Posts

Hi Guys,

i try to make a Multiplayer Gamemode like Insurgency. My Problem is i wannt a "clear" Map and to Actiavate a Random Mission

like: free the person or Kill All Enemys at Town xyz or Crash the Party etc. But i wannt that the Player can choose what he wannt.

So i place a sign with a jpeg on it with "choose your Mission Type". I add some Actions like this:

ID_1 = mission_sign addAction ["Random Mission (1-6 Player)", "mission1.sqf"];  
ID_2 = mission_sign addAction ["Random Mission (6-x Player)", "mission2.sqf"]; 
ID_3 = mission_sign addAction ["SmalSideMission", "mission3.sqf"]; 

Unfortunately, I know from this point further not really. How can make the Random Missions and how to ensure that a

completed mission is repeated again. Pardon my newbie questions but I've built so far in the direction of anything yet. :)

greetings

Sc0rc3d

Share this post


Link to post
Share on other sites

I'm sorry if I come up rough here, I'm not trying to be an ass, really. But coding for multiplayer is not an easy task at all, and creating a complex gamemode even less.

I'd suggest you start slowly with some easy tasks, and then when you start to feel proficient with MP scripting you could dive into such a project.

Anyway, I kinda mis the point here: What is it you're trying to do exactly? Or more precisely what it is that you need help with?

Share this post


Link to post
Share on other sites

Here's an example of random missions. Might use that as a start?

As BlackMamb said though, the creation of a "game mode" with random spawning, cleaning up and respawning missions is not at all a "newbie" question. :)

Share this post


Link to post
Share on other sites

Thanks kylania for your great Example. My "Gamemode" is just a small thing for the guys at my "Clan". At the moment i got 15 smal Missions like "Clear the City from Enemys" or

"Defend the embassy" or "Support our Troops at Location xyz on the Battlefield" etc. And one Big Mission the Island at the north-West i make as Restricted Area with BTK's Gasmask Script. Inside that area i am not sure what i will do i waiting for good ideas at my Clan. My Problem are the 15 smal Missions. I think they work how they should but

not always.

arma2oa2012110808251574.th.jpg

I am finished about 70% but i got a few problems and need some help. I Think i do too much with the Triggers. Here is an example of one "Sub"Mission:

arma2oa2012110808254482.th.jpgarma2oa2012110808254859.th.jpgarma2oa2012110808255187.th.jpgarma2oa2012110808255492.th.jpg

I Start the Mission on a Message Board with that Code in the init: sign = sign1 addAction [ ("<t color=""#D7DF01"">" + ("Zufalls Mission2") + "</t>"), "missionfinder.sqf" ];

missionfinder.sqf

sign1 removeAction sign;
waituntil {!isnil "bis_fnc_init"};

_missions = ["town1","Canto","Nubak","Fly1","town5","Waffendeal","Ubuntu","town2","Maluri","Zeelor","town3","Numbo","Simbala","town4","Fly2"];
_choose = _missions call BIS_fnc_selectRandom;

[_choose] execVM "makemission.sqf";

makemission.sqf


_missionType = _this select 0;
sleep random 5;

fn_spawntown1Mission = {
hintC "Bekaempfen sie alle Feinde in Cainna Wind und Sichern sie die Stadt!";
_marker = createMarker ["Sichern sie die Stadt!",[2612.26,1845.69,0]];
_marker setMarkerType "mil_destroy";
_marker setMarkerColor "ColorRed";
_marker setMarkerText "Sichern sie die Stadt!";
_marker setMarkerSize [1,1];

       Cainna_Wind = true; publicVariable "Cainna_Wind";
       Cainna_done = false;

waitUntil { Cainna_done };

deleteMarker _marker;

[player,nil,rSIDECHAT,"Gut gemacht, die Stadt Cainna Wind ist nun Sicher!"] call RE;
sleep 3;
hint "";
       sign = sign1 addAction [  ("<t color=""#D7DF01"">" + ("Zufalls Mission2") + "</t>"),  "missionfinder.sqf"  ];
};

// Here are the other 14 Missions in the same way like this example

// MAIN LOGIC

_missionDetails = switch (_missionType) do {
case "town1": {call fn_spawntown1Mission;};
case "town2": {call fn_spawntown2Mission;};
       case "town3": {call fn_spawntown3Mission;};
case "town4": {call fn_spawntown4Mission;};
case "town5": {call fn_spawntown5Mission;};
       case "Waffendeal": {call fn_spawnWaffendealMission;};
       case "Ubuntu": {call fn_spawnUbuntuMission;};
       case "Canto": {call fn_spawnCantoMission;};
       case "Maluri": {call fn_spawnMaluriMission;};
       case "Zeelor": {call fn_spawnZeelorMission;};
       case "Nubak": {call fn_spawnNubakMission;};
       case "Numbo": {call fn_spawnNumboMission;};
       case "Simbala": {call fn_spawnSimbalaMission;};
       case "Fly1": {call fn_spawnFly1Mission;};
       case "Fly2": {call fn_spawnFly2Mission;};

};

So sometimes it works, sometimes it dont works. And a big Problem is that only the Guy how starts the Mission will see the hintC. All players can see the Markers but the "what should i do?" from the HintC not. Then i am not sure but i think its a creapy way to check is mission is done so how i did it. Maybee there is a better way?

I know i am a Noob but i am still inquisitive and dedicated to learn. :(

EDIT: @kylania - And here's a little video I could do thanks to your help!

greetings

Sc0rc3d

Share this post


Link to post
Share on other sites

Sound good and thanks a lot. Here it is 9am.. the Day beginns. :P

Share this post


Link to post
Share on other sites

ok im no expert but have been learning alot about random missions and mp missions,

so here are a few pointers,

1) the task markers.

players who start the game at the beginning will see all these markers BUT

Players who join later (JIP) will not so to work around that you make a marker array and update them on player connect

i.e

in your main init have

markerArray = ["mkr","mkr","mkr","mkr"]; // replace the mkr for your marker names.
onPlayerConnected "{_x setMarkerPos (getMarkerPos _x)} forEach markerArray";

2) Updating tasks and task stat to JIP players

Arma will not update all this by itself so you need some code to update the task state.

easist way to do this is use shk_taskmaster chat more about this next.

3) dynamic tasks,

this is how i would do the tasks like you want them.

you will need to download taskmaster.

below i have a demo of a defend task called from a init line on a sign,

in your init have


call compile preprocessfile "shk_taskmaster.sqf";

then a sign on the map like you want

in the init of the sign have

this addAction ["Defend mission", "defend_init.sqf"];

defend_init.sqf

nul = [] execVM "defend_start.sqf"; // start the defend task code
sleep 10; // some time for it to all spawn
["yourtaskname","yourtaskname","yourtask details",true,[]] call SHK_Taskmaster_add; // add the task to players task list this updates for JIP players aswell using taskmaster
player sideChat "New Mission Updated.";//hint to all players to let them know task is ready


now defend_start.sqf

you will place your tasks script in here and use it to spawn all enemy and targets and clean up the task and end the task.


all the stuff goes in here


now to end the task you do something like this

[sgt,nil,rgroupChat,"Task compleated well done!"] call RE; // change sgt to the name of your teamleader		   
deleteMarker "yourmarker";
deleteMarker "yourmarker";
deleteMarker "yourmarker";
["yourtaskname","compleate"] call SHK_Taskmaster_upd;

i hope this helps and is not to much dribble pretty late here and im half asleep ;)

GOOD LUCK

Share this post


Link to post
Share on other sites

Hi and thanks for a kick in the right direction hog.

But it still not will work fine on multiplayer. Taskmaster2 looks good and works in the Editor pretty well.

And the Missions start with a nice hint in the middle:

arma2oa2012111209515090.th.jpg

arma2oa2012111210155570g.th.jpg

But on my Server just the rSIDECHAT is vissible no visible task at all. And for Jip there is no Markers. :/

arma2oa2012111210132636.th.jpg

arma2oa2012111210135343.th.jpg

I Change the code of my makemission.sqf to:


_missionType = _this select 0;
sleep random 5;

fn_spawntown1Mission = {

_marker = createMarker ["Sichern sie die Stadt!",[2612.26,1845.69,0]];
_marker setMarkerType "mil_destroy";
_marker setMarkerColor "ColorRed";
_marker setMarkerText "Sichern sie die Stadt!";
_marker setMarkerSize [1,1];

       ["Cainna_Wind","Sichern sie die Stadt Cainna Wind!","Sichern sie die Stadt",true,[]] call SHK_Taskmaster_add;
       player sideChat "Neue Mission: Sichern sie die Stadt Cainna Wind.";

       Cainna_Wind = true; publicVariable "Cainna_Wind";
       Cainna_done = false;

waitUntil { Cainna_done };

deleteMarker _marker;

[player,nil,rSIDECHAT,"Gut gemacht, die Stadt Cainna Wind ist nun Sicher!"] call RE;
//      ["Cainna_Wind","succeeded"] call SHK_Taskmaster_upd;
       ["Cainna_Wind","succeeded"] call SHK_Taskmaster_isCompleted;   	
       sleep 3;
hint "";
       sign = sign1 addAction [  ("<t color=""#D7DF01"">" + ("Zufalls Mission") + "</t>"),  "missionfinder.sqf"  ];
};

_missionDetails = switch (_missionType) do {
case "town1": {call fn_spawntown1Mission;};

};	

And in my Init:

////////////////////////////////////////////////////////////////////////////////////
call compile preprocessfile "shk_taskmaster.sqf";

markerArray = ["_marker"];
onPlayerConnected "{_x setMarkerPos (getMarkerPos _x)} forEach markerArray";
////////////////////////////////////////////////////////////////////////////////////

And one more Question if i may for the "Mission complete Check". I create a Opfor Unit Name him: "Cainna_guy" and

let him Guard a smal Area in a Trigger Range.

The Trigger:

Acctivision: Opfor (300x300)

Once - Not Present

Type: Switch

Con: this AND !alive Cainna_guy;

OnAct: hint "All Save at Cainna Wind"; Cainna_done = true; publicVariable "Cainna_done";

Is there a smarter way?

I hope you have a few more ideas for me. Thanks a lot for any Help. ;)

Greetings

Sc0rc3d

Share this post


Link to post
Share on other sites
I'll take a look at this tomorrow, it's 3am.. again. :(

Lightweight. :)

Share this post


Link to post
Share on other sites

ok so from what i can see you are not calling the fn_spawntown1Mission. ill take a closer look today for you and post it up here

---------- Post added at 08:41 ---------- Previous post was at 08:21 ----------

forget my last lol i diddnt see at the bottom you do call it ;)

as for the no markers and what not you need to let taskmaster create the marker for all players to see so

replace


["Cainna_Wind","Sichern sie die Stadt Cainna Wind!","Sichern sie die Stadt",true,[]] call SHK_Taskmaster_add;

for


["Cainna_Wind","Sichern sie die Stadt Cainna Wind!","Sichern sie die Stadt",true,["taskarea",getmarkerpos "Sichern sie die Stadt!","flag","ColorRed"]] call SHK_Taskmaster_add;

ill explain

this line here you create the marker for the task area

_marker = createMarker ["Sichern sie die Stadt!",[2612.26,1845.69,0]];

in singleplayer this works fine but on a dedi this marker is only created on the machine running the code as it is not local

so in your case the createMarker works fine to create a place holder then you need to create a local marker for all players to see so you will use

Taskmaster to do this for you with ease.

For future ref

createMarker = creates a marker on the machine running the code only visible to said machine

createMarkerLocal = creates the marker on all machines / all players.

as far as ending the task when the east unit is dead this is another way

dont worry bout your public varables in this case i cant see you need them

but you did do it abit wrong from what i know any way should look like this


//top of script
if (isnil "Cainna_done") then {Cainna_done = 0;};
camp_active = 1; publicvariable "camp_active";

//then you code 

//and then tied into something youd use this
Cainna_done = 0; publicvariable "Cainna_done";

i.e

_HQbunker addeventhandler ["killed", { Cainna = 0; publicvariable "Cainna_done";[sgt,nil,rgroupChat,"Enemy camp has been destroyed"] call RE;}];

//then your waituntill 

waitUntil {FOB_Secure == 1};

any way this works


_missionType = _this select 0;
sleep random 5;

fn_spawntown1Mission = {

_marker = createMarker ["Sichern sie die Stadt!",[2612.26,1845.69,0]];
_marker setMarkerType "mil_destroy";
_marker setMarkerColor "ColorRed";
_marker setMarkerText "Sichern sie die Stadt!";
_marker setMarkerSize [1,1];

       ["Cainna_Wind","Sichern sie die Stadt Cainna Wind!","Sichern sie die Stadt",true,["taskarea",getmarkerpos "Sichern sie die Stadt!","flag","ColorRed"]] call SHK_Taskmaster_add;
       player sideChat "Neue Mission: Sichern sie die Stadt Cainna Wind.";

waitUntil{!alive Cainna_guy };

deleteMarker _marker;

[player,nil,rSIDECHAT,"Gut gemacht, die Stadt Cainna Wind ist nun Sicher!"] call RE;
//      ["Cainna_Wind","succeeded"] call SHK_Taskmaster_upd;
       ["Cainna_Wind","succeeded"] call SHK_Taskmaster_isCompleted;   	
       sleep 3;
hint "";
       sign = sign1 addAction [  ("<t color=""#D7DF01"">" + ("Zufalls Mission") + "</t>"),  "missionfinder.sqf"  ];
};

_missionDetails = switch (_missionType) do {
case "town1": {call fn_spawntown1Mission;};

};


Share this post


Link to post
Share on other sites

Thanks hogmason for your answer.

But your last Code "any way this works" works only on the Editor (and local hostet Server) but not on the Dedicated Server. It (taskmaster i think) don't creates the "flag" Marker just my _marker. And there is no Task like my picture above. So same stand like before. And what does the "true" in the SHK_Taskmaster_add; line? :(

The "waitUntil{!alive Cainna_guy };" is not so nice because there are some more Enemy units then the Cainna_guy (spawned by script). He is just a 'place holder' that the trigger will not be activated. But i fix that now i create the 'Enemy Dead' Trigger in a script so thats not more the problem. The only Problem is the Tasks. :(

Maybee the Problem is that i got no "beginning tasks" in the init/Briefing i think i need to add the "radnom" tasks this way:

["Cainna_Wind","Sichern sie die Stadt Cainna Wind!","Sichern sie die Stadt",_marker] call SHK_Taskmaster_add;

And i think i need to preplace the markers in the editor the taskmaster will alpha them and shown up if needed i will try this. What do you think?

But thanks for all so far!

greetings

Sc0rc3d

EDIT: i make a quick demo on utes.

Edited by Sc0rc3d

Share this post


Link to post
Share on other sites

I do not want to be ungrateful, thanks a lot for that but what you Uploaded is a complete different System is use. And i think this Demo Mission i saw a few days before for the SHK Taskmaster. This demo is 100% different code that i use. but thanks at all i take a look at it.

Edited by Sc0rc3d

Share this post


Link to post
Share on other sites

So Problem Fixed with my Code and a bit of "hogmasons Demo". I have one more Problem with a random Partol Helicopter maybee some smart guy can help me out. :D

spawn_Heli.sqf Call it: ["Helispawn","spawn_Heli",4] execVM "spawn_Heli.sqf";


waituntil {!isnil "bis_fnc_init"};

hint "Spawn Random Helicopter after 60 Seconds!";
sleep 60;

private ["_enemyArmPool","_ArmNumberSpawn","_ArmType","_spawnedArmUnit","_patrolmark","_spawnmark","_ArmUnit","_b","_armored"];

_patrolmark = _this select 0;
_spawnmark = _this select 1;
_armored = _this select 2;

_b = 0;

while {_b != _armored} do {

_enemyArmPool = ["ACE_Ka50","Mi17_TK_EP1","Mi17_rockets_RU","Mi24_D_TK_EP1"] call BIS_fnc_selectRandom;
_spawnedArmUnit = [getMarkerPos _spawnmark, 180, _enemyArmPool, EAST] call bis_fnc_spawnvehicle;
_ArmUnit = _spawnedArmUnit select 0;
_ArmUnit setPosATL [getPosATL _ArmUnit select 0, getPosATL _ArmUnit select 1, 300];
{_x setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';";} forEach units _ArmUnit;
processInitCommands;
sleep 600; // wait for 10 Minutes and spawn one more
_b = _b+1;

};

sleep 5;
hint "Its Done...";

But the Heli Spawns Empty with ground Vehicles the Script works Great (without the setPosATL). How can i add him a crew?

greetings

Sc0rc3d

Share this post


Link to post
Share on other sites

this will fill all the choppers cargo seats

and spawn a pilot and main gunner



waituntil {!isnil "bis_fnc_init"};

hint "Spawn Random Helicopter after 60 Seconds!";
sleep 60;

private ["_enemyArmPool","_ArmNumberSpawn","_ArmType","_spawnedArmUnit","_patrolmark","_spawnmark","_ArmUnit","_b","_armored"];

_patrolmark = _this select 0;
_spawnmark = _this select 1;
_armored = _this select 2;
[color="#FF0000"][/color][color="#FF0000"]_pilotman = createGroup east;[/color] // create a group

_b = 0;

while {_b != _armored} do {

_enemyArmPool = ["ACE_Ka50","Mi17_TK_EP1","Mi17_rockets_RU","Mi24_D_TK_EP1"] call BIS_fnc_selectRandom;
_spawnedArmUnit = [getMarkerPos _spawnmark, 180, _enemyArmPool, EAST] call bis_fnc_spawnvehicle;
_ArmUnit = _spawnedArmUnit select 0;
_ArmUnit setPosATL [getPosATL _ArmUnit select 0, getPosATL _ArmUnit select 1, 300];
{_x setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';";} forEach units _ArmUnit;
processInitCommands;

// add the pilot if you need him
[color="#FF0000"]           _pilot = _pilotman createUnit ["RU_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
           _pilot moveInDriver _ArmUnit;
           _pilot1 = driver _ArmUnit;
           _pilot setskill 1;

// add gunner if you need to
           _gunner = _pilotman createUnit ["RU_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
           _gunner moveInGunner _ArmUnit;
           _gunner = Gunner _ArmUnit;
           _gunner setCombatMode "RED";
           _gunner setskill 1;

// fill all seats of the chopper with enemy if you need them
_cargoNum = _ArmUnit emptyPositions "cargo";
if (_cargoNum > 0) then 
{
  _fillSlots = round (random _cargoNum);
   _pos =  getMarkerPos _spawnmark;
    _locGr =  _pos findEmptyPosition [10, 100];
	 sleep .2;

	if (_locGr select 0 > 0)then 
	{
	   _cargo = [_locGr, East, _cargoNum,[],[],[],[],[_fillSlots,0.5]] call BIS_fnc_spawnGroup;
	    sleep .2;
		 {_x moveInCargo _ArmUnit;} forEach units _cargo;
	};
};[/color]

sleep 600; // wait for 10 Minutes and spawn one more
_b = _b+1;

};

sleep 5;
hint "Its Done...";


---------- Post added at 23:59 ---------- Previous post was at 23:38 ----------

you could give your chopper some direction and speed to start him off faster in a patrol by replacing


spawnedArmUnit = [getMarkerPos _spawnmark, 180, _enemyArmPool, EAST] call bis_fnc_spawnvehicle;

with


            _spawnedArmUnit = createVehicle [_enemyArmPool, getmarkerpos _spawnmark, [], 500, "FLY"]; //500 is the height
_spawnedArmUnit setCombatMode "RED";
             _spawnedArmUnit setDir 290;
 _hinddir =  random 290;
              _hindspeed = 100;
  _spawnedArmUnit setVelocity [(sin _hinddir * _hindspeed),(cos _hinddir * _hindspeed), 0];

just an idea

Edited by hogmason

Share this post


Link to post
Share on other sites

Thanks a lot but it don't works. Not with Pilot only and not with Gunner etc. :(

But sounds nice!

ahh found the problem no _east = createcenter east; my fault! :D

Edited by Sc0rc3d

Share this post


Link to post
Share on other sites

I tested the first post that works fine for me diddnt test secound post thought ill do it today n upload a demo. so u only need pilot n gunner yeah do u want the speed n direction as well

---------- Post added at 08:15 ---------- Previous post was at 07:48 ----------

just tested this works great to spawn chopper moving 100 speed at random direction with pilot and gunner


waituntil {!isnil "bis_fnc_init"};

hint "Spawn Random Helicopter after 10 Seconds!";
sleep 10;

private ["_enemyArmPool","_ArmNumberSpawn","_ArmType","_spawnedArmUnit","_patrolmark","_spawnmark","_ArmUnit","_b","_armored"];

_patrolmark = _this select 0;
_spawnmark = _this select 1;
_armored = _this select 2;
_pilotman = createGroup east;

_b = 0;

while {_b != _armored} do {

_enemyArmPool = ["Mi17_TK_EP1","Mi17_rockets_RU","Mi24_D_TK_EP1"] call BIS_fnc_selectRandom;
           _hind = createVehicle [_enemyArmPool, getmarkerpos _spawnmark, [], 500, "FLY"]; 
		_hind setCombatMode "RED";			
           _hinddir =  random 360;
           _hindspeed = 100;			
           _hind setVelocity [(sin _hinddir * _hindspeed),(cos _hinddir * _hindspeed), 0];
//{_x setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';";} forEach units _ArmUnit;
//processInitCommands;

           _pilot = _pilotman createUnit ["RU_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
           _pilot moveInDriver _hind;
           _pilot = driver _hind;
           _pilot setskill 1;

		_gunner = _pilotman createUnit ["RU_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
           _gunner moveInGunner _hind;
           _gunner = Gunner _hind;
		_gunner setCombatMode "RED";
           _gunner setskill 1;			

//	_cargoNum = _hind emptyPositions "cargo";
//	if (_cargoNum > 0) then 
//	{
//	  _fillSlots = round (random _cargoNum);
//	   _pos =  getMarkerPos _spawnmark;
//	    _locGr =  _pos findEmptyPosition [10, 100];
//		 sleep .2;
//		 
//		if (_locGr select 0 > 0)then 
//		{
//		   _cargo = [_locGr, East, _cargoNum,[],[],[],[],[_fillSlots,0.5]] call BIS_fnc_spawnGroup;
//		    sleep .2;
//			 {_x moveInCargo _hind;} forEach units _cargo;
//		};
//	};

sleep 600; // wait for 10 Minutes and spawn one more
_b = _b+1;

};

sleep 5;
hint "Its Done...";



---------- Post added at 08:28 ---------- Previous post was at 08:15 ----------

just rememberedyou are using UPS so you will need to add this with the _pilot code


           _pilot setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';";
           processInitCommands;

so it will look like this

waituntil {!isnil "bis_fnc_init"};

hint "Spawn Random Helicopter after 10 Seconds!";
sleep 10;

private ["_enemyArmPool","_ArmNumberSpawn","_ArmType","_spawnedArmUnit","_patrolmark","_spawnmark","_ArmUnit","_b","_armored"];

_patrolmark = _this select 0;
_spawnmark = _this select 1;
_armored = _this select 2;
_pilotman = createGroup east;

_b = 0;

while {_b != _armored} do {

_enemyArmPool = ["Mi17_TK_EP1","Mi17_rockets_RU","Mi24_D_TK_EP1"] call BIS_fnc_selectRandom;
           _hind = createVehicle [_enemyArmPool, getmarkerpos _spawnmark, [], 500, "FLY"]; 
		_hind setCombatMode "RED";			
           _hinddir =  random 360;
           _hindspeed = 100;			
           _hind setVelocity [(sin _hinddir * _hindspeed),(cos _hinddir * _hindspeed), 0];
//{_x setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';";} forEach units _ArmUnit;
//processInitCommands;

[color="#FF0000"]            _pilot = _pilotman createUnit ["RU_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
           _pilot moveInDriver _hind;
           _pilot = driver _hind;
           _pilot setskill 1;
           _pilot setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';";
           processInitCommands;[/color]			


		_gunner = _pilotman createUnit ["RU_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
           _gunner moveInGunner _hind;
           _gunner = Gunner _hind;
		_gunner setCombatMode "RED";
           _gunner setskill 1;			

_cargoNum = _hind emptyPositions "cargo";
if (_cargoNum > 0) then 
{
  _fillSlots = round (random _cargoNum);
   _pos =  getMarkerPos _spawnmark;
    _locGr =  _pos findEmptyPosition [10, 100];
	 sleep .2;

	if (_locGr select 0 > 0)then 
	{
	   _cargo = [_locGr, East, _cargoNum,[],[],[],[],[_fillSlots,0.5]] call BIS_fnc_spawnGroup;
	    sleep .2;
		 {_x moveInCargo _hind;} forEach units _cargo;
	};
};

sleep 600; // wait for 10 Minutes and spawn one more
_b = _b+1;

};

sleep 5;
hint "Its Done...";


---------- Post added at 08:31 ---------- Previous post was at 08:28 ----------

Thanks a lot but it don't works. Not with Pilot only and not with Gunner etc. :(

But sounds nice!

ahh found the problem no _east = createcenter east; my fault! :D

LOL Yeah you need a center mate.

just create the center in your mission init.sqf that way your covered with all your scripting incase you need to spawn units etc....

Share this post


Link to post
Share on other sites

So now it works all great with the Helicopters but one strange Problem i got with the Ground Vehicles. They don't really wannt to Attack.

For Example the T72_MOL the MG on the Tank will Attack me but the Main Pipe will do Sometimes nothing. I drive with an ATV Around the

Tank the Pipe will follow me but he never starts Shooting after a while the MG starts to attack but never the main pipe.

The Script gives no Errors at all and spawns what it should but i think i got an logic Problem or the bis_fnc_spawnvehicle don't does what

it should so right. Maybee some experienced user knows the Problem. This is my Script:

waituntil {!isnil "bis_fnc_init"};

if isserver then 
{
sleep 30;

private ["_enemyArmPool","_ArmNumberSpawn","_ArmType","_spawnedArmUnit","_patrolmark","_spawnmark","_ArmUnit","_b","_armored"];


_patrolmark = _this select 0;
_spawnmark = _this select 1;
_armored = _this select 2;

_b = 0;

while {_b != _armored} do {

_enemyArmPool = ["ibr_T55","BMP2_MOL","ibr_datsun_mol","ibr_datsun_molblk","T72_MOL"] call BIS_fnc_selectRandom;
_spawnedArmUnit = [getMarkerPos _spawnmark, 180, _enemyArmPool, EAST] call bis_fnc_spawnvehicle;
_ArmUnit = _spawnedArmUnit select 0;
{_x setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';"} forEach units _ArmUnit;
processInitCommands;
sleep 60;
_b = _b+1;

};
};

Greetings

Sc0rc3d

Share this post


Link to post
Share on other sites

have you tried

setCombatMode "RED";

setskill 1;

this works great for units but as you are talking about a vehicle with units spawned in it i dont know but its worth a shot



waituntil {!isnil "bis_fnc_init"};

if isserver then 
{
sleep 30;

private ["_enemyArmPool","_ArmNumberSpawn","_ArmType","_spawnedArmUnit","_patrolmark","_spawnmark","_ArmUnit","_b","_armored"];


_patrolmark = _this select 0;
_spawnmark = _this select 1;
_armored = _this select 2;

_b = 0;

while {_b != _armored} do {

_enemyArmPool = ["ibr_T55","BMP2_MOL","ibr_datsun_mol","ibr_datsun_molblk","T72_MOL"] call BIS_fnc_selectRandom;
_spawnedArmUnit = [getMarkerPos _spawnmark, 180, _enemyArmPool, EAST] call bis_fnc_spawnvehicle;
_ArmUnit = _spawnedArmUnit select 0;
[color="#FF0000"]_ArmUnit setCombatMode "RED";
_ArmUnit setskill 1;[/color]
{_x setVehicleInit "nul = [this, _patrolmark] execVM 'ups.sqf';"} forEach units _ArmUnit;
processInitCommands;
sleep 60;
_b = _b+1;

};
};

another way which gives you more control on the skills is

{_x setSkill ["aimingAccuracy",0.65]} forEach units _spawnedArmUnit ;
{_x setSkill ["aimingShake",0.99]} forEach units _spawnedArmUnit ;
{_x setSkill ["aimingSpeed",0.85]} forEach units _spawnedArmUnit ;
{_x setSkill ["endurance",0.85]} forEach units _spawnedArmUnit ;
{_x setSkill ["spotDistance",0.99]} forEach units _spawnedArmUnit ;
{_x setSkill ["spotTime",0.85]} forEach units _spawnedArmUnit ;
{_x setSkill ["courage",0.85]} forEach units _spawnedArmUnit ;
{_x setSkill ["reloadSpeed",0.85]} forEach units _spawnedArmUnit ;
{_x setSkill ["commanding",0.85]} forEach units _spawnedArmUnit ;
{_x setSkill ["general",0.85]} forEach units _spawnedArmUnit ;



---------- Post added at 17:59 ---------- Previous post was at 17:58 ----------

points you in the right direction

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  

×