BaroN

[RELEASE] Steal Buried Flags - Change Flag Steal Height

10 posts in this topic

** All credit to the exile mod team for the code, this is just a simple edit and override **

 

This override addresses the common issue of players burying their flags deep into the ground, rocks, existing map structures or, other terrain by very simply increasing the height on the flag pole from which you can successfully steal it.

In your mission file's config.cpp add the following line to your class CfgExileCustomCode  section:

    //Steal Flag Height
    ExileClient_action_stealFlag_condition = "overrides\ExileClient_action_stealFlag_condition.sqf";

So it looks like this:

class CfgExileCustomCode 
{
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.

		Simply add the following scheme here:

		<Function Name of Exile> = "<New File Name>";

		Example:

		ExileClient_util_fusRoDah = "myaddon\myfunction.sqf";
	*/
	
	//Steal Flag Height
	ExileClient_action_stealFlag_condition = "overrides\ExileClient_action_stealFlag_condition.sqf";
	
};

Then create a file called ExileClient_action_stealFlag_condition.sqf and copy the text below inside it:

/**
 * ExileClient_action_stealFlag_condition
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

/*
Steal flag height adjustment to 4m from default 1.5m to prevent burying exploit
by BaroN of GoG's World
http://www.gogsworld.com/home
*/

 
private["_flagObject","_result","_buildRights"];
_flagObject = _this;
_result = "";
try 
{
	if (isNull _flagObject) then
	{
		throw "Invalid flag object";
	};
	if ((_flagObject getvariable ["ExileFlagStolen", 0]) isEqualTo 1) then
	{
		throw "Cannot steal a flag twice!";
	};
	if ((_flagObject distance2D player) > 2) then 
	{
		throw "You are too far away!";
	};
	if (((getPosASL player) select 2) > (((getPosASL _flagObject) select 2) + 4)) then 
	{
		throw "You cannot steal flags at the top of the pole!";
	};
	_buildRights = _flagObject getVariable ["ExileTerritoryBuildRights",[]];
	if ((getPlayerUID player) in _buildRights) then
	{
		throw "You cannot steal your own flag!";
	};
}
catch 
{
	_result = _exception;
};
_result

Place this file inside your overrides folder in your mission folder. If you don't have one, simply create one. You can put the file in any other folder you have like; fixes, custom etc. but, remember to change the address in your config.cpp custom code section. 

The steal height I have changed to in the above file is 4m. You can change that to whatever you want. The exile default is 1.5m. To change it to a different height edit the number 4 from the new file above on this line:

    if (((getPosASL player) select 2) > (((getPosASL _flagObject) select 2) + 4)) then 

** Please note that at 4m players will need a 2 story base to cover their flag. A single story base will allow raiders to steal the flag from the roof of the base if the flag is at ground level and the first storey is also at ground level. So, please test what height works for you **

Edited by BaroN
  • Like 12
  • Thanks 1

Share this post


Link to post
Share on other sites
Advertisement
On 1/20/2017 at 9:58 AM, kuplion said:

Just implemented this on my servers. I wonder how many people are going to bitch now.. xD

To be honest, we haven't had that much bitching and at 4m and it's pretty much solved the burying problem. Personally, I think if you place a flag and then build around it, you've gotta be nuts if you don't then try and steal it yourself. If you are the owner and you get the message: 

"You cannot steal your own flag!"

then that means it's exposed and can be stolen by other players. If it's your own flag and you get this message thrown when you try to steal it on your roof:

"You cannot steal flags at the top of the pole!"

Then all will be fine in your world... :)

 

Edited by BaroN
  • Like 1

Share this post


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

If you are the owner and you get the message: 


"You cannot steal your own flag!"

then that means it's exposed and can be stolen by other players.


"You cannot steal flags at the top of the pole!"

Then all will be fine in your world... :)

More or less, yeh - i got one object on this:

There are cases, where the flag is "burried" a bit into objects (rocks, buildings and so on) where you actually can start stealing the flag, but once you reach the 100% players get the message:

"You are too far away!"

 

Doesn't happen that often but it happen.

Share this post


Link to post
Share on other sites

Sounds like the animation of stealing the flag where you are up against the rock must be moving you further than 2 away from it then. I can't say I've noticed this but, don't disbelieve you. If you wanted to you could up the distance slightly in this line:

if ((_flagObject distance2D player) > 2) then 

Change the 2 to 2.5 or whatever...

  • Like 1

Share this post


Link to post
Share on other sites

Yes, search for 'steal flag' in the config.cpp in the mission folder and comment out that whole action. 

Sorry, am on phone so can't see what class it's under but, more than likely called flag or territory.. 

Share this post


Link to post
Share on other sites

is there a possibility to change the parameters for the height, so it counts not from the bottom of the pole which is maybe under the surface (for example 2m) and you cant reach the 1.5m mark?

for example to count the position from surface? fpr example the pole is 2m under ground but you can always reach the 1.5m above surface? so the value becomes

"dynamic"?

 

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.