KarlOfDuty / CustomLoadouts

An smod plugin allowing you to set up special sub-classes and giving items based on random chance and user permissions.
https://karlofduty.com
GNU General Public License v3.0
9 stars 4 forks source link

Bug with giving items #3

Open redstonedesigner opened 5 years ago

redstonedesigner commented 5 years ago

So, I configurated my customloadouts system.

I get the following error:

[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0

My config is:

# Prints a confirmation whenever a player is given a loadout
verbose: true
# Prints debug messages
debug: false
# Adds a ms delay if needed for plugin compatibility
delay: 0

# Filters are processed in the order they are written except anything marked as "all" is always processed before all other entries
items:
    # SteamID
    all:
        # Rank, the name of the server rank defined in config_remoteadmin.txt. Set to none for only players without a rank.
        all:
            # Class, check #resources in the SMOD discord server for class names
            SCIENTIST:
                - 10:
                    - REMOVEITEMS
                    - MAJOR_SCIENTIST_KEYCARD
                    - MEDKIT
                - 5:
                    - REMOVEITEMS
                    - REMOVEAMMO
                    - USP
                    - DROPPED_9
                    - DROPPED_9
                    - MAJOR_SCIENTIST_KEYCARD
                    - MEDKIT
            CHAOS_INSURGENCY:
                - 100:
                    - DISARMER
            CLASSD:
                - 25:
                    - MEDKIT
                - 10:
                    - JANITOR_KEYCARD
            NTF_COMMANDER:
                - 0.1:
                    - O5_LEVEL_KEYCARD
                - 100:
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
            FACILITY_GUARD:
                - 100:
                    - DROPPED_7
                    - DROPPED_7
                    - DROPPED_7
                    - DROPPED_7
                - 25:
                    - REMOVEITEMS
                    - SENIOR_GUARD_KEYCARD
                    - P90
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
           NTF_CADET:
                - 100:
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
           NTF_LIEUTENANT:
                - 100:
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
KarlOfDuty commented 5 years ago

Decimals aren't currently supported.

KarlOfDuty commented 5 years ago

Test if this one works, if it does I'll make it a real release.

cl.zip

redstonedesigner commented 5 years ago

Does not work. Same / similar error.

KarlOfDuty commented 5 years ago

ok, try putting it within quotes

redstonedesigner commented 5 years ago

The item names?

KarlOfDuty commented 5 years ago

no, the chance