1. here you go[​IMG]
     
  2. Wulf

    Wulf Community Admin

    That wouldn't cause it not to work, and that's not really new. You can get rid of the warning by deleting that reference at the top of the plugin though.
     
  3. i see too only this error ... i dont understand why in mutants custom loot and in crates standard..i have delete my LootSpawnLists.json and make it standard and then i have change only JunkSpawnList for test but self problem..
     
  4. i need help configuring files on my server provider. Please contact me
     
  5. hi i found a fix for the problem with wrong loot after restart, i just added a timer.

    Code:
    // Reference: Facepunch.ID
    // Reference: Facepunch.MeshBatch
    // Reference: Google.ProtocolBuffersusing System.Collections.Generic;
    using System;
    using System.Reflection;
    using System.Data;
    using UnityEngine;
    using Oxide.Core;
    using RustProto;namespace Oxide.Plugins
    {
        [Info("LootSpawnLists", "Reneb from thomasfn", "2.0.2")]
        class LootSpawnLists : RustLegacyPlugin
        {        public static Dictionary<string, object> SpawnLists;        void LoadDefaultConfig() { }        private void CheckCfg<T>(string Key, ref T var)
            {
                if (Config[Key] is T)
                    var = (T)Config[Key];
                else
                    Config[Key] = var;
            }
    //fix timer for correct loot after restart
            void Init()
            {
            timer.Once(0.5f, () => iniit());
            }
           
            void iniit()
            {
                SpawnLists = LoadDefaultSpawnlists();
                CheckCfg<Dictionary<string, object>>("Spawnlists", ref SpawnLists);
                SaveConfig();
                PatchNewSpawnlists();
            }
            static Dictionary<string, object> LoadDefaultSpawnlists()
            {
                var tblspawnlists = new Dictionary<string, object>();
                var spawnlists = DatablockDictionary._lootSpawnLists as Dictionary<string,LootSpawnList>;
                foreach (KeyValuePair<string, LootSpawnList> pair in spawnlists)
                {
                    var spawnlist = new Dictionary<string, object>();
                    spawnlist.Add("min", pair.Value.minPackagesToSpawn);
                    spawnlist.Add("max", pair.Value.maxPackagesToSpawn);
                    spawnlist.Add("nodupes", pair.Value.noDuplicates);
                    spawnlist.Add("oneofeach", pair.Value.spawnOneOfEach);
                    var packages = new List<object>();
                    foreach(LootSpawnList.LootWeightedEntry entry in pair.Value.LootPackages)
                    {
                        var tblentry = new Dictionary<string, object>();
                        if (!entry.obj)
                            continue;
                        else
                            tblentry.Add("object", entry.obj.name);
                        tblentry.Add("weight", entry.weight);
                        tblentry.Add("min", entry.amountMin);
                        tblentry.Add("max", entry.amountMax);
                        packages.Add(tblentry);
                    }
                    spawnlist.Add("packages", packages);
                    tblspawnlists.Add(pair.Key, spawnlist);
                }
                return tblspawnlists;
            }
            void PatchNewSpawnlists()
            {
                int cnt = 0;
                var spawnlistobjects = new Dictionary<string, LootSpawnList>();
                foreach (KeyValuePair<string, object> pair in SpawnLists)
                {
                    var currentspawnlist = pair.Value as Dictionary<string, object>;
                    var obj = UnityEngine.ScriptableObject.CreateInstance<LootSpawnList>();
                    obj.minPackagesToSpawn = Convert.ToInt32(currentspawnlist["min"]);
                    obj.maxPackagesToSpawn = Convert.ToInt32(currentspawnlist["max"]);
                    obj.noDuplicates = Convert.ToBoolean(currentspawnlist["nodupes"]);
                    obj.spawnOneOfEach = Convert.ToBoolean(currentspawnlist["oneofeach"]);
                    obj.name = pair.Key;
                    spawnlistobjects.Add(pair.Key, obj);
                    cnt++;
                }
                foreach (KeyValuePair<string, object> pair in SpawnLists)
                {
                    var entrylist = new List<LootSpawnList.LootWeightedEntry>();
                    var currentspawnlist = pair.Value as Dictionary<string, object>;
                    var packages = currentspawnlist["packages"] as List<object>;
                    foreach (Dictionary<string, object> entry in packages)
                    {
                        var entryobj = new LootSpawnList.LootWeightedEntry();
                        entryobj.amountMin = Convert.ToInt32(entry["min"]);
                        entryobj.amountMax = Convert.ToInt32(entry["max"]);
                        entryobj.weight = Convert.ToSingle(entry["weight"]);
                        if (spawnlistobjects.ContainsKey(entry["object"].ToString()))
                        {
                            entryobj.obj = spawnlistobjects[entry["object"].ToString()];
                        }
                        else
                        {
                            entryobj.obj = DatablockDictionary.GetByName(entry["object"].ToString());
                        }
                        entrylist.Add(entryobj);
                    }
                    spawnlistobjects[pair.Key].LootPackages = entrylist.ToArray();
                }
                var spawnlists = DatablockDictionary._lootSpawnLists;
                spawnlists.Clear();
                foreach (KeyValuePair<string, object> pair in SpawnLists)
                {
                    spawnlists.Add(pair.Key, spawnlistobjects[pair.Key]);
                }
                Puts(string.Format("{0} custom loot tables were loaded!", cnt.ToString()));
            }    }
    }
     
  6. can someone make one with MegaLoot because when i'm doing something it goes wrong;(
    if someone could help me, thanks.
     
  7. Hey there
    I just bought my own server today and im busy with plugins and this is the only plugin i dont really get
    I want it so that mutant animals have a chance to drop a weapon or metal stuff or maybe some ammo

    Ty alot if someone can help me :D
     

    Attached Files:

  8. Can anyone explain how does weight works? Does it work anyway?
     
  9. This plugin work at last Oxide version? Anybody know?
     
  10. Yes. It does.
     
  11. Hmm, i have some errors.

    This cut from log file:
    Code:
    [SERVER v1.0.18] Console: LootSpawnLists.cs(46,255+): error CS1525: Unexpected symbol `end-of-file'
    (16:03:43) | [Oxide] 3:03 PM [Error] Timed out waiting for plugin to be compiled: LootSpawnLists

    Solved! Just need a restart of server
     
  12. Me and a friend has been at this for hours, but we can't understand how we are supposed to alter the LootSpawnLists we can't understand anything, and we are getting kind of frustrated, so can anyone help us in getting a LootSpawnLists.json with megaloot or something similar?
    these files are almost like ancient greek to us o.o
     
  13. How can I make it so there are more M4 and Bolt Action Rifles in Loot Boxes and Animals and Airdrops?
     
  14. Hello, after reading many discussions on forum (by particularly reading every comment of Wulf on any relevant topics I found), websites, comparing loot_tables (.text), making my own loot tables based on others, trying (unfortunatly, outdated from 2014) configuration shared on oxide website, I'm still not able to modify the loot spawns on my rust Legacy Server, I keep updating, my .json file but nothing happen. When i'm using the official document, it's works weirdly. I mean I'm able to modify the AIloot without any logical it would seems, but the lootcrates don't change at all, still the default one. I read entirely the Overview like 30 times, and every comment of the "Ask questions/get support" about this plugin, including Loot Spawn Lists | Page 2 | Oxide . I also checked my file on JSONLint - The JSON Validator. .

    If any of you guys have advice or if master Wulf is available, I would ask some help please :S
     

    Attached Files:

  15. I noticed in the log file

    8:51 AM [Warning] Ignored obsolete game extension reference 'Oxide.Ext.RustLegacy' in plugin 'LootSpawnLists'
     
  16. Haven't had time to look into this yet, will later today hopefully.
    Old references are automatically ignored so it won't cause an error it will just state a warning.
     
  17. All, but i'm totally lost in it. I will try to rewrite one more time all the json file and make a new one but it take me like 6 hours . If someone has a piece of advice or just a configuration working yet, it would be highly appreciated.
     
  18. Okay try deleting the .json and the plugin. Reinstalling the plugin then ONLY editing the .json that was created by the plugin. Don't copy or paste anything into it. Just go through and modify a few things that would be obvious to test, reload the plugin and see if it worked. If so then open the .json back up and finish changing what you want, reload it and test everything.
     
  19. What I noticed yesterday after spending my day to make this plugin working is,

    - If i'm modifying only the figures in the LootSpawnLists.json given after adding the LootSpawnLists.cs file downloaded from Oxide website : only the AIloot is modified weirdly (even having understood the system of loot with the weight and stuff, it still has some random effect i can't explain).
    But the boxes remains the default ones.

    - If i'm modifying the encoding structure of the LootSpawnLists.json file, the server won't detect the file it would seems :
    [Error] Failed to load plugin 'LootSpawnLists.json' (no source found). And this time nothing will be changed: the AIloot is set by default.

    I'm obviously looking for making my own loot tables to decide precisely what I want and where I want. So as I said, I read carefully hundreds of posts of the plugin thread. Still have no idea to make it working though.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    After reading your answer xBDMx, I dit that :

    - Stop server
    - Delete LootSpawnLists.cs file from RoxServers File Manager, also delete LootSpawnLists.json
    - Add LootSpawnLists.cs downloaded from Oxide into the Plugin File
    - Turn on the server and loging in
    - Stop server
    - LootSpawnLists.json appears in the cfg file
    - Edit LootSpawnLists.json, copy/paste my own loot table (shared at the end of the post)
    - Turn on the server and login in
    - Wrote oxide.reload "LootSpawnLists.cs" and oxide.reload" LootSpawnLists" and also tried with LootSpawnLists.json

    There are the logs of this attempt:

    20:57 [Info] Loading Oxide Core v2.0.2112...
    20:57 [Info] Loading extensions...
    20:57 [Info] Loaded extension CSharp v1.0.2112 by Oxide Team
    20:57 [Info] Loaded extension JavaScript v1.0.2112 by Oxide Team
    20:57 [Info] Loaded extension Lua v1.0.2112 by Oxide Team
    20:57 [Info] Loaded extension MySql v1.0.2112 by Oxide Team
    20:57 [Info] Loaded extension Python v1.0.2112 by Oxide Team
    20:57 [Info] Loaded extension SQLite v1.0.2112 by Oxide Team
    20:57 [Info] Loaded extension Unity v1.0.2112 by Oxide Team
    20:57 [Info] Loaded extension RustLegacy v1.0.2112 by Oxide Team
    20:57 [Info] Using Covalence provider for game 'Rust Legacy'
    20:57 [Info] Loading plugins...
    20:57 [Info] Loaded plugin Unity Core v1.0.0 by Oxide Team
    20:57 [Info] Loaded plugin Rust Legacy v1.0.0 by Oxide Team
    20:57 [Info] Loaded plugin Auto Admin v1.0.0 by greyhawk, Ported by Reneb to Oxide 2.0
    20:57 [Info] Loaded plugin Join-Leave Messages v1.0.4 by mvrb
    20:57 [Info] AntiGlitch, DeathMessages, DuraController, GatherMultiplier, LootSpawnLists, PlayerList and TPR were compiled successfully in 2145ms
    20:57 [Info] Loaded plugin AntiGlitch v2.0.6 by Reneb
    20:57 [Info] Loaded plugin Death Messages v0.1.1 by Hatemail
    20:57 [Info] Loaded plugin DuraController v1.0.0 by BDM
    20:57 [Info] Loaded plugin GatherMultiplier v1.0.5 by Reneb
    20:57 [Info] Loaded plugin LootSpawnLists v2.0.2 by Reneb from thomasfn
    20:57 [Info] Loaded plugin Player List v0.1.0 by Hatemail
    20:57 [Info] Loaded plugin TPR v1.0.3 by Reneb Fix by Copper, Flapstik,DraB
    20:57 [Info] [LootSpawnLists] 31 custom loot tables were loaded!
    20:58 [Info] LootSpawnLists was compiled successfully in 118ms
    20:58 [Info] Unloaded plugin LootSpawnLists v2.0.2 by Reneb from thomasfn
    20:58 [Info] Loaded plugin LootSpawnLists v2.0.2 by Reneb from thomasfn
    20:58 [Info] [LootSpawnLists] 31 custom loot tables were loaded!
    20:58 [Error] Failed to load plugin 'LootSpawnLists.cs' (no source found)

    I would precise my loot table I copy/pasted is: (verified on JSONLint - The JSON Validator.)
     

    Attached Files:

    Last edited by a moderator: Jul 8, 2016