Raised This Month: $51 Target: $400
 12% 

[L4D] Restricted Zones


Post New Thread Reply   
 
Thread Tools Display Modes
sexconker
Junior Member
Join Date: Jul 2008
Old 01-12-2009 , 19:50   Re: [L4D] Restricted Zones
Reply With Quote #21

Eagerly awaiting the next release
sexconker is offline
djromero
Senior Member
Join Date: Dec 2008
Location: Maracaibo, Venezuela
Old 01-13-2009 , 00:06   Re: [L4D] Restricted Zones
Reply With Quote #22

Version 1.1 is out.

Top post has been updated.
__________________
David Romero


djromero is offline
Big Myke
Senior Member
Join Date: Jan 2009
Location: Grain Belt, USA
Old 01-13-2009 , 01:53   Re: [L4D] Restricted Zones
Reply With Quote #23

I can't seem to restrict the areas. I'm able to walk into the restricted areas with out being moved or anything? I've gotta be doing somethign wrong.
Big Myke is offline
swifty29
Member
Join Date: Nov 2008
Old 01-13-2009 , 02:11   Re: [L4D] Restricted Zones
Reply With Quote #24

Haven't tested it yet, but when all the kinks are worked out this is going to be an AWESOME plugin!
swifty29 is offline
sirius2000
Junior Member
Join Date: Dec 2008
Old 01-13-2009 , 06:33   Re: [L4D] Restricted Zones
Reply With Quote #25

fantastic plugin

thank you, works fine

1 Question: Where stored this script the data?

Last edited by sirius2000; 01-13-2009 at 06:42.
sirius2000 is offline
djromero
Senior Member
Join Date: Dec 2008
Location: Maracaibo, Venezuela
Old 01-13-2009 , 08:33   Re: [L4D] Restricted Zones
Reply With Quote #26

Quote:
Originally Posted by sirius2000 View Post
fantastic plugin

thank you, works fine

1 Question: Where stored this script the data?
Data is stored inside the [SourceMod_Path]/gamedata/rz_<map_name>.cfg
__________________
David Romero


djromero is offline
djromero
Senior Member
Join Date: Dec 2008
Location: Maracaibo, Venezuela
Old 01-13-2009 , 08:34   Re: [L4D] Restricted Zones
Reply With Quote #27

Quote:
Originally Posted by swifty29 View Post
Haven't tested it yet, but when all the kinks are worked out this is going to be an AWESOME plugin!
Well, i already released version 1.1 ... and it should be working without any kinks.

Please give it a try.
__________________
David Romero


djromero is offline
Big Myke
Senior Member
Join Date: Jan 2009
Location: Grain Belt, USA
Old 01-13-2009 , 09:54   Re: [L4D] Restricted Zones
Reply With Quote #28

Hmm I'm gonna need some help here.

I simply put your file in the pluggins folder. I loaded up my server and i'd type rz_storeloc in the console but then it said i didn't have enough permissions. so then I had to use "rcon rz_storeloc" Then it the command registered. I moved my survivor to a different location and looked at the ground and typed in the moveto command. The console looked like the the two commands are working. but when i walk into the closet. I do not get restricted. =( What am I doing wrong?
Big Myke is offline
djromero
Senior Member
Join Date: Dec 2008
Location: Maracaibo, Venezuela
Old 01-13-2009 , 10:27   Re: [L4D] Restricted Zones
Reply With Quote #29

Quote:
Originally Posted by Big Myke View Post
Hmm I'm gonna need some help here.

I simply put your file in the pluggins folder. I loaded up my server and i'd type rz_storeloc in the console but then it said i didn't have enough permissions. so then I had to use "rcon rz_storeloc" Then it the command registered. I moved my survivor to a different location and looked at the ground and typed in the moveto command. The console looked like the the two commands are working. but when i walk into the closet. I do not get restricted. =( What am I doing wrong?
I forgot to specify this, but the commands requiere "ROOT" access.

About how to restrict a location? Well, first move to the spot you wan't restricted, you don't need to look at the floor, just step on it, and type rz_storeloc in console. After this, you need to move to a different location and type: rz_storemoveto.
__________________
David Romero


djromero is offline
sexconker
Junior Member
Join Date: Jul 2008
Old 01-13-2009 , 12:15   Re: [L4D] Restricted Zones
Reply With Quote #30

At work so I can't test yet, but...

Have you implemented the menu items in this version?

Does this version allow you to specify the distance as well?
Edit: Yes it does, and it's 50 be default.

I'm also curious about how you're handling the 3D aspect.
Do you simply form a vertical cylinder of radius 50 around the point? If so, what if someone stood above/below the restricted point on another floor?
Does the radius refer to a sphere?
I bet you're just using a 2D circle, with maybe some tolerance in the Z-direction (essentially a very short cylinder).

The reason I ask is because I see potential issues when blocking spots on sloped terrain.

Edit: You're treating it as a sphere. This should cover sloped terrain easily, but may be a problem, say, under the ramp in NoMercy. (Someone on top of the ramp could get teleported if you set a single sphere large enough to cover the corner under the ramp.) This should be fine 99.9% of the time, and any adjustments could be made by changing the radius and adding multiple points as needed.
Maybe I'll whip something up tonight that uses a horizontal (x-y plane) radius and a vertical radius, and checks both vertical and horizontal distance, so you can have more control. This is a lot of work for very little benefit, so I'll play around with it last.

Radius is spelled "radious" in the code and printouts.

Here, if a player is moved, the minimum distance is still set based on their prior location.
Code:
    // Checks all spots of the map
    for (i=0;i<RestrictedSpots_Count; i++)
    {
        // calculates distance between the current position and the restricted spot ..
        Dist = Distance(Coord[0], Coord[1], Coord[2], RestrictedSpots[i][0], RestrictedSpots[i][1], RestrictedSpots[i][2]);
        
        // debug message
        if (DEBUG_ENABLED == true)     PrintToChat(client, "[RZ-debug] Distance to spot #%i = %f", i, Dist);
        
        // If player is at least XX points close to that spot .... we move and warn him ...
        if (Dist < RestrictedSpots[i][3])
        {
            // Get new location's coordinates (to where the player will be moved to if it's on the restricted spot)
            NewCoord[0] = RestrictedSpots[i][4];
            NewCoord[1] = RestrictedSpots[i][5];
            NewCoord[2] = RestrictedSpots[i][6];
            
            // Warn ...
            PrintHintText(client, "\x01This zone is restricted. You have been moved by the server!");
            
            // Move ...
            TeleportEntity(client, NewCoord, NULL_VECTOR, NULL_VECTOR);
        }
        
        // If this distance is less than the current minimum .... we set it as minimum and then check if timer should be reset ...
        if (Dist < MinimumDistance)
        {
            MinimumDistance = Dist;
        }
    }
I would recommend re-setting their distance (from the current spot) after teleporting them. Otherwise, you may be increasing the speed of the timer needlessly (after the offending player has been corrected). I've noticed it's usually once lamer who leads everyone else under a staircase, under a ramp, into a closet, into a vent, or up a loft.
Code:
    // Checks all spots of the map
    for (i=0;i<RestrictedSpots_Count; i++)
    {
        // calculates distance between the current position and the restricted spot ..
        Dist = Distance(Coord[0], Coord[1], Coord[2], RestrictedSpots[i][0], RestrictedSpots[i][1], RestrictedSpots[i][2]);
        
        // debug message
        if (DEBUG_ENABLED == true)     PrintToChat(client, "[RZ-debug] Distance to spot #%i = %f", i, Dist);
        
        // If player is at least XX points close to that spot .... we move and warn him ...
        if (Dist < RestrictedSpots[i][3])
        {
            // Get new location's coordinates (to where the player will be moved to if it's on the restricted spot)
            NewCoord[0] = RestrictedSpots[i][4];
            NewCoord[1] = RestrictedSpots[i][5];
            NewCoord[2] = RestrictedSpots[i][6];
            
            // Warn ...
            PrintHintText(client, "\x01This zone is restricted. You have been moved by the server!");
            
            // Move ...
            TeleportEntity(client, NewCoord, NULL_VECTOR, NULL_VECTOR);

           // Recalculate distance
          Dist = Distance(NewCoord[0], NewCoord[1], NewCoord[2], RestrictedSpots[i][0], RestrictedSpots[i][1], RestrictedSpots[i][2]);
        }
        
        // If this distance is less than the current minimum .... we set it as minimum and then check if timer should be reset ...
        if (Dist < MinimumDistance)
        {
            MinimumDistance = Dist;
        }
    }
Another issue I see is the following:

What if I set a RestrictedSpot with a MoveTo that was inside the Radius?
I haven't read through all of the code yet, so maybe you have taken this into account.
Edit: Nope, doesn't look like it.

I would recommend an initial loop on map load that loops through all restricted spots with all MoveTo coordinates. (You'll have to check each MoveTo with each spot!) You've got a lot of time initially now that you've implemented ChillyWI's idea, and survivors usually won't be camping out in restricted areas at the beginning. If a MoveTo is within a RestrcitedArea's Radius, there are three things you can do:

1 - Deactivate the Resitricted Spot with the bad MoveTo
2 - Deactivate the Resitricted Spot the bad MoveTo lands in
3 - Move the MoveTo location to somewhere else.

I believe number 3 would be best, with some sort of error printout.
Where would you move it to? That's another issue...

What about running a check when setting a restricted spot or moveto? This way you can tell the admin that the spot they've tried to set overlaps an existing moveto, or that the moveto they've tried to set lands in an existing restricted area. Obviously, problems could still arise by editing the file directly, and you would still need the initial check on map load. This would just provide immediate feedback to admins (as long as they're not editing the file manually).

You can get really crazy and try to handle cases where a survivor is teleported to an open spot, but is surrounded by restricted areas. (Way too complicated.)

Another method may be to teleport someone only once every X seconds. This would give them enough time to run out of the restricted area if they're teleported inside one (unless someone really messed up their areas and points...). It would still be frustrating to players though, to be bounced around trying to get out of some invisible prison, so warnings "You're in a restricted area! Move or you will be teleported!" would be helpful.

This is great as is (haven't tested it, but it all looks good from what I've read). I really hate people exploiting closets and other areas, so I would love to help make this plugin more versatile (even if it makes it more complicated). I'll try to whip up some code tonight. I have no experience with sourcemod, but this is all easily readable, and all functions I would need to interact with the game are already there.

Last edited by sexconker; 01-13-2009 at 13:16.
sexconker is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode