I've been trying to figure out the weight system for a while now and I've read all the docs for it. I can't seem to figure out (it might not even be possible) how to have items be in every drop with 100% chance. But I only want that item to be selected once. So I have a drop for 10k wood and stone, I'd like these to be only selected once to be in the drop.
EDIT: Second questions is I've changed the weight to things I don't want to drop to 0 but it keeps putting them in the airdrop anyways (they don't spawn in barrels). I was wondering if this was a bug or if I have to to create entire custom categories with those items not in the list. Hope it's not the latter.
FancyDrop
Moved
Total Downloads: 18,015 - First Release: Jun 8, 2016 - Last Update: Apr 19, 2018
- 5/5, 56 likes
-
The system is, after a deeper look into in and working with the code, not as difficult as it seems...
But to be true, i needed days to check really out, how it works
The base is, it counts first the count of to be spawned items, based in an internal value, called "maxDefinitionsToSpawn".
This count will be uses to loop x times through a spawning function.
This function will always summarize all weights of a category together, for the default "LootSpawn.SupplyDrop" this will be atm a sum of "840".
secondly it generates a random value between 0 and the sum of the category, means from the sum "840".
It starts then a loop with all entries(category entries), every run the sum will be decreased by the weight of the actual entry. the first would be by default Lootspawn the category "100(Items.VeryRare)", second "200(Items.Rare)"....and so on...until the (every step) decreased sum is smaller then the random number, f.e. 826.
It calls then the next (sub)category, and does the same again, until it hits direct an item.
To understand this whole thing only from text is VERY hard, so i did comment the inbuilt game functions with some debug, on which i based the text
Code:> Sum: 840 | Random: 826 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >>> Hit for 826 >= 740 | go to: Items.VeryRare > Sum: 600 | Random: 589 | Deep: 2 | Cat: Items.VeryRare >> Sum - Weight of: 100(Items.VeryRare.Ammunition) = 500 >>> Hit for 589 >= 500 | go to: Items.VeryRare.Ammunition > Sum: 500 | Random: 41 | Deep: 3 | Cat: Items.VeryRare.Ammunition >> Sum - Weight of: 100(ammo.pistol.fire) = 400 >> Sum - Weight of: 100(ammo.pistol.hv) = 300 >> Sum - Weight of: 100(ammo.rifle.explosive) = 200 >> Sum - Weight of: 100(ammo.rifle.incendiary) = 100 >> Sum - Weight of: 100(ammo.rifle.hv) = 0 >>> Hit for 41 >= 0 | go to: ammo.rifle.hv >>>> Get Item: ammo_rifle_hv.item (ItemDefinition) > Sum: 840 | Random: 776 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >>> Hit for 776 >= 740 | go to: Items.VeryRare > Sum: 600 | Random: 136 | Deep: 2 | Cat: Items.VeryRare >> Sum - Weight of: 100(Items.VeryRare.Ammunition) = 500 >> Sum - Weight of: 100(Items.VeryRare.Construction) = 400 >> Sum - Weight of: 100(Items.VeryRare.Attire) = 300 >> Sum - Weight of: 100(Items.VeryRare.Items) = 200 >> Sum - Weight of: 100(Items.VeryRare.Tool) = 100 >>> Hit for 136 >= 100 | go to: Items.VeryRare.Tool > Sum: 300 | Random: 261 | Deep: 3 | Cat: Items.VeryRare.Tool >> Sum - Weight of: 100(explosive.timed) = 200 >>> Hit for 261 >= 200 | go to: explosive.timed >>>> Get Item: explosive.timed.item (ItemDefinition) > Sum: 840 | Random: 39 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >> Sum - Weight of: 200(Items.Rare) = 540 >> Sum - Weight of: 300(Items.Uncommon) = 240 >> Sum - Weight of: 100(Collection.Rifles) = 140 >> Sum - Weight of: 20(Mining Ore) = 120 >> Sum - Weight of: 40(Traps) = 80 >> Sum - Weight of: 30(HQMetal_Large) = 50 >> Sum - Weight of: 40(targeting_computer) = 10 >>> Hit for 39 >= 10 | go to: targeting_computer >>>> Get Item: targeting_computer.item (ItemDefinition) > Sum: 840 | Random: 790 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >>> Hit for 790 >= 740 | go to: Items.VeryRare > Sum: 600 | Random: 222 | Deep: 2 | Cat: Items.VeryRare >> Sum - Weight of: 100(Items.VeryRare.Ammunition) = 500 >> Sum - Weight of: 100(Items.VeryRare.Construction) = 400 >> Sum - Weight of: 100(Items.VeryRare.Attire) = 300 >> Sum - Weight of: 100(Items.VeryRare.Items) = 200 >>> Hit for 222 >= 200 | go to: Items.VeryRare.Items > Sum: 200 | Random: 147 | Deep: 3 | Cat: Items.VeryRare.Items >> Sum - Weight of: 100(jackolantern.angry) = 100 >>> Hit for 147 >= 100 | go to: jackolantern.angry > Sum: 840 | Random: 136 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >> Sum - Weight of: 200(Items.Rare) = 540 >> Sum - Weight of: 300(Items.Uncommon) = 240 >> Sum - Weight of: 100(Collection.Rifles) = 140 >> Sum - Weight of: 20(Mining Ore) = 120 >>> Hit for 136 >= 120 | go to: Mining Ore >>>> Get Item: mining.quarry.item (ItemDefinition) >>>> Get Item: surveycharge.item (ItemDefinition) > Sum: 840 | Random: 339 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >> Sum - Weight of: 200(Items.Rare) = 540 >> Sum - Weight of: 300(Items.Uncommon) = 240 >>> Hit for 339 >= 240 | go to: Items.Uncommon > Sum: 800 | Random: 480 | Deep: 2 | Cat: Items.Uncommon >> Sum - Weight of: 100(Items.Uncommon.Ammunition) = 700 >> Sum - Weight of: 100(Items.Uncommon.Construction) = 600 >> Sum - Weight of: 100(Items.Uncommon.Attire) = 500 >> Sum - Weight of: 100(Items.Uncommon.Items) = 400 >>> Hit for 480 >= 400 | go to: Items.Uncommon.Items > Sum: 1700 | Random: 1038 | Deep: 3 | Cat: Items.Uncommon.Items >> Sum - Weight of: 100(bed) = 1600 >> Sum - Weight of: 100(ceilinglight) = 1500 >> Sum - Weight of: 100(Lantern) = 1400 >> Sum - Weight of: 100(box.wooden.large) = 1300 >> Sum - Weight of: 100(box.repair.bench) = 1200 >> Sum - Weight of: 100(shelves) = 1100 >> Sum - Weight of: 100(sign.hanging) = 1000 >>> Hit for 1038 >= 1000 | go to: sign.hanging > Sum: 840 | Random: 241 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >> Sum - Weight of: 200(Items.Rare) = 540 >> Sum - Weight of: 300(Items.Uncommon) = 240 >>> Hit for 241 >= 240 | go to: Items.Uncommon > Sum: 800 | Random: 217 | Deep: 2 | Cat: Items.Uncommon >> Sum - Weight of: 100(Items.Uncommon.Ammunition) = 700 >> Sum - Weight of: 100(Items.Uncommon.Construction) = 600 >> Sum - Weight of: 100(Items.Uncommon.Attire) = 500 >> Sum - Weight of: 100(Items.Uncommon.Items) = 400 >> Sum - Weight of: 100(Items.Uncommon.Food) = 300 >> Sum - Weight of: 100(Items.Uncommon.Resources) = 200 >>> Hit for 217 >= 200 | go to: Items.Uncommon.Resources > Sum: 400 | Random: 45 | Deep: 3 | Cat: Items.Uncommon.Resources >> Sum - Weight of: 100(Cloth) = 300 >> Sum - Weight of: 100(lowgradefuel) = 200 >> Sum - Weight of: 100(gunpowder) = 100 >> Sum - Weight of: 100(leather) = 0 >>> Hit for 45 >= 0 | go to: leather > Sum: 840 | Random: 665 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >> Sum - Weight of: 200(Items.Rare) = 540 >>> Hit for 665 >= 540 | go to: Items.Rare > Sum: 1000 | Random: 622 | Deep: 2 | Cat: Items.Rare >> Sum - Weight of: 100(Items.Rare.Attire) = 900 >> Sum - Weight of: 100(Items.Rare.Ammunition) = 800 >> Sum - Weight of: 100(Items.Rare.Construction) = 700 >> Sum - Weight of: 100(Items.Rare.Items) = 600 >>> Hit for 622 >= 600 | go to: Items.Rare.Items > Sum: 900 | Random: 131 | Deep: 3 | Cat: Items.Rare.Items >> Sum - Weight of: 100(furnace.large) = 800 >> Sum - Weight of: 100(small.oil.refinery) = 700 >> Sum - Weight of: 100(research.table) = 600 >> Sum - Weight of: 100(sign.hanging.banner.large) = 500 >> Sum - Weight of: 100(sign.hanging.ornate) = 400 >> Sum - Weight of: 100(sign.pictureframe.xl) = 300 >> Sum - Weight of: 100(sign.pictureframe.xxl) = 200 >> Sum - Weight of: 100(sign.pole.banner.large) = 100 >>> Hit for 131 >= 100 | go to: sign.pole.banner.large > Sum: 840 | Random: 424 | Deep: 1 | Cat: LootSpawn.SupplyDrop >> Sum - Weight of: 100(Items.VeryRare) = 740 >> Sum - Weight of: 200(Items.Rare) = 540 >> Sum - Weight of: 300(Items.Uncommon) = 240 >>> Hit for 424 >= 240 | go to: Items.Uncommon > Sum: 800 | Random: 182 | Deep: 2 | Cat: Items.Uncommon >> Sum - Weight of: 100(Items.Uncommon.Ammunition) = 700 >> Sum - Weight of: 100(Items.Uncommon.Construction) = 600 >> Sum - Weight of: 100(Items.Uncommon.Attire) = 500 >> Sum - Weight of: 100(Items.Uncommon.Items) = 400 >> Sum - Weight of: 100(Items.Uncommon.Food) = 300 >> Sum - Weight of: 100(Items.Uncommon.Resources) = 200 >> Sum - Weight of: 100(Items.Uncommon.Tool) = 100 >>> Hit for 182 >= 100 | go to: Items.Uncommon.Tool > Sum: 400 | Random: 60 | Deep: 3 | Cat: Items.Uncommon.Tool >> Sum - Weight of: 100(surveycharge) = 300 >> Sum - Weight of: 100(Hatchet) = 200 >> Sum - Weight of: 100(hammer.salvaged) = 100 >> Sum - Weight of: 100(icepick.salvaged) = 0 >>> Hit for 60 >= 0 | go to: icepick.salvaged >>>> Get Item: icepick_salvaged.item (ItemDefinition) [FancyDrop] ---- (Custom) Loot Content ---- [FancyDrop] Name: HV 5.56 Rifle Ammo x 120 [FancyDrop] Name: Timed Explosive Charge x 3 [FancyDrop] Name: Targeting Computer x 1 [FancyDrop] Name: Mining Quarry x 1 [FancyDrop] Name: Survey Charge x 7 [FancyDrop] Name: Salvaged Icepick x 1 [FancyDrop] ---- Loot Content End ----
-
Did you ever implement the airdrop_arrow plugin into your plugin? I'm not sure if you ever were going to, but if not is there anyway to get an arrow implemented? The airdrop_arrow plugin I use isn't working anymore for myself for some reason, even though it says that it is. :<
Nvm. Found a solution with another plugin and someone updated the airdrop_arrow one that I didn't notice.Last edited by a moderator: Jul 18, 2016 -
So i decided to implement such thing only once i've found a solution which hits more my graphical standards -
Pre-update information to next major release 2.0.0
This will include a custom loot table option based on the game internals Lootspawn, known already through plugins like LootConfig.
The plugin will use a simplified version of such a Lootspawn entry. It will export the whole Lootspawn tables as a simplified version from supplydrop, to change this by your own.
The usage of this custom loot will produce the same weight system as the server itself does for all others loot spawns. This gives back maximum randomized and weighted loot.
Furthermore EVERY airdrop type will have its own configurable options. this will look then for every type similar like that:
(options are explained deeper once updated)
Code:"regular": { "crateAirResistance": 1.0, "cratesGap": 50, "despawnMinutes": 15, "includeStaticItemList": true, "includeStaticItemListName": "regular", "includeStaticItemListOnly": false, "maxCrates": 3, "maxItems": 12, "minCrates": 1, "minItems": 9, "planeSpeed": 60, "randomAmountGroupedItem": false, "randomAmountSingleItem": false, "useCustomLootTable": true }
Code:"regular": { "itemList": { "cctv.camera": { "max": 2, "min": 1 }, "targeting.computer": { "max": 2, "min": 1 } } }
The default export of the whole lootspawn from supplydrop will look by default like the attached file.
(If first renders the pure categories, and the second part will show the items as last part of such a category tree. To ease up later the editing, the level/stages for the categories are marked with a number to give a better overview. Simplified it would be enough, to delete or add items on the last parts)
Attached Files:
-
-
Hello everyone, do you know whats the name of timed explosive charge ?
Current one in fancy airdrop is survey_explosion.prefab
so for c4 will be ? --> timed_explosive_charge.prefab
nvm i got itLast edited by a moderator: Jul 25, 2016 -
I have read through the codes for FancyDrop plugin carefully and "false" the ones i did not want. But somehow when i call in a drop it says the cords. I dont know exactly where i could have missed this. I do not want the cords shown.
-
-
ty so much .. finaly got added lmg m249 to suplydrops !!!!
-
Great update but slightly confused to what i have to set to force fancydrop to use betterloot?
-
And then FandyDrop does'nt change anything on the loot
The latest update of BL did add this part of code BetterLoot for Rust - 2.6.3 | Oxide -
-
@Fujikura Fancy work man! Love it and thanks for the best airdrop plugin ever made
-
But now it has come it's goal some miles closer -
This was working great till i updated it to latest version, when i load it i get this message
[Oxide] 18:30 [Error] Failed to call hook 'OnLootEntity' on plugin 'FancyDrop v2.0.0' (NullReferenceException: Object reference not set to an instance of an object)
[Oxide] 18:30 [Debug] at Oxide.Plugins.FancyDrop.OnLootEntity (.BasePlayer player, .BaseEntity entity) [0x00000] in <filename unknown>:0 at Oxide.Plugins.FancyDrop.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 -
-
Its very annoying i have the cfgs changed to attached copy , but i get i crate with only default 6 slots for a supply signal, and not only that it tells players in chat that signal was thrown by "someone" and tells the coords, and then tells players in chat who is looting it ? previous version was great and had no problems with mass drops, supply drops or timed ones,
And if i "reload" FancyDrops through the console i get this setup where it goes back to minimum of 2 players and different times for drops
[RCON][85.236.96.34:31167] oxide.reload FancyDrop
[Oxide] 20:00 [Info] FancyDrop was compiled successfully in 1797ms
[Oxide] 20:00 [Info] Unloaded plugin FancyDrop v2.0.0 by Fujikura
[Oxide] 20:00 [Info] Loaded plugin FancyDrop v2.0.0 by Fujikura
[Oxide] 20:00 [Info] [FancyDrop] Loading configuration variables
[Oxide] 20:00 [Info] [FancyDrop] Initializing in T-'4' Ticks
[Oxide] 20:00 [Info] [FancyDrop] Map Highest Point: (134.7005m) | Plane flying height: (~269.4011m)
[Oxide] 20:00 [Info] [FancyDrop] Timed Airdrop activated with '2' players between '30' and '50' minutes
[Oxide] 20:00 [Info] [FancyDrop] Next timed Airdrop in 31 minutes
[Oxide] 20:00 [Info] [FancyDrop] Custom loot table loaded with '177' items
is there any console command i can use to re adjust these settings without stopping the server and editing/saving/save and restart server again ?Attached Files:
-
-
-
it says Loaded plugin FancyDrop v2.0.0 by Fujikura and that is the cfg that the plugin created (?) , if you have another one and can post a text file i will replace mine and see if it works, i removed the plugin twice and made sure there were no cfg files (even "searched" cfgs for it to make sure)
hope it does cos it replaced two non working ones and does everything you could want, -
Attached Files:
-