-
Content Count
2047 -
Joined
-
Last visited
-
Medals
Everything posted by 1para{god-father}
-
EventHandlers causing Freezing on Dedi Server or Public Varibles
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ahhh so just use: _x addEventHandler ["Killed",{ if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore + 5; }}]; -
EventHandlers causing Freezing on Dedi Server or Public Varibles
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi thanks for the Reply. A little confused now as that is what I though I was doing here is my Scripts that i thought all run from the server ? apart from the EH added to players INIT. how else can i store totalscore unless I use PV ? ////store PV on sever///// init.sqf if (isserver) then { if (isNil "totalscore") then { totalscore = 0 }; publicVariable "totalscore"; }; Mission.sqf if(not isServer) exitWith{}; sleep 2; _towns = nearestLocations [getPosATL player, ["NameVillage","NameCity","NameCityCapital","StrongPoint"], 25000]; _pos = position (_towns select (floor (random (count _towns)))); ["clear","Locate & Destroy","Destoy Ammo ",true,["MissionAO",_pos,"flag","ColorYellow"]] call SHK_Taskmaster_add; ////////PATROL MARKER///////////// _mrk1 = createmarker ["marker_clear",_pos]; _mrk1 setmarkershape "ELLIPSE"; _mrk1 setmarkersize [300,300]; _mrk1 setMarkerColor "ColorRed"; "marker_clear" setMarkerAlpha 0; sleep .2; ////////////////////////Set UP AI NOW///////////////////// ///////////Spawn Ammo Crate///////////// _ammobox = createVehicle ["GuerillaCacheBox",getmarkerpos "marker_clear", [], 0, "NONE"]; _houses = [_ammobox,150] call getEnterableHouses; if((count _houses) > 0) then { _house = _houses call getRandomElement; _buildingpos = 1 max (round random (_house select 1)); _house = _house select 0; _ammobox setPos (_house buildingPos _buildingpos); } else { //_ammobox setPos _pos; take out for testing }; sleep .5; /////DEBUG///////// if ((paramsarray select 0) == 1) then { _cid = floor(random 10000); _t = format["ammo is here%1",_cid]; [_t, _ammobox, "Icon", [1,1], "TEXT:", _t, "TYPE:", "dot", "COLOR:", "ColorGreen", "GLOBAL", "PERSIST"] call CBA_fnc_createMarker; }; // Create GROUP1 5 Man Team ///////// _grp1 = [_pos, EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Patrol")] call BIS_fnc_spawnGroup; [_grp1,_pos,250] execVM "scripts\BIN_taskPatrol.sqf"; { _x addEventHandler ["Killed", { if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore + 5; publicVariable "totalscore";}}]; } forEach (units _grp1); //////GROUP2 5 Man Team ///////// _grp2 = [_pos, EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Patrol")] call BIS_fnc_spawnGroup; [_grp2,_pos,150] execVM "scripts\BIN_taskPatrol.sqf"; { _x addEventHandler ["Killed", { if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore + 5; publicVariable "totalscore";}}]; } forEach (units _grp2); ///////////Place in Buildings 7 Man Team /////////////////////// _grpbuild1 = [_pos, EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Group")] call BIS_fnc_spawnGroup; _grpbuild1 execVM "PlaceInBuilding.sqf"; { _x addEventHandler ["Killed", { if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore + 5; publicVariable "totalscore"; }}]; } forEach (units _grpbuild1); _radius = 500; _exp = "(1 + meadow) * (1 - forest) * (1 - trees)"; _prec = 10; _bestplace = selectBestPlaces [_pos,_radius,_exp,_prec,1]; _spot = _bestplace select 0; _spot2 = _spot select 0; // Cfreat ARMOUR//////////////////// _armourgrp1 = [_spot2, east,["LandRover_MG_TK_INS_EP1", "LandRover_MG_TK_INS_EP1"],[[-3,-3], [3,3]]] call BIS_fnc_spawnGroup; [_armourgrp1,_pos,200] execVM "scripts\BIN_taskPatrol.sqf"; { _x addEventHandler ["Killed",{ if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore + 5; publicVariable "totalscore"; }}]; } forEach units _armourgrp1 ; //////////////Still need to work out how to add HIT EH to Vehicle waitUntil {!alive _ammobox}; ["clear","succeeded"] call SHK_Taskmaster_upd; [] call SHK_addTask; totalscore = totalscore +80; publicVariable "totalscore"; titleText ["Well Done Mission Succeeded you got an extra 80 Points you score is now......" + str totalscore,"PLAIN DOWN"];titleFadeOut 6; This is Added to Players INI this addEventHandler ["Killed", { totalscore = totalscore -100; publicVariable "totalscore"; }]; then at the end of the mission i just display the score so i do not broadcast it at all now titleText ["End Of Mission well done Your Score Total is " + str totalscore,"BLACK FADED",20]; SLEEP 15; endmission "END1"; But this still freezes the server about 30 min in ?! -
I know this works but when i test on SP but if i use this in a MP with 5 players would it be OK ? or is there a better way as this looks to simple to me , Do i need any Checks or anything ? IF 5 players were all firering at the same time would it keep up with the count or bog down ? Just need total Shoot count of Players add to each player INI this addEventHandler ["Fired", {_this execVM "countshots.sqf";}]; countshots.sqf Number_shots_fired = Number_shots_fired + 1; publicVariable "Number_shots_fired";
-
Count shots in MP
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sorry I meant how would i store the "number_shots_fired" of each player locally, then grab them all and add them up and store it in a PV on the server -
Count shots in MP
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
OK you guys are correct , WAyyyyyyyy to slow on server ! How would I store the PV local then send to server at a certain time , even at the end of the Mission ? Cheers guys -
EventHandlers causing Freezing on Dedi Server or Public Varibles
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Cheers ill give that a Go, so you do not that it is the PV adding / changing each time ? as it is all run from Server not local -
EventHandler Need some help
1para{god-father} posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Where am i going wrong ? I am trying to add in " this execvm 'Respawn.sqf';" if i take it out it works but cannot work out how to add this into the below ? xhandle = this addEventHandler ["killed", this execvm 'Respawn.sqf';{ if (_this select 1 == player) then {totalscore = totalscore + 50; publicVariable "totalscore";}}] -
EventHandler Need some help
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
AHHHH ok changed now thanks for that ! -
EventHandler Need some help
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks , thought i had to use a MP variant , will it cause any issues ? -
EventHandler Need some help
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks , Now have another issue ! Any idea why this will not work , I need to Add side in as well as i have some Playable OPFOR and do not want to add the score if they kill other OPFOR or kill themselves Working xhandle = this addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 5; publicVariable "totalscore";}}]; Not working when i try and Add the Side in ? xhandle = this addMPEventHandler ["MPKilled", { if (_this select 1 == player and side == WEST ) then {totalscore = totalscore + 5; publicVariable "totalscore";}}]; -
checking if east ai near marker
1para{god-father} replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
What are you parsing to _town ? Test with Player and see if that works first _town = _this select 0; ??? Test with ...... _town = player; -
Insurgency style respawn
1para{god-father} replied to bangabob's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Cool thanks Great Script BTW !! V cool ! -
checking if east ai near marker
1para{god-father} replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I use this it might help ? private ["_side","_pos","_radius","_units","_unit","_count"]; _side = _this select 0; _pos = _this select 1; _radius = _this select 2; _count = 0; _units = nearestObjects [_pos, ["Car","Tank","Air","Man"], _radius]; { _unit = _x; if(_unit isKindOf "Man" && side _unit == _side) then{ if(alive _unit) then{_count = _count + 1}; } else{ if(canMove _unit && side _unit == _side) then{_count = _count + 1}; }; } foreach _units; _count -
Insurgency style respawn
1para{god-father} replied to bangabob's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
is there a way to get this to work so you can spawn into Any AI Player even if they are not in your Group ? -
How to add Points system
1para{god-father} posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I am trying to keep track of a score system not for each play but as a whole to display at the end of a mission. , i.e each time an AI is killed I need to add some points, would I have to add a EH to each AI that I spawn in ? if so what would be the best way to do this ? and would this cause any notable Lagg ? These are the scripts i normally use to spawn AI in _dis = 50; _ang = random 300; _dx = sin(_ang)*_dis; _dy = cos(_ang)*_dis; _positionToSpawnIn = [((getpos _vehiclscud1) select 0) + _dx, ((getpos _vehiclscud) select 1) + _dy, 0]; _upsgrp1 = [1,_positionToSpawnIn,1,["marker_scud1","spawned","showmarker","nowait","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF"; or _Grp1 = [_pos, EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Group")] call BIS_fnc_spawnGroup; [_Grp1, _pos, 80] call bis_fnc_taskPatrol; Or any other suggestion to spawn in :) -
How to add Points system
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ahhhhhh Thanks! Well it is all working apart from Vehicles when they are destroyed the crew get points but how do I add the EH to vehicles ? _armourgrp1 = [_pos, east,["LandRover_MG_TK_INS_EP1", "LandRover_MG_TK_INS_EP1"],[[-3,-3], [3,3]]] call BIS_fnc_spawnGroup; [_armourgrp1,_pos,250] execVM "scripts\BIN_taskPatrol.sqf"; /////////////I get 5 points for Crew ////////////// { _x addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 5; publicVariable "totalscore"; _text = parseText format["%1",totalscore];[nil,nil,rHint,_text] call RE }}]; } forEach units _armourgrp1 ; /////////////////////This does not Work ????????????????????????//////////////////////////////////////// { _x addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 30; publicVariable "totalscore"; _text = parseText format["%1",totalscore];[nil,nil,rHint,_text] call RE }}]; } forEach vehicle _armourgrp1 ; -
How to add Points system
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
OK thought it was working but YEP you where correct it double them up ! So..... Tried this but it does not work any Suggestions where I am going wrong ? _grp1 = [_positionToSpawnIn, EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Patrol")] call BIS_fnc_spawnGroup; sleep .2; { addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 5; publicVariable "totalscore"; _text = parseText format["%1",totalscore];[nil,nil,rHint,_text] call RE }}] } forEach (units _grp1); Ignore forgot the _X at the start How do i add it to a group of Vehicles ? -
Debreif screen
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ahhhh so you cannot pass anything to the Briefing.Html , that is a shame ! -
Does anyone know if I can add Variables / Options to the Debrief screen I.e I need to show the Scores that I store in a Public Variable and also some text depending on what/how things went in the mission ! Or can you not pass anything to the Debrief ? Thanks
-
How to add Points system
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
OK results... Add EH to allunits does indeed work fine even for UPSMON, also if I create the group then add the EH to the group then set it to UPSMON it also work so thanks Guys ! Resolved :) -
How to add Points system
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
just double checked on wiki and it will not overwrite a existing EH so should be OK "if you add an event handler of type "killed" and there already exists one, the old one doesn't get overwritten" -
How to add Points system
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yep I think you are correct , as it does not work , but if i use "allUnits" it works so the group is not being returned. I presume it will not add another EH so will stick with allUnits -
How to add Points system
1para{god-father} replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I am spawning more group later and trying to add the EH to the group but i get a error? did not thyink i could issue it to Allunits again would it add another EH ? i.e 2 to each group ? Please advise what i ma going wrong here ...thanks _ang = random 360; _dis = 200; _dx = sin(_ang)*_dis; _dy = cos(_ang)*_dis; _positionToSpawnIn = [((getpos _vehicleambush) select 0) + _dx, ((getpos _vehicleambush) select 1) + _dy, 0]; _upsgrp1 = [1,_positionToSpawnIn,1,["ambushconvoy1","spawned","nowait","showmarker","delete:",60]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF"; sleep .2; { if (side _x == East) then { _x addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 5; publicVariable "totalscore"; _text = parseText format["%1",totalscore];[nil,nil,rHint,_text] call RE }}] } } forEach _upsgrp1; RPT error Error in expression <[nil,nil,rHint,_text] call RE }}] } } forEach _upsgrp1; _ang = random 180; > Error position: <forEach _upsgrp1; _ang = random 180; > Error foreach: Type Script, expected Array -
SHK_moveobjects
1para{god-father} replied to shuko's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ahhh thanks ! -
SHK_moveobjects
1para{god-father} replied to shuko's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sorry to drag this old thread up , but is it possible to move Markers as well ?