Jump to content

RimBlock

Member
  • Posts

    1140
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by RimBlock

  1. Thanks Jamie.

     

    Would you mind wrapping spoiler tags around the code.

     

    Interesting ida and well executed. 

     

    Do you have indestructable bases enabled as I would guess these items moved in to player contend would just respawn on server restart even if previously destroyed or removed by owner.

     

    I see the notag exclusions are the objects that can be changed (upgraded, inventories changed etc).  It is only destruction and player / owner removal that this would seem to stop a player doing.  All other functions should work just fine.  Nice.

  2. Nearestobjects uses an array.  NearestObject uses an item.

     

     

    Lol... I appreciate your efforts dood and I think its just my machine maybe , but its still not working..

    I've done what you said, followed the instructions step by step and even had my mate check them over, but I get this now:

    15:09:05 Error position: <nearestObjects [_vehiclePlayer, [_classn>
    15:09:05 Error 0 elements provided, 3 expected
    15:09:05 File Restricted_Area.sqf, line 14
    15:09:05 Bad conversion: array
    15:09:05 Error in expression <= (Vehicle Player);
    

     

    You in a vehicle ?.  If so then try outside of a vehicle.

  3. you could.

     

    You could also assign a special skin to admins and then set this to act as a safe zone around that skin so if anyone went close to admins they would die  ;) .

     

    How about making zombies infectious so if you went within 2mtrs of them then you would get infected.

     

    You could set up a radiation zone and then require anyone entering to have a special skin (ie. a rad suit) or they would die.  Would not take much to amend the code.

     

    Lots of options, good and bad that this can be used for.  QWhat is here is a base setup but with a bit of tweaking it can be expanded in many ways.

     

    The thing to remember is that this script is attached to the player character and polls for objects in range 20x / second.  The larger the range, the more work the client has to do finding objects, querying them and then acting on the results.

     

    If you wanted to section off an island I would be more inclined to put markers around its border XXXmtrs apart and set the range to that distance so the players are stopped at the barrier around the island rather than having to poll for the item central to the island for a distance equal to the furthest point from the item to the island border.

  4. V2.4 update.

     

    Integration of fn_plot_check and fn_check_owner functions looks pretty complete.  I will probably move it to Beta today or tomorrow.

     

    The v2.4 release faves a few KB in size, reports on how many items have been taken over with the Take Ownership function (so people can see it is working) and removes the option to turn it off with a init variable.

     

    Question 

    Has anyone got any strong reasons to want my to keep the player_build file as well as the Modular_build set.  If not then I will remove it and save more KBs... 

  5. Have just rewritten a script for MatthewK to try and help out (thread ) and though I would release for all to enjoy.

     

    Set the _classnameProtected to a class name of an object you want to protect.  Classnames are types of objects.  In the code below it is all wooden DZ sheds. 

     

    Save the following as something (i.e. mpmissions\[MAP NAME]\Custom\RingOfProtection\RingOfProtection.sqf)

    // Ring of Protection by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
    //
    // This script will allow you to set two rings around an object (vehicle, building, player).  The first ring will create a warning, the second will kill the player.
    // 
    // Completely rewritten from initial code by [MIC] Murcielago.
    
    Private ["_n","_classnameProtected","_nearbyProtected","_vehiclePlayer","_nearestProtected","_warningRange","_deathRange","_nearbyProtected","_aliveNearbyProtected"];
    
    _n = 0;
    _warningRange = 20;
    _deathRange = 7;
    _classnameProtected = "Wooden_shed_DZ";
    
    While {True} Do 
    {
    	_nearbyProtected = [];	
    	_aliveNearbyProtected = [];	
    	_nearestProtected = "";	
    	_vehiclePlayer = (Vehicle Player);	
    	_nearbyProtected = nearestObjects [_vehiclePlayer, [_classnameProtected], _warningRange];
    	if ((count _nearbyProtected) >= 1) then {
    		{
    			if (alive _x) then { 
    				_aliveNearbyProtected set [(count _aliveNearbyProtected),_x]; 
    			}; 
    		}count _nearbyProtected;
    		if ((count _aliveNearbyProtected) >= 1) then{
    			_nearestProtected = _aliveNearbyProtected select 0;
    			If ((_vehiclePlayer Distance _nearestProtected) < _deathRange) Then {Player Setdamage 1;};
    			If ((_n == 0) && {_vehiclePlayer Distance _nearestProtected  >= _deathRange}) Then {
    				TitleText ["[WARNING]: Entering restricted area.  Continuing will result in death.","PLAIN"];
    			};
    			_n = _n + 0.05;
    		};
    	};
    	Sleep 0.05;
    	If ( _n > 1 ) Then {
    		_n = 0;
    	};
    };
    

    Put the following in your custom compiles.sqf (just after "progressLoadingScreen 0.8;" should work).

    ringOfProtection = compile preprocessFileLineNumbers "Custom\RingOfProtection\RingOfProtection.sqf";    

    Call it (probably from the init.sqf)  after the line "_playerMonitor = ..." with

    [] spawn ringOfProtection;

    Note this is likely to have at least a small impact on each player.

     

    Possible future upgrade:

     It could probably be addapted to a single item (i.e. admin base) but the item would need to be tagged (i.e. with a setvariable item "Protected" true type but of code) and then after the item classname is detected in range, the variable can be checked to see if that one in particular is protected.

     
  6. Ok,

     

    Fully working code with the item to put the protection on as a variable.

    // Ring of protection by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
    //
    // This script will allow you to set two rings around an object (vehicle, building, player).  The first ring will create a warning, the second will kill the player.
    // 
    // Completely rewritten from initial code by [MIC] Murcielago.
    
    Private ["_n","_classnameProtected","_nearbyProtected","_vehiclePlayer","_nearestProtected","_warningRange","_deathRange","_nearbyProtected","_aliveNearbyProtected"];
    
    _n = 0;
    _warningRange = 20;
    _deathRange = 7;
    _classnameProtected = "Wooden_shed_DZ";
    
    While {True} Do 
    {
    	_nearbyProtected = [];	
    	_aliveNearbyProtected = [];	
    	_nearestProtected = "";	
    	_vehiclePlayer = (Vehicle Player);	
    	_nearbyProtected = nearestObjects [_vehiclePlayer, [_classnameProtected], _warningRange];
    	if ((count _nearbyProtected) >= 1) then {
    		{
    			if (alive _x) then { 
    				_aliveNearbyProtected set [(count _aliveNearbyProtected),_x]; 
    			}; 
    		}count _nearbyProtected;
    		if ((count _aliveNearbyProtected) >= 1) then{
    			_nearestProtected = _aliveNearbyProtected select 0;
    			If ((_vehiclePlayer Distance _nearestProtected) < _deathRange) Then {Player Setdamage 1;};
    			If ((_n == 0) && {_vehiclePlayer Distance _nearestProtected  >= _deathRange}) Then {
    				TitleText ["[WARNING]: Entering restricted area.  Continuing will result in death.","PLAIN"];
    			};
    			_n = _n + 0.05;
    		};
    	};
    	Sleep 0.05;
    	If ( _n > 1 ) Then {
    		_n = 0;
    	};
    };
    

    Put the following in the compiles.sqf

    ringOfProtection =					compile preprocessFileLineNumbers "[File path and name]";	
    

    Call it (probably from the init.sqf)  after the line "_playerMonitor = ..." with

    [] spawn ringOfProtection;
    

    Note this is likely to have at least a small impact on each player.

  7. Anyone looking to install from this point onwards and who have a test server may want to look at the v2.4 Dev branch on the GitHub.

     

    This version is smaller and has a few enhancements that seem to be working fine in my Alpha testing.  I will continue testing tomorrow.  Apart from the changes mentioned in post, I have also added a counter to the take ownership function so people can see how many items they have taken ownership of and that it has run and completed.

     

    Take Ownership in v2.4 has been tested with a few items and seems to be working fine.

     

    If you are having problems with the mod then please post the server rpt file, the client rpt file (of the client who is having the problem or is performing the action when the problem occurs) and a copy of the file listed in any error messages from those rpt files.  I will be spending quite a bit of time on the new version testing tomorrow and can take some time out to look at reported bugs if I have the information requested.

     

    @RedBaron,

    if you contact me on Skype (details in my profile here) then I may be able to connect to your server and have a little look around to try and help you out.  I do not do this usually but you have been spending a lot of time helping to debug this new take ownership function so I am willing to make an exception.  Please note that I am on an 8 hour time difference to the UK and 7 to Europe though.

  8. The menu for take ownership is there, it just doesn't seem to be taking ownership. I've checked the files again and the only difference is the 2 sleep lines added....

     

    Which files from this mod are you using in the test server (GitHub / dropbox) and which version ?.

     

    I am playing around with my v2.4 files and have an issue with the plot pole not appearing.  This is due to changes I made for dev v2.5 and reversed for Dev v2.4 so I am just wondering if you have somehow got them files. 

     

    Search plot_take_ownership.sqf and tell me what the line is for "FNC_GetPlayerUID"

     

    Just noticed, the sleep lined should be 

    sleep 0.01;
    

    I missed off the ';' in the initial post.  I will amend it up there now.

  9. the changes made to the server_monitor.sqf are between lines 118 and lines 124.  A Plot for Life does not touch anything else.

     

    If you have all those other mods installed I am guessing one or more of them require you to edit that file and putting this mods changes and the other mod(s) changes together has given you an error.

     

    I am running Vanilla Epoch and my mod on my test server right now and do not have the error you are getting.

     

    I suggest you check all the changes you made to this file to make sure they are all correct.

     

    The error message you are getting is because this line

    _objWpnTypes = (_inventory select 0) select 0;

    is returning a string value rather than an array.

     

    If you paste up the server_monitor.sqf then I may be able to point you to the error but please put it in spoiler tags.

  10. Thanks for the update.

     

    Would suggest you look at testing on a plot with a lot of objects.  You could have three options come up on the plot pole, "take ownership" / "Take Ownership sleep" / "Reset Ownership".  THe reset ownership would just be a take ownership but using a different playerUID so the other two take ownerships could be tested again.

     

    Chould be fairly easy to setup.  Should out if you want me to look at the code to do that.  I am happy to support people who are working to test this mod.  

×
×
  • Create New...