TruePVE

Better PVE/PVP implementation

Total Downloads: 4,636 - First Release: Mar 25, 2016 - Last Update: Mar 7, 2018

5/5, 26 likes
  1. Since you're here @ignignokt84.

    can we get an updated modified version of the new version of Zone Manager? :) That would be awesome.

    Also, I would love to see some kind of building damage ability implemented while in the zone and using TruePVE. a lot of players ask me if they can damage buildings in the zone. LOL

    The two go great together, just don't have the ability to offer more destruction.

    I tried copying over certain lines myself. just can't figure it out.
     
    Last edited by a moderator: Jan 23, 2017
  2. I'll see what I can do - the problem is that any custom zone behavior must be individually implemented, so the ZoneManager implementation keeps getting more tedious with each new flag, and then you end up with a few flags that each cover all the behaviors of any particular zone (like a PVP arena), or many flags each of which controls a single behavior in the zone (like building damage or player damage). I'm currently trying to figure out a better way to handle the interactions between TruePVE and ZoneManager so that most/all of the code needed is in TruePVE, and either reduce or eliminate ZoneManager modifications... In any case, I'll keep you updated.
     
  3. Here is my .json file. have changed nothing since before the wipe.
     

    Attached Files:

  4. I believe I've come up with a better solution for handling zones... See the attached TruePVE.cs for the 0.5.1 "beta". Long explanation below, but it's in your interest to read ;)...

    You can now create individual configurations within the .json for each zone you wish to customize - or (more likely), you can create an empty zone configuration, which will cause TruePVE to basically allow all damage within the zone (and all looting too). Below is the default config that is created as an example empty "allow-all" zone:
    Code:
    "zoneData": {
        "testzone": {} // zone with ID "testzone" will skip TruePVE processing
    }
    The zone-specific configuration mappings use the exact same structure as the existing mapping configurations, so the same guidelines and flexibility apply to zone-specific mappings. The only config items excluded from being zone-specific are the true/false options (allowSuicide, authDamage, etc). Also, the zone-specific entries will have no effect in instances where one entity is inside the zone, and the other (attacker or target) is outside the zone. In this case, the standard "global" damage handling will apply.

    As part of this update, the configuration options handleDamage and handleLoot should now be set to true. There is also a new configuration entry called "useZones" which toggles zone-specific processing on/off - setting useZones=false will ignore zones and handle damage the same across the entire map (false is the default setting, so would need changed).

    Additionally, with this update the only code change which would be needed in future ZoneManager releases is the addition of the new procedure below. As part of this change, custom zone flags are no longer needed.
    Code:
    // added for TruePVE
    private List<string> GetEntityZones(BaseEntity entity)
    {
        if(entity ==null)returnnull;    HashSet<Zone> zones =null;
        ResourceDispenser disp = entity.GetComponent<ResourceDispenser>();    if(disp !=null)
            resourceZones.TryGetValue(disp, out zones);
        elseif(entity is BasePlayer)
            playerZones.TryGetValue(entity as BasePlayer, out zones);
        elseif(entity is BaseCombatEntity)
            buildingZones.TryGetValue(entity as BaseCombatEntity, out zones);
        else
            otherZones.TryGetValue(entity, out zones);    List<string> zoneIds = new List<string>();
        if(zones !=null)
            foreach(Zone zone in zones)
                zoneIds.Add(zone.Info.Id);
        if(zoneIds ==null|| zoneIds.Count==0)returnnull;
            return zoneIds;
    }
    [DOUBLEPOST=1485209910][/DOUBLEPOST]
    The config option "authDamage": true allows players to damage structures/deployables that they own. Can you verify this is the behavior you're seeing? If so, just set authDamage to false and you should be good. Or are you able to damage other players' structures?
     

    Attached Files:

    Last edited by a moderator: Feb 5, 2017
  5. The problem is any player can damage foundations and doors of any other player if they can put a tc near the building.
    The tc areas overlap and an area of damage is possible in between the 2 tc's.

    This was not an issue before the last game update.
     
  6. Ok, so I get the zone specified stuff, which would be cool to have and definitely more usable than asking you to modify newer versions every time.

    but, the coding that needs to be copied to zone manager.cs, although its a pretty small amount of code. Which part of the plugin does it need to overwrite?
    meaning, where exactly does it need to go in the code? I'm so obviously stupid when it comes to coding. :p
    [DOUBLEPOST=1485221390][/DOUBLEPOST]
    can they physically damage it? or just remove stuff?
     
  7. As i said they can damage it. ( Explosives, Rockets, Picks ect) do damage to building parts between 2 tc's from 2 different players not authorized on each others tc.
    Picture description is yellow = player 1 tc zone and green = player 2 tc zone, Red = overlap where damage can be done.
    Player 1 is not authorized on player 2's tc and visa versa.
    Also if a player gets authorized on another players tc they can remove or damage freely.
    It was tied to the player who built said item but now it is tied to tc authorization.
     

    Attached Files:

  8. It actually doesn't matter, as long as it's within the class definition for ZoneManager. To test, I had inserted it in between the procedures ZoneFieldList and GetPlayersInZone. It's probably easier to drop it into the end of the .cs, after the UnityVector3Converter class.
    [DOUBLEPOST=1485260292][/DOUBLEPOST]
    That clears it up a bit - I will test this out and see what I can come up with.
    [DOUBLEPOST=1485261838][/DOUBLEPOST]@^Animal^ What plugins are you using? I'm still not able to reproduce this behavior.

    The code that handles authorized damage checks all cupboards that overlap the target, and if the attacking player is not authorized on ALL of them, the damage is cancelled.
     

  9. using an extended cupboard radius helps resolve some of the issues. I use Cupboard Radius, because it changes how the building block reacts. :)
    [DOUBLEPOST=1485267837][/DOUBLEPOST]
    ok, how does this affect building wrapper? im sure its not in the new .cs for zonemanager and Im going to have to insert that also. im sure. lol
     
    Last edited by a moderator: Jan 24, 2017
  10. It doesn't affect BuildingWrapper - if you're using BuildingWrapper, the rotation code still needs to be inserted into the same location as it always has. That won't change unless Nogrod adds the ability to pass a rotation value to the official ZoneManager implementation (this was requested a few times in the ZoneManager support forum).
     
  11. Well, I have the code to be inserted and I know where to insert it to.
    I was just copying all files and getting ready to test on my server, (backing up the old ones before I do) :)

    I personally think that this arena thing is getting pretty popular for PVE servers, so having the wrapper and possibly the True PVE plugin implemented as a part of the updated zonemanager.cs everytime it comes out would be an awesome choice. I use building wrapper to wrap everything I build in a zone for the server.
     
  12. Ok here is my list.
    AutoDoors
    Backpacks
    BoxLooters
    Build
    DeathNotes
    Economics
    EconomicsBalanceGUI
    FancyDrops
    Friends
    GatherManager
    GatherRewards
    GUIAnouncements
    GUIShop
    HeliControl
    HelpText
    ID
    InfoPanel
    Kits
    LustyMaps
    MasterKey
    NightLanterns
    Quests
    RemoverTool
    ShowCrosshair
    SignArtist
    SkipNight
    StackSizeController
    StorageCleaner
    TruePVE
    Updates
    Vanish
    I have turned on and off most of them in order to find what causes the issue but so far i found nothing.
     
  13. what is the true way to write it? or can you add in a command to add it via chat command?
    [DOUBLEPOST=1485273957][/DOUBLEPOST]
    Im going to test that this on my server. I have all the same mods. None of those mods would allow you to damage others bases/ foundations/ deployables.
    [DOUBLEPOST=1485274622][/DOUBLEPOST]Im going to test that this on my server. I have all the same mods. None of those mods would allow you to damage others bases/ foundations/ deployables.[/QUOTE]

    Ok, I unloaded cupboardradius (for default cupboard radius) but still couldn't get close enough to allow my cupboard to overwrite their building block. Im unable to reproduce the issue.
     
    Last edited by a moderator: Jan 24, 2017
  14. figures, leave it to me to get a one of a kind issue.......... guess ill just warn the players to surround their builds with tc's on the outside and hope the map wipe and update fixes more then it breaks.
     
  15. Code:
    // added for TruePVE
    private List<string> GetEntityZones(BaseCombatEntity entity)
    {
      if(entity == null) return null;  HashSet<Zone> zones = null;
      if(entity is BasePlayer)
        playerZones.TryGetValue(entity as BasePlayer, out zones);
      if(zones == null)
        if(!otherZones.TryGetValue(entity as BaseEntity, out zones))
          buildingZones.TryGetValue(entity as BaseCombatEntity, out zones);  List<string> zoneIds = new List<string>();
      if(zones != null)
        foreach(Zone zone in zones)
          zoneIds.Add(zone.Info.Id);
      if(zoneIds == null || zoneIds.Count == 0) return null;
      return zoneIds;
    }
    apparently for this coding added into zone manager, its throwing the following error and spamming rcon

    Code:
    (17:10:56) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination
    (17:10:57) | ⓅⓄⓇⓃ★SALLY[49221/76561198318164765] sent invalid attack: Item broken (lr300.entity)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Calling 'GetEntityZones' on 'ZoneManager v2.4.9' took 220ms
    (17:10:57) | Calling 'OnEntityTakeDamage' on 'TruePVE v0.5.1' took 223ms
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    (17:10:57) | Failed to call hook 'GetEntityZones' on plugin 'ZoneManager v2.4.9' (InvalidCastException: Cannot cast from source type to destination type.)
    CODE]
    Edit: I found out what it is that is causing this, The Incidenary bullets cause this, well the fire from them. :)
     
    Last edited by a moderator: Jan 26, 2017
  16. I was just about to ask that question :) I'm looking into this now.

    EDIT:
    Updated code block below for ZoneManager:
    Code:
            // added for TruePVE
            private List<string> GetEntityZones(BaseEntity entity)
            {
                if(entity == null) return null;
              
                HashSet<Zone> zones = null;
                ResourceDispenser disp = entity.GetComponent<ResourceDispenser>();
              
                if(disp != null)
                    resourceZones.TryGetValue(disp, out zones);
                else if(entity is BasePlayer)
                    playerZones.TryGetValue(entity as BasePlayer, out zones);
                else if(entity is BaseCombatEntity)
                    buildingZones.TryGetValue(entity as BaseCombatEntity, out zones);
                else
                    otherZones.TryGetValue(entity, out zones);
              
                List<string> zoneIds = new List<string>();
                if(zones != null)
                    foreach(Zone zone in zones)
                        zoneIds.Add(zone.Info.Id);
                if(zoneIds == null || zoneIds.Count == 0) return null;
                return zoneIds;
            }
     
    Last edited by a moderator: Jan 26, 2017
  17. Thanks, ill test it out after rust update.
     
  18. Is there any possible way to get a "for dummies" guide on how to run ZoneManager as primarily handling damage hooks? I run a PvE server and would like to have a PvP zone, yet I'm not understanding what you're saying about how to make ZoneManager handle 'hooks' first. So yeah, infopic or a 'for dummies' guide would be great! :D
     
  19. If you can wait for the 0.5.1 update, I will be rewriting the instructions on ZoneManager integration and setting up zone rules for TruePVE.

    @Krazy J How's the 0.5.1 beta working out? Any more issues since the incendiary ammo console spam?
     
  20. Thank you ^_^ I'll look forward to it.