Jump to content
Sign in to follow this  

Recommended Posts

Ok so ive done a search and the only thing that comes close to this is for Arma 1,

So i have a TvT mission ive been making and would love to place a point system in it. So the team that gets the objective gets a set amount of points and maybe if possible the other team loses a set amount of points.

And before i go on ill just throw this out there NO this is not like Domination YES it is inspired by Domination this is a completly different set up and game style, but ill go into that later in a release post.

the way i execute a task i use SHK taskmaster 2 to call the task and a script to create the task.

in the init.sqf

	case 0: {
 		["Task1","Enemy Computer Evidence","SOCOMD has intell on the location of a Army Officer's Computer SOCOMD believe this Computer will contain vital information on The Rusian Armies war plans. Our job is to recover this Computer.",true,["MissionAO",getmarkerpos "task1","flag","ColorRed"]] call SHK_Taskmaster_add;
  		nul = [] execVM "missions\task1.sqf";
               player sideChat "SOCOMD has intell on the location of a Rusian Army Officer's Computer SOCOMD believe this Computer will contain vital information on The Rusian Armies war plans. Our job is to recover this Computer"

   		};

Now the Task.sqf

if isserver then {

sleep 10;  /// give time for UPSMON to start/////
_task1=task1;
_name = "GuerillaCacheBox" createVehicle getpos _task1;  // create Object on task marker
/////Only Destroy by satch
_name setVehicleInit "_name addEventHandler [""HandleDamage"",{(_this select 4) == ""PipeBomb""}]" ;format ["%1 = this; this setVehicleVarName ""%1""",_unitname];
processInitCommands;

/////Create Objective Marker for enemy to patrol/////
_mrkradar2 = createmarker ["marker_radar2",getpos _task1];
_mrkradar2 setmarkershape "ELLIPSE";
_mrkradar2 setmarkersize [190,190];
//"marker_radar2" setMarkerAlpha 0;  /// unmark to not show
sleep .5;

///Spawn Enemy  /// 
//if ((paramsarray select 19) == 1) then { 


_upsgrp1 = [1,getpos _task1,1,["marker_radar2","spawned","random","fortify","nomove","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getpos _task1,1,["marker_radar2","spawned","random","fortify","nomove","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getpos _task1,1,["marker_radar2","spawned","random","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getpos _task1,1,["marker_radar2","spawned","random","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getpos _task1,1,["marker_radar2","spawned","random","respawn:3","fortify","nomove","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getpos _task1,1,["marker_radar2","spawned","random","respawn:3","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos _radar2) select 0) + _dx, ((getmarkerpos _radar2) select 1) + _dy, 0];
_armourgrp1 = [getmarkerpos "task1", east,["T72_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp1) select 0, "marker_radar2","spawned","showmarker","nofollow","random","respawn:3","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos _radar2) select 0) + _dx, ((getmarkerpos _radar2) select 1) + _dy, 0];
_armourgrp2 = [getmarkerpos "task1", east,["T34_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp2) select 0, "marker_radar2","spawned","showmarker","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos _radar2) select 0) + _dx, ((getmarkerpos _radar2) select 1) + _dy, 0];
_armourgrp2 = [getmarkerpos "task1", east,["T72_TK_EP1", "LandRover_MG_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp2) select 0, "marker_radar2","spawned","showmarker","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos _radar2) select 0) + _dx, ((getmarkerpos _radar2) select 1) + _dy, 0];
_armourgrp2 = [getmarkerpos "task1", east,["T34_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp2) select 0, "marker_radar2","spawned","showmarker","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos _radar2) select 0) + _dx, ((getmarkerpos _radar2) select 1) + _dy, 0];
_armourgrp2 = [getmarkerpos "task1", east,["T72_TK_EP1", "LandRover_MG_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp2) select 0, "marker_radar2","spawned","showmarker","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";

//};
///////Wait for objective to be dead then finish task/////

waitUntil{!alive evi1 }; 



["task1","succeeded"] call SHK_Taskmaster_upd;
[] call SHK_addTask;

/////////////////CLEAN UP/////////////////////

deletemarker "marker_radar2";



};

So would any 1 know how i can achieve this.

Thanks in advance.

Share this post


Link to post
Share on other sites

A bit much to digest now mate... but your points system would simply have to be a Global Variable for each group or side or whatever... updated at the right place(s) in the code.

Share this post


Link to post
Share on other sites

As twirly mentioned - possible global variables to track sides success/failure.

youll need a system to check who is completing the task. if its just blowing up an object to complete the task - you can look at my post... give you an idea

http://forums.bistudio.com/showthread.php?133076-Figuring-the-Death-Toll-amp-displaying-it-on-screen-for-a-specific-Side&p=2129029#post2129029

also can utilise something along these lines...

this addEventHandler ["killed", {
if (side (_this select 1) == west) then
       {
   spawn deatheast; 
} else
      {
          spawn deathwest;
       };
}];

Not really the best method to lob all the code in the event handle.

you could try..

_unit addMPEventHandler ["MPKilled",{(_this select 1) spawn Scorekeeper;}];

then in the code

use

scorekeeper = {

if (side _this == west) then {westpoints = + 25;public variable "westpoints"; eastpoints = - 25; Public Variable "eastpoints";} else {do the reverse!};
};

hope the concept helps

Edited by Mikie boy

Share this post


Link to post
Share on other sites

cheers mate ill have a look

---------- Post added at 21:47 ---------- Previous post was at 21:40 ----------

Yeah its just blowing up 1 object per task

Share this post


Link to post
Share on other sites

Mikie Boy

So if i understand correctly i place

_unit addMPEventHandler ["MPKilled",{(_this select 1) spawn Scorekeeper;}];

in either the players init or the objects init

then i reate a script called MPKilled and add

scorekeeper = {

if (side _this == west) then {westpoints = + 25;public variable "westpoints"; eastpoints = - 25; Public Variable "eastpoints";} else {do the reverse!};
};

is that correct.

Share this post


Link to post
Share on other sites

sorry dude, been away - without checking that is the general idea. If its not working i can check for you - let me know.

Share this post


Link to post
Share on other sites

You would have to make it westpoints = westpoints + 25

Share this post


Link to post
Share on other sites

if im using resistance do i change the east command to resistence

Share this post


Link to post
Share on other sites

again without testing appears that should work - havent used resistence much - best bet is too test and see what happens. make sure you implement what celery added - other wise it wont add up correctly.

Share this post


Link to post
Share on other sites

so where do i place this code,


scorekeeper = {

if (side _this == west) then {westpoints = + 25;public variable "westpoints"; eastpoints = - 25; Public Variable "eastpoints";} else {do the reverse!};
};

i tired creating a scorekeeper.sqf file but that dont work i tried placing it in the script it self that diddnt work

so what i done is


if isserver then {

sleep 10;  /// give time for UPSMON to start
_task6=task6;
_name = "TK_INS_Warlord_EP1" createVehicle getpos _task6;  // create Radar
/////Only Destroy by satch
[b]_name setVehicleInit "_unit addMPEventHandler ["MPKilled",{(_this select 1) spawn Scorekeeper;}];[/b]
processInitCommands;

_mrkradar2 = createmarker ["marker_radar2",getpos _task6];
_mrkradar2 setmarkershape "ELLIPSE";
_mrkradar2 setmarkersize [190,190];
//"marker_radar2" setMarkerAlpha 0;  /// unmark to not show
sleep .5;

///Spawn OPFOR  /// 


_upsgrp1 = [1,getpos task6,1,["marker_radar2","spawned","random","nomove","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos marker_radar2) select 0) + _dx, ((getmarkerpos marker_radar2) select 1) + _dy, 0];
_armourgrp2 = [getmarkerpos "marker_radar2", east,["T34_TK_EP1", "T34_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp2) select 0, "marker_radar2","spawned","showmarker","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
sleep .2;
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos marker_radar2) select 0) + _dx, ((getmarkerpos marker_radar2) select 1) + _dy, 0];
_staticgrp1 = [getmarkerpos "marker_radar2", east,["Igla_AA_pod_East ", "D30_RU"],[[-3,-3], [3,3]]]  call bis_fnc_spawnvehicle;
[(units _armourgrp2) select 0, "marker_radar2","spawned","showmarker","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";



///////this now waits until he is dead and also no AI are in area/////

waitUntil{!alive Insurgent_funder}; 



["task6","succeeded"] call SHK_Taskmaster_upd;
[] call SHK_addTask;

[b]/////////////////ADD SCORE/////////////////////

scorekeeper = {

if (side _this == west) then {westpoints = westpoints + 25;public variable "westpoints"; eastpoints = - 25; Public Variable "eastpoints";} else {do the reverse!};
};[/b]

/////////////////CLEAN UP/////////////////////

[] execVM "delete_enemy.sqf";

};

ANY IDEAS

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  

×