Jump to content
Rez

[Tutorial] Gang Capturable Areas

Recommended Posts

5 hours ago, GenApophis said:

Hi,

sorry to ask but what do you mean by "The marker TEST"???

Did you mean Marker Text?

I'm pretty sure, yes. There is no test in the options in the editor. 

Share this post


Link to post
Share on other sites

Works perfectly, Anyway to make it so the person is in an animation while doing it? Or at-least for first half so they can't run around and shoot people while capturing

Also just worked out that you can run quite far away and it continues to capture

Anyway to make it so when cops have it captured you cannot buy from there, but you can't re capture it for half an hour after cops have captured it

Edited by Dexterio

Share this post


Link to post
Share on other sites
46 minutes ago, Dexterio said:

Works perfectly, Anyway to make it so the person is in an animation while doing it? Or at-least for first half so they can't run around and shoot people while capturing

Also just worked out that you can run quite far away and it continues to capture

Anyway to make it so when cops have it captured you cannot buy from there, but you can't re capture it for half an hour after cops have captured it

Look at the radius number in the beginning, I set mine to 10 (10  meters ), I think it’s at 50. 

You can add the medic animation from the medic script. 

You would need to set up a line for a time out in seconds at the end of the script. 

Share this post


Link to post
Share on other sites
34 minutes ago, one said:

Look at the radius number in the beginning, I set mine to 10 (10  meters ), I think it’s at 50. 

You can add the medic animation from the medic script. 

You would need to set up a line for a time out in seconds at the end of the script. 

I guess it was these bits: 

if (player distance _area > 100)
if (player distance _area > 100)

How would I add the animation? New to SQF

same as above, Cheers

Share this post


Link to post
Share on other sites
On 3/25/2018 at 5:17 PM, Dexterio said:

I guess it was these bits: 

if (player distance _area > 100)
if (player distance _area > 100)

How would I add the animation? New to SQF

same as above, Cheers

I think this is the movement.

 

Your mission file\core\medical\fn_revivePlayer.sqf

 

//Lets reuse the same thing!
for "_i" from 0 to 1 step 0 do {
    if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
        [player,"AinvPknlMstpSnonWnonDnon_medic_1"] remoteExecCall ["life_fnc_animSync",RCLIENT];
        player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
    };

    sleep .15;
    _cP = _cP + .01;
    _progressBar progressSetPosition _cP;
    _titleText ctrlSetText format ["%3 (%1%2)...",round(_cP * 100),"%",_title];
    if (_cP >= 1 || !alive player) exitWith {};
    if (life_istazed) exitWith {}; //Tazed
    if (life_isknocked) exitWith {}; //Knocked
    if (life_interrupted) exitWith {};
    if (player getVariable ["restrained",false]) exitWith {};
    if (player distance _target > 4) exitWith {_badDistance = true;};
    if (_target getVariable ["Revive",false]) exitWith {};
    if (_target getVariable ["Reviving",objNull] != player) exitWith {};
};

I am pretty sure this makes the medic bobble around. But I like the way this script is set up as is, because you defend it as you try to take territory. The current gang needs to actively defend, or any one can take there turf as soon as they leave. Good luck

Share this post


Link to post
Share on other sites

it works nice on 5.0 but hiw i can cnange tell the world think??

i want thats it say   play xy and his gang xy has captured gangarena xy ??

Share this post


Link to post
Share on other sites

ok so everything works fine but once a player walks upto the pole and starts to capture the progress bar gets stuck on 1% and then dissapears

 

Share this post


Link to post
Share on other sites
4 hours ago, Yozza said:

ok so everything works fine but once a player walks upto the pole and starts to capture the progress bar gets stuck on 1% and then dissapears

 

Change the rsc layer for the status bar :) 

In the fn_areaCapture.sqf change the 

5 cutRsc ["life_progress","PLAIN"];

and

5 cutText ["","PLAIN"];

To another number, 6,7,8,9 or whatever you want.

Edited by JedINyte

Share this post


Link to post
Share on other sites

Hello i woundring what the init would be if i wanna make like a proccers at the area once captuerd you can procces right ?

i tryed this but its not working

 

this addAction[localize"STR_Process_Marijuana",life_fnc_processAction,"marijuana",0,false,false,"",'  _b = (nearestObjects[getPosATL player,["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"],25]) select 0;  life_inv_cannabis > 0 && !life_is_processing && !life_action_inUse && !isNil {_b getVariable "gangOwner"} && {(_b getVariable "gangOwner") == (group player)} && playerSide isEqualTo civilian '];
this setVariable ["realname","Marijuana Processing"];

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Xeus said:

Hello i woundring what the init would be if i wanna make like a proccers at the area once captuerd you can procces right ?

i tryed this but its not working

 

this addAction[localize"STR_Process_Marijuana",life_fnc_processAction,"marijuana",0,false,false,"",'  _b = (nearestObjects[getPosATL player,["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"],25]) select 0;  life_inv_cannabis > 0 && !life_is_processing && !life_action_inUse && !isNil {_b getVariable "gangOwner"} && {(_b getVariable "gangOwner") == (group player)} && playerSide isEqualTo civilian '];
this setVariable ["realname","Marijuana Processing"];

Read the thread. I know I posted exactly how to do this, as I did this in my server. 

Share this post


Link to post
Share on other sites

anyway to make this so once a player enters so close to the area they start to capture it instead of using the flag pole? thanks

 

  • Confused 1

Share this post


Link to post
Share on other sites

@one  what i mean is could i set it up to a trigger of some sort so when the placer enters the area of the capture zone it starts capturing instead of them walking up to the poll and scrolling to capture it ? sorry for not explaining right the first time.

Edited by Yozza

Share this post


Link to post
Share on other sites

I completely understand what you mean, I just would never do it that way. Look at some scripts that have triggers when you get close to an area.

Share this post


Link to post
Share on other sites

Working perfect on 5.0, anyone manage to set it up to work off a minimum number of police online? Similar to how fed works. Going to give it a go tonight. 

Share this post


Link to post
Share on other sites
13 hours ago, Amused094 said:

Working perfect on 5.0, anyone manage to set it up to work off a minimum number of police online? Similar to how fed works. Going to give it a go tonight. 

You can try to work this into your script. 

if(_cops < 2) exitWith { hint "You cant capture this area, there aren't enough police on. There needs to be 2 police on."; };
if(_allPs < 10) exitWith { hint "You cant capture this area, there aren't enough civilians on. There needs to be 10 or more civilians on."; };

 

Edited by one

Share this post


Link to post
Share on other sites
On 7/20/2018 at 10:41 PM, one said:

You can try to work this into your script. 

if(_cops < 2) exitWith { hint "You cant capture this area, there aren't enough police on. There needs to be 2 police on."; };
if(_allPs < 10) exitWith { hint "You cant capture this area, there aren't enough civilians on. There needs to be 10 or more civilians on."; };

 

Ended up just using the same if statement used for the fed reserve.
 

if (west countSide playableUnits < (LIFE_SETTINGS(getNumber,"minimum_cops"))) exitWith {
     hint format [localize "STR_Civ_NotEnoughCops",(LIFE_SETTINGS(getNumber,"minimum_cops"))];

Seems to be working fine

Share this post


Link to post
Share on other sites

2018/09/15,  0:20:16 Error in expression <

life_actions = life_actions + [player addAction["<t color='#FF0000'>Capture>
2018/09/15,  0:20:16   Error position: <addAction["<t color='#FF0000'>Capture>
2018/09/15,  0:20:16   Error Missing ]
2018/09/15,  0:20:16 File core\fn_setupActions.sqf [life_fnc_setupActions], line 29

 

Share this post


Link to post
Share on other sites
On 9/14/2018 at 8:25 PM, Phil Degirth said:

2018/09/15,  0:20:16 Error in expression <

life_actions = life_actions + [player addAction["<t color='#FF0000'>Capture>
2018/09/15,  0:20:16   Error position: <addAction["<t color='#FF0000'>Capture>
2018/09/15,  0:20:16   Error Missing ]
2018/09/15,  0:20:16 File core\fn_setupActions.sqf [life_fnc_setupActions], line 29

 

Seems like you have a UTF BOM or some garbage in the code. Pastebin the entire "core\fn_setupActions.sqf " file.

Share this post


Link to post
Share on other sites
On 9/20/2018 at 3:49 PM, Wayne said:

Is there away that it can put a permanent captured area which saves to the database? 

You would have to write that yourself, but absolutely.

Share this post


Link to post
Share on other sites
On 6/19/2018 at 6:19 PM, JedINyte said:

Change the rsc layer for the status bar :) 

In the fn_areaCapture.sqf change the 

5 cutRsc ["life_progress","PLAIN"];

and

5 cutText ["","PLAIN"];

To another number, 6,7,8,9 or whatever you want.

Having the same issue and changing the numbers didn't help :/   EDIT: Fixed it,  noticed there's 4 places I had to change the number :D

Edited by VanquishedCookie
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×