Hello all - I've developed a beta version of the TruePVE plugin as a prototype to reduce the number configuration options I have to maintain, and try to move much of the customization to the user side via a map-based system, allowing for more versatile damage control configurations. If any of you are interested in playing around with the new setup, I'd definitely appreciate any feedback.
Chat command:
/tpvebeta_prod - Show the type and prefab name of the entity being looked at (to assist with mapping)
Console commands:
tpvebeta.get - Get the value of the specified option
tpvebeta.set - Set the value of the specified option
tpvebeta.list - List the available options
tpvebeta.def [all|config|data] - Reset to default configuration, data (mappings), or both
Configuration:
Some built-in configuration options are still available for more complex handling, but have been renamed:
allowSuicide - Allow players to use Fi > kill
authDamage - Allow players to damage entities they own or have build authorization on
corpseLooting - Allow players to loot other players' corpses
handleDamage - Enable TruePVE processing of damage
handleLooting - Enable TruePVE processing of looting
heliDamage - Enable heli to damage all entities
heliDamageLocked - Enable heli to damage locked doors/boxes
immortalLocks - Locked doors/boxes are indestructible
sleeperAdminDamage - Admins can hurt/kill sleepers
sleeperLooting - Allow player to loot sleepers
Mappings:
The damage control beyond some of the configurable options is handled in a map-based system, where containers are mapped to other containers and associated with a flag indicating whether to allow damage. There is a "global" container which is by default mapped to itself and specifies if damage is globally enabled or disabled, which can then be overridden by additional mappings. The global container should never have any entries in prefabs or types.
Additional mappings can be added to global to specify their default damage. Mappings from global indicate whether the entity or entities represented by the container can be damaged.Code:"global": { "name": "global", "prefabs": [], "types": [], "links": { "global": false // linked to itself, false means no damage - this is the "catchall" damage condition }, "enabled": true }
In addition, other containers can be mapped to global to signify that the entity or entities represented can damage anything. For example:Code:"global": { "name": "global", "prefabs": [], "types": [], "links": { "global": false, // linked to itself, false means no damage "player": true // players take damage }, "enabled": true }, "player": { "name": "player", "prefabs": [], "types": [ "BasePlayer" ], "links": {}, "enabled": true }
There is an inherent priority to mappings, so global mappings are overridden by more specific mappings. Damage handling logic first checks the target and initiator to determine if they are directly mapped, then if the initiator is mapped to global, then if global is mapped to the target entity. This prioritizing allows generic mappings to be overridden by more specific mappings. In the following configuration, damage is globally enabled against players, but "traps" overrides the global mapping and prevents traps and spikes from damaging the player:Code:"global": { "name": "global", "prefabs": [], "types": [], "links": { "global": false // linked to itself, false means no damage }, "enabled": true }, "napalm": { "name": "napalm", "prefabs": [ "napalm" // entity with ShortPrefabName = "napalm" ], "types": [], "links": { "global": true // linked to global, napalm can damage anything }, "enabled": true }
Mapping Containers:Code:"global": { "name": "global", "prefabs": [], "types": [], "links": { "global": false, "player": true // anything can damage players }, "enabled": true }, "player": { "name": "player", "prefabs": [], "types": [ "BasePlayer" ], "links": {}, "enabled": true }, "traps": { "name": "traps", "prefabs": [ "spikes.floor" // floor spike prefab name ], "types": [ "BearTrap", // bear trap type "Landmine" // land mine type ], "links": { "player": false // traps and spikes cannot damage players - overrides global->player mapping }, "enabled": true }
The structure of the container for mapping entities is as follows:
name - Name of the container - can be any string, but must be unique
prefabs - List of short prefab names
types - List of entity type names
links - Damage mappings to other containers - map of container name to damage flag (true = damageable)
enabled - Turns on and off this container, meaning no mappings to/from the container will be used
The list prefabs and types are used to link to the entity - if the entity type matches any entry in types, OR the entity prefab matches any entry in prefabs, then the container is considered a match for that entity.
Note: The chat command /tpvebeta_prod will print the type and prefab name of the entity which is being looked at, to help with setting up mappings.
Default Mapping:
The default mapping configuration has the following rules:
- Global damage disabled
- Players and heli can take damage by default
- Napalm damages anything
- Players cannot damage other players
- Players can damage traps and barricades
- Traps and barricades cannot hurt players
- High external walls cannot hurt players
TruePVE prototype (beta) feedback
Discussion in 'Rust Development' started by ignignokt84, Jul 25, 2016.
