Jump to content

[Tutorial] Gang Capturable Areas


Recommended Posts

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

Link to post
Share on other sites
  • 4 weeks later...
  • Replies 173
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

A tutorial by: @Fuel   MISSION SIDE Step 1 Create a new file in core>>gangs called fn_areaCapture.sqf and paste this #include "..\..\script_macros.hpp" /* File:

fn_setupActions.sqf    Thank You  Deadlesszombie

Looks nice going to test it out now UPDATE: Everything seems to work perfectly fine on 5.0.0 if you have any problemss be sure to post your server rpt with them!  

Posted Images

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

Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...
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
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
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. 

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
Link to post
Share on other sites
  • 4 weeks later...
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
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

Link to post
Share on other sites
  • 1 month later...

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

 

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.

Link to post
Share on other sites
  • 3 weeks later...
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
Link to post
Share on other sites
  • 4 weeks later...
6 hours ago, Matty6603 said:

any fix?

Check the init where you placed the flags, you possible have an error in there that could be causing the problem
 

Error in expression <this allowDamage false; this enableSimulation false; this setVaria>
  Error position: <enableSimulation false; this setVaria>
  Error Missing ;

And this error in client rpt:

Error in expression <ariable ["gangNum","Gang_Area_2", true];.>
23:21:38   Error position: <.>

Both are to do with the mission.sqm ie the placed objects (flags)

Edited by JedINyte
Link to post
Share on other sites
16 minutes ago, JedINyte said:

Check the init where you placed the flags, you possible have an error in there that could be causing the problem
 

Error in expression <this allowDamage false; this enableSimulation false; this setVaria>
  Error position: <enableSimulation false; this setVaria>
  Error Missing ;

And this error in client rpt:

Error in expression <ariable ["gangNum","Gang_Area_2", true];.>
23:21:38   Error position: <.>

Both are to do with the mission.sqm ie the placed objects (flags)

ok thanks

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.