-
Posts
39 -
Joined
-
Last visited
Everything posted by Rob Vary
-
-
I just fished a player out of a spot on the map and thought I should report it. I think it's just a terrain issue. Coordinates: -200.5419, 169.8414, -97.46424
-
Yes, that's why I called it nonstandard versioning. It seemed simpler to request that your plugin handle this case rather than getting another developer to change their versioning.
-
I've got two plugins (Metal Detector & Drug Business) that use nonstandard versioning (0.2 & 0.35 respectively), so they constantly come up as needing updates since this plugin is looking for 0.2.0 & 0.35.0 instead. Could you account for this nonstandard versioning?
-
-
On lines 1276, 1292, 1618, 1646, 1674, & 1696, values are still hardcoded instead of using configuration values.
-
Is the Farmer section of the default config meant to be empty?
-
-
For this error, we need to move dealer.KillMessage(); on line 601 down to at least line 610 after the conditional. If we don't, we're deleting the actual dealer npc and then trying to use it to find the index afterward. We won't be able to reference that object to find the index because that object was already deleted. Also, we should likely uncomment the SaveData(); on line 617 so that the dealer deletion is saved right away.
-
If I'd like my dealers to only spawn at night, say between the hours of 20:00 and 6:00, and I set that in the config, they will never spawn. Consider a helper function to account for when config.basicSettings.hoursFrom > config.basicSettings.hoursTill. For instance, I believe this should cover it. private bool inTimeRange(float hour) { var start = config.basicSettings.hoursFrom; var end = config.basicSettings.hoursTill; if (start <= end) { return start <= hour && hour <= end; } else { return start <= hour || hour <= end; } }
-
Despite setting "Announce when the dealer arrive/leave" to false, it was still announcing when they leave. This is because of a forgotten config check on line 302.
-
- 8 comments
-
- 36 comments
-
- 4 comments
-
- 1
-
-
- #apartments
- #rust
-
(and 7 more)
Tagged with:
-
Getting a NullReferenceException with the new version. Fixed by deleting config then updating. Failed to initialize plugin 'ReskinnableHorses v1.1.0' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.ReskinnableHorses.Init () [0x00040] in <20acad24ca9343c6a51235461ae5fb49>:0 at Oxide.Plugins.ReskinnableHorses.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x000e2] in <20acad24ca9343c6a51235461ae5fb49>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <60c318df79ed41688ea59335e48d61ad>:0 0b/s in, 0b/s out at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <dfcb48ea05694263bbc08e62a39c274c>:0 A simple fix is to have some method(s) to check if the config is up-to-date and update it if it isn't. Example: private class Configuration { [JsonProperty("Future Config Options Here")] public bool TempBool = true; public string ToJson() => JsonConvert.SerializeObject(this); public Dictionary<string, object> ToDictionary() => JsonConvert.DeserializeObject<Dictionary<string, object>>(ToJson()); } protected override void LoadDefaultConfig() => config = new Configuration(); protected override void LoadConfig() { base.LoadConfig(); try { config = Config.ReadObject<Configuration>(); if (config == null) { throw new JsonException(); } if (!config.ToDictionary().Keys.SequenceEqual(Config.ToDictionary(x => x.Key, x => x.Value).Keys)) { Puts("Configuration appears to be outdated; updating and saving"); SaveConfig(); } } catch { Puts($"Configuration file {Name}.json is invalid; using defaults"); LoadDefaultConfig(); } } protected override void SaveConfig() { Puts($"Configuration changes saved to {Name}.json"); Config.WriteObject(config, true); }
-
- 11 comments
-
- 197 comments
-
- 1
-
-
- #bradley
- #krunghcrow
- (and 4 more)
-
- 197 comments
-
- 2
-
-
- #bradley
- #krunghcrow
- (and 4 more)