Raidable Shelters (Legacy Thread)

Status
Not open for further replies.
Ey, I use TruePVE I assume that when using this plugin it will prevent people form raiding the shack there is also no option regarding Zone Manager or anything is this on your todo list ?
and can a command be added to spawn shacks ? For admin purpose, testing things.
 
Ey, I use TruePVE I assume that when using this plugin it will prevent people form raiding the shack there is also no option regarding Zone Manager or anything is this on your todo list ?
and can a command be added to spawn shacks ? For admin purpose, testing things.

True PVE is supported, meaning players can damage raidable shelters. Could you clarify the need for Zone Manager support, what’s the use case there?
 
Im so technophobic! I am getting this message in console:
"Failed to run a 600.00 timer in 'RaidableShelters v1.5.0' (NullReferenceException: Object reference not set to an instance of an object.) at Oxide.Plugins.RaidableShelters+<>c__DisplayClass36_0.b__0 () [0x00000] in :0 at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in :0" Cheers and thanks in advance for any advice
 
Im so technophobic! I am getting this message in console:
"Failed to run a 600.00 timer in 'RaidableShelters v1.5.0' (NullReferenceException: Object reference not set to an instance of an object.) at Oxide.Plugins.RaidableShelters+<>c__DisplayClass36_0.b__0 () [0x00000] in :0 at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in :0" Cheers and thanks in advance for any advice
Could you please attach your config
 
Sure, I'll have a thought about it (y)
FYI, DynamicPVP implements PVP areas by creating Zone Manager zones with "PVP" in their names, and then calls a TruePVE hook to map the zone ID to the "exclude" ruleset.

I've just finished a FOSS plugin that also does this for player bases (Player Base PVP Zones), but it's still in review on the couple of sites I've submitted it to. This may be even more relevant to your needs since I'm tracking player shelters in addition to player buildings and tugboats.


Separate topic: It would be nice if there was a way to set a spawn chance for items, so that some stuff could be configured to spawn only rarely.
 
I have a player who's reporting that all shelters that spawn near them are empty when they raid them. I cannot reproduce this issue myself and have set minimums in the config such that at least 1 box and 1 furnace will spawn. Any idea why this might be happening? I have not watched the player raiding as they are typically online when I am not.
 
I have a player who's reporting that all shelters that spawn near them are empty when they raid them. I cannot reproduce this issue myself and have set minimums in the config such that at least 1 box and 1 furnace will spawn. Any idea why this might be happening? I have not watched the player raiding as they are typically online when I am not.
Could you share your config
 
Failed to run a 600.00 timer in 'RaidableShelters v1.5.0' (NullReferenceException: Object reference not set to an instance of an object.)
at Oxide.Plugins.RaidableShelters+<>c__DisplayClass36_0.<StartRemovalTimer>b__0 () [0x00000] in <42f0b8a5b20848e781fc367754e32c4c>:0
at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in <beb2b64691c64e2b95b99491bd85442c>:0
config: defaults
spawn test (rs.test) then do ent kill and wait for the error

C#:
private void StartRemovalTimer(LegacyShelter shelter, float lifetimeSeconds, ShelterData shelterData)
        {

            timer.Once(lifetimeSeconds, () =>
            {
                ulong shelterId = shelter.net.ID.Value; //<====== What happens if shelter is null here?

                if (shelter != null)
                {
                    foreach (ulong entityId in shelterData.InteriorEntities)
                    {
                        BaseEntity entity = FindEntityById(entityId);
                        if (entity != null)
                            entity.Kill();
                    }

                    shelter.Kill();
                }

                if (_storedData.Shelters.ContainsKey(shelterId))
                {
                    _storedData.Shelters.Remove(shelterId);
                    DataFileUtil.Save(DataFileUtil.GetFilePath(), _storedData);
                }
            });
        }
 
config: defaults
spawn test (rs.test) then do ent kill and wait for the error
Edit: The code you posted doesn't match the latest version?

Possible cleanup of the latest version's logic:
C#:
        private void StartRemovalTimer(LegacyShelter shelter, float lifetimeSeconds, ShelterData shelterData)
        {
            var shelterId = shelter.net.ID.Value;
            if (lifetimeSeconds <= 0)
            {
                CleanupShelter(shelterData, shelter, shelterId);
                return;
            }

            shelterData.RemovalTimer = Time.realtimeSinceStartup + lifetimeSeconds;
            DataFileUtil.Save(DataFileUtil.GetFilePath(), _storedData);

            timer.Once(lifetimeSeconds, () => CleanupShelter(shelterData, shelter, shelterId));
        }

        private void CleanupShelter(ShelterData shelterData, LegacyShelter? shelter, ulong shelterId)
        {
            foreach (ulong entityId in shelterData.InteriorEntities)
            {
                var entity = FindEntityById(entityId);
                entity?.Kill();
            }

            shelter?.Kill();

            if (_storedData.Shelters.Remove(shelterId))
            {
                DataFileUtil.Save(DataFileUtil.GetFilePath(), _storedData);
            }
        }
 
Last edited:
Hey, this is a really nice plugin but there's a feature that would be helpful, which is to set a percentage on item spawn rates something like this:
{
"Shortname": "cctv.camera",
"Skin Id": 0,
"Minimum Amount": 1,
"Maximum Amount": 2,
"Chance to spawn": 50
}
So there would be a 50% chance that a camera will spawn in a box.
 
So after configuring config file all the items i added never all show up in boxes also I never get a furnace only one or two boxes even though I have 2 boxes as minimum I did about 5 /rs.test commands and always same outcome
 

Attachments

Status
Not open for further replies.
Back
Top
This plugin uses Oxide's permission system. Grant or revoke permissions using oxide.grant and oxide.revoke. You can assign them to individual players or groups using their Steam id or group name.
Chat commands start with a /, while console commands can be entered directly in the F1 console or server console. Use find <keyword> in console to search for available commands related to the plugin.
Settings are stored in the config file found under the config/ directory. You can edit this file manually, then reload the plugin to apply your changes.
Persistent data is saved in the data/ directory. This includes things like saved settings, usage stats, or player progress depending on the plugin. Deleting a data file will reset stored progress or customizations.
Language files are located in the lang/ folder. To translate messages, copy the en.json file into your target language folder (e.g. fr, de) and edit the values. Reload the plugin after changes to apply new messages.
This section lists public methods exposed by the plugin for use in other plugins. You can call these via the CallHook method. Make sure the plugin is loaded before calling its API to avoid null reference errors.
These are custom hooks that other plugins can listen for. Simply define a method with the same name and expected parameters in your plugin to handle the event. Hooks are triggered at key moments and are useful for extending or reacting to plugin behavior.
These hooks are injected into the game's code using Harmony. They let the plugin run code at key points in the game's internal logic. You can return values to block or modify behavior. Use with caution — these are powerful and can affect core mechanics.
Cart