Jump to content

Yac Vaguer

Creator
  • Posts

    330
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Yac Vaguer

  1. Version 1.0.0

    97 downloads

    SimplePVESphere is a Rust plugin for Oxide modding that allows developers to easily create and manage temporary, spherical PVE (Player Versus Environment) zones for their custom events. It provides a visual sphere, a trigger collider for player access control, and an API to integrate with other plugins. The core idea is to define an area where PVE rules apply, typically controlled by an event owner. Unauthorized players are ejected, and ownership can be dynamically assigned, for example, when a player kills an NPC within the zone. Core Features 1. Dynamic Sphere Creation: * Create spheres programmatically with a specific position, radius, and visual opacity. * The visual sphere is rendered at twice the functional trigger radius to give players a clear visual warning before they enter the active PVE zone. 2. Trigger-Based PVE Zone: * A `SphereCollider` acts as the functional boundary of the PVE zone. * Manages player entry and automatically ejects unauthorized players. Ejection logic is designed to safely move players (and their vehicles, if mounted) to a ground position just outside the sphere. 3. Ownership and Access Control: * Owner-Based Access**: If a sphere has an owner (a `BasePlayer`), only the owner and their Rust teammates are allowed inside. * No Owner: If a sphere has no owner, all players can enter by default. * Ejection: Unauthorized players attempting to enter or found within the sphere are automatically ejected. 4. Automatic Ownership via NPC Kill: * A key feature is the ability for a sphere to automatically assign ownership. * If a player kills a `HumanNPC` or `ScientistNPC` (that is not also a real player with a SteamID) inside a sphere *that currently has no owner*, that player will automatically become the owner of that specific sphere. * When this happens, `SimplePVESphere` calls a global hook: `OnSimplePveOwnerAssigned(string eventName, BasePlayer ownerPlayer)`. 5. Admin Handling: * **Global Setting**: A global configuration `IgnoreAdmins` (in `oxide/config/SimplePVESphere.json`, default: `false`) can allow admins to bypass PVE rules. * Per-Sphere Override: When creating a sphere, an `eventDebugMode` flag (boolean, defaults to `false`) can be passed. * If `eventDebugMode` is `true` for a sphere, the global `IgnoreAdmins` setting is ignored for *that specific sphere*, and admins will be treated like regular players (subject to PVE rules). * If `eventDebugMode` is `false`, the global `IgnoreAdmins` setting applies as usual. 6. Performance: * The plugin dynamically subscribes to the server-wide `OnEntityDeath` hook only when at least one PVE sphere is active. It unsubscribes when the last sphere is removed, minimizing performance impact when the plugin is not actively managing any zones. Configuration The plugin has one main configuration option, found in `oxide/config/SimplePVESphere.json`: { "IgnoreAdmins": false } * `IgnoreAdmins` (boolean): * If `true`, players with admin flags will generally ignore the PVE restrictions (unless overridden by `eventDebugMode` on sphere creation). * If `false` (default), admins are subject to the PVE rules like other players (unless `eventDebugMode` is true for that sphere). API Usage To use `SimplePVESphere` in your plugin, you first need a reference to it. [PluginReference] private Plugin SimplePVESphere; Then, you can call its API methods: 1. `CreateSphere` Creates a new PVE sphere. void CreateSphere(string eventName, Vector3 position, float radius, int opacity, BasePlayer owner = null, bool eventDebugMode = false) * Parameters: * `eventName` (string): A unique name for this sphere. This is used to identify the sphere for removal or owner updates (e.g., your event's name or a unique ID). * `position` (Vector3): The world coordinates for the center of the sphere. * `radius` (float): The functional radius of the PVE trigger zone. The visual sphere will appear at `radius * 2`. * `opacity` (int): Determines the number of visual sphere layers. More layers can make the sphere more opaque. * `owner` (BasePlayer, optional): The initial owner of the sphere. Defaults to `null` (no owner). * `eventDebugMode` (bool, optional): If `true`, the global `IgnoreAdmins` config is bypassed for this sphere, and admins are treated as normal players. Defaults to `false`. * Example: if (SimplePVESphere != null) { Vector3 eventCenter = new Vector3(0, 100, 0); float eventRadius = 50f; int sphereOpacity = 3; string myEventName = "MyAwesomeEvent_1"; bool treatAdminsAsPlayersForThisEvent = true; SimplePVESphere.Call("CreateSphere", myEventName, eventCenter, eventRadius, sphereOpacity, null, treatAdminsAsPlayersForThisEvent); Puts($"SimplePVE sphere for {myEventName} created."); } else { PrintError("SimplePVESphere plugin not loaded!"); } 2. `RemoveSphere` Removes an existing PVE sphere. This should always be called when your event ends or the PVE zone is no longer needed to clean up resources. void RemoveSphere(string eventName) * Parameters: * `eventName` (string): The unique name of the sphere to remove (must match the name used in `CreateSphere`). * Example: if (SimplePVESphere != null) { string myEventName = "MyAwesomeEvent_1"; SimplePVESphere.Call("RemoveSphere", myEventName); Puts($"SimplePVE sphere for {myEventName} removed."); } 3. `SetSphereOwner` Updates or sets the owner of an existing PVE sphere. void SetSphereOwner(string eventName, BasePlayer newOwner) * Parameters: * `eventName` (string): The unique name of the sphere to update. * `newOwner` (BasePlayer): The player to set as the new owner. Can be `null` to remove ownership. * Example: BasePlayer somePlayer = GetPlayerById("somePlayerSteamId"); // Your method to get a player if (SimplePVESphere != null && somePlayer != null) { string myEventName = "MyAwesomeEvent_1"; SimplePVESphere.Call("SetSphereOwner", myEventName, somePlayer); Puts($"Ownership of {myEventName} sphere transferred to {somePlayer.displayName}."); } Listening for Hooks `SimplePVESphere` calls a hook when a player automatically becomes an owner by killing an NPC inside an unowned sphere. Your plugin can listen for this hook to react to ownership changes. OnSimplePveOwnerAssigned Called by `SimplePVESphere` *after* a player has been automatically assigned as the owner of a sphere due to an NPC kill. void OnSimplePveOwnerAssigned(string eventName, BasePlayer ownerPlayer) * Parameters: * `eventName` (string): The name of the sphere for which the owner was assigned. * `ownerPlayer` (BasePlayer): The player who was assigned as the owner. * Example (in your event plugin): // In your plugin (e.g., MyEventPlugin.cs) private void OnSimplePveOwnerAssigned(string eventNameOfSphere, BasePlayer newOwner) { // Check if it's an event this plugin cares about if (eventNameOfSphere == "MyAwesomeEvent_1") { Puts($"Player {newOwner.displayName} has become the owner of the '{eventNameOfSphere}' PVE zone via NPC kill!"); // Add your custom logic here, e.g., announce to the player, update UI, etc. SendPlayerMessage(newOwner, "You have conquered the PVE zone!"); } } Typical Integration Scenario 1. Event Start: * Your event plugin starts. * It determines the event location and desired PVE radius. * It calls `SimplePVESphere.Call("CreateSphere", "MyEventName", center, radius, opacity, null, false);` * Typically, the initial owner is `null` if you want NPC kills to determine the first owner. * Set `eventDebugMode` based on whether admins should be subject to PVE rules for this specific event. 2. During Event: * `SimplePVESphere` handles player ejections based on ownership. * If a player kills an NPC inside the sphere (and it's unowned), `SimplePVESphere` assigns them as owner. * `SimplePVESphere` then calls `OnSimplePveOwnerAssigned("MyEventName", newPlayerOwner)`. * Your plugin, listening to this hook, can then: * Update its internal state for the event. * Notify the new owner. * Potentially change event objectives or UI. 3. Event End: * Your event plugin concludes. * It **must** call `SimplePVESphere.Call("RemoveSphere", "MyEventName");` to clean up the PVE sphere and its associated GameObjects. This provides a robust and straightforward way to add PVE zone management to your events without needing to implement the complex sphere and trigger logic yourself.
    Free
  2. Changed Status from Pending to Closed
  3. Changed Status from Pending to Closed
  4. Yac Vaguer

    MAP MARKER

    Changed Status from Pending to Not a Bug Changed Fixed In to Next Version
  5. Yac Vaguer

    MAP MARKER

    Thank you for the suggestion, I will see what can I do
  6. Yac Vaguer

    Dome Setting

    Changed Fixed In to 1.7.1
  7. Yac Vaguer

    Dome Setting

    Changed Status from Pending to Not a Bug
  8. Yac Vaguer

    Dome Setting

    It is not posible the whole experience will be affected anyways if you use the plugin pve mode you can download the New version from discord and change the opasity to 0 but it will cause a lot of other issues for the players
  9. Yac Vaguer

    Dome Setting

    The dome is what make the player bounce of the event in case an owner is set. You can remove the PVE Option in the config setting PVE Mode: False which allow other players to loot. I'm also working on an Alpha Vesion which is in my discord to use PVE Mode Plugin instead
  10. Yac Vaguer

    Final recommendations

    Hi @laodu I know you eagerness to get the support for PVE Mode plugin, but right now the Ferry Terminal is working fine with the custom made, and it doesn't require to work this extension. Although it is something that I'm moving forward to apply, sadly RL work is getting in the way.
  11. Yac Vaguer

    Final recommendations

    Changed Status from Pending to Not a Bug Changed Fixed In to 1.2.0
  12. Yac Vaguer

    Error Spam

    Thanks Animo, it worked
  13. Yac Vaguer

    Error Spam

    I'm keep getting a spam message of the error below (GLOBAL) => [ Toro Rust#1066 ] status: (3/50) Online!.. (1/1) => [ Llanero X3 ] status: (3/50) Online!.. DiscordAPIError[50005]: Cannot edit a message authored by another user at handleErrors (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:727:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.runRequest (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:1128:23) at async SequentialHandler.queueRequest (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:959:14) at async _REST.request (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:1272:22) at async GuildMessageManager.edit (/home/container/node_modules/discord.js/src/managers/MessageManager.js:188:15) { requestBody: { files: [ [Object] ], json: { content: undefined, tts: false, nonce: undefined, enforce_nonce: false, embeds: [Array], components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: 0, message_reference: undefined, attachments: [Array], sticker_ids: undefined, thread_name: undefined, applied_tags: undefined, poll: undefined } }, rawError: { message: 'Cannot edit a message authored by another user', code: 50005 }, code: 50005, status: 403, method: 'PATCH', url: 'https://discord.com/api/v10/channels/SOMENUMBERS/messages/SOMENUMBERS' }
  14. Changed Status from Work in Progress to Fixed
  15. @noruesorry for the big delay, the issue is fixed now
  16. Changed Status from Pending to Fixed Changed Fixed In to 1.2.0
  17. There is no reason to think that I tried to blame you, I was just gather information If found an issue and I just update hte plugin, let me know if that fix the issue for you
  18. are you also using fancy drop or any other plugin that change the supply.signal skinId?
  19. @phillip.van deventer Check that you need to grant permissions to use to your default group, I also introduced VIP permissions that will have a different cooldown if you which
  20. You might have another plugin like Fancy drop or similar, please share the full config file if you are not using Fancy Drop
  21. Check what skin id you are using and what do you have in the config id or send me a picture of the signal in your inventory and the config file
2m

Downloads

Total number of downloads.

9.4k

Customers

Total customers served.

137.5k

Files Sold

Total number of files sold.

2.9m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.