User avatar
LeeIzaZombie
Military Zombie
Military Zombie
Donator ($13.24)
Posts: 165
Joined: Tue Apr 07, 2015 9:16 am
Location: Ireland
x 9
Website
Skype

[Tutorial] Edit item spawns and chance of spawning! (Any map)

Fri Sep 04, 2015 12:02 pm

Hello Developers!

Today I'm going to show you how to edit the spawns from any map like PEI / Yukon as if you are editing the level from the Level Editor!
First off we'll be looping through 3 lists, Tables, Tiers and Items:
  • LevelItems.tables
  • LevelItems.tables.tiers
  • LevelItems.tables.tiers.table

Here's an example of listing all the item spawn information in a map:

Code: Select all

string stuff = "";
for (int i = 0; i < LevelItems.tables.Count; i++) //Military, Ranger etc..
{
              stuff += "[Table]: " + LevelItems.tables[i].name + System.Environment.NewLine;
              for (int j = 0; j < LevelItems.tables[i].tiers.Count; j++) //Mags, Guns etc..
              {
                        stuff += "\t [Tier]: " + LevelItems.tables[i].tiers[j].name + " [Chance] -> " + (LevelItems.tables[i].tiers[j].chance * 100) + "%" + System.Environment.NewLine;
                     for (int k = 0; k < LevelItems.tables[i].tiers[j].table.Count; k++)
                     {
                            string itemName = Assets.find(EAssetType.ITEM, LevelItems.tables[i].tiers[j].table[k].item).name; //Get name from item ID
                            stuff += "\t\t Item: (" + LevelItems.tables[i].tiers[j].table[k].item + ") " + itemName + System.Environment.NewLine;
                     }
              }
}


You should probably paste it in your IDE for a better view.

In PEI, our results will be:

Code: Select all

[Table]: Police
    [Tier]: Vests [Chance] -> 5.714278%
       Item: (10) Vest_Police
    [Tier]: Special [Chance] -> 11.57142%
       Item: (1006) Cobra_40
    [Tier]: Melee [Chance] -> 19.57142%
       Item: (1023) Baton
    [Tier]: Hats [Chance] -> 29.92061%
       Item: (225) Police_Cap
    [Tier]: Pants [Chance] -> 40.26982%
       Item: (224) Police_Bottom
    [Tier]: Shirts [Chance] -> 50.61904%
       Item: (223) Police_Top
    [Tier]: Ammo [Chance] -> 65.15872%
       Item: (44) Civilian_40
    [Tier]: Magazines [Chance] -> 80.47618%
       Item: (100) Cobra_20
    [Tier]: Guns [Chance] -> 100%
       Item: (99) Cobra
[Table]: Fire
    [Tier]: Shirts [Chance] -> 10.16667%
       Item: (233) Firefighter_Top
    [Tier]: Pants [Chance] -> 20.33334%
       Item: (234) Firefighter_Bottom
    [Tier]: Hats [Chance] -> 30.50001%
       Item: (241) Firefighter_Helmet
    [Tier]: Melee [Chance] -> 54.00001%
       Item: (104) Axe_Fire
    [Tier]: Flares [Chance] -> 100%
       Item: (255) Flare_Blue
       Item: (256) Flare_Green
       Item: (257) Flare_Orange
       Item: (258) Flare_Purple
       Item: (259) Flare_Red
       Item: (260) Flare_Yellow
[Table]: Military
    [Tier]: Magazines [Chance] -> 5.541014%
       Item: (6) Military_30
       Item: (1022) Avenger_13
    [Tier]: Ammo [Chance] -> 11.92858%
       Item: (43) Military_40
       Item: (73) Explosives
    [Tier]: Guns [Chance] -> 19.01589%
       Item: (363) Maplestrike
       Item: (1021) Avenger
    [Tier]: Vests [Chance] -> 26.60981%
       Item: (310) Military_Vest_Forest
    [Tier]: Hats [Chance] -> 34.37304%
       Item: (309) Military_Helmet_Forest
       Item: (433) Beret_Forest
    [Tier]: Shirts [Chance] -> 43.61774%
       Item: (307) Military_Top_Forest
    [Tier]: Pants [Chance] -> 52.86244%
       Item: (308) Military_Bottom_Forest
    [Tier]: Melee [Chance] -> 66.36113%
       Item: (121) Knife_Military
    [Tier]: Barricades [Chance] -> 82.95371%
       Item: (386) Barbedwire
       Item: (365) Sandbag
    [Tier]: Smokes [Chance] -> 100%
       Item: (261) Smoke_Black
       Item: (262) Smoke_Blue
       Item: (264) Smoke_Orange
       Item: (263) Smoke_Green
       Item: (265) Smoke_Purple
       Item: (266) Smoke_Red
       Item: (267) Smoke_White
       Item: (268) Smoke_Yellow
[Table]: Medic
    [Tier]: Clothes [Chance] -> 3.333333%
       Item: (311) Medic_Top
       Item: (312) Medic_Bottom
    [Tier]: Rare [Chance] -> 12.88889%
       Item: (387) Adrenaline
       Item: (395) Bloodbag
       Item: (15) Medkit
       Item: (388) Morphine
       Item: (269) Vaccine
    [Tier]: Average [Chance] -> 40.44445%
       Item: (389) Antibiotics
       Item: (394) Dressing
       Item: (390) Painkillers
       Item: (96) Splint
       Item: (403) Suturekit
    [Tier]: Common [Chance] -> 100%
       Item: (95) Bandage
       Item: (404) Syrup_Cough
       Item: (392) Tablets
       Item: (391) Vitamins
       Item: (66) Cloth
[Table]: Special
    [Tier]: Mods [Chance] -> 3.111111%
       Item: (1007) Adaptive_Chambering
       Item: (1008) Rangefinder
    [Tier]: Ghillie [Chance] -> 7.762348%
       Item: (235) Ghillie_Top
       Item: (236) Ghillie_Bottom
       Item: (237) Ghillie_Hood
       Item: (238) Ghillie_Vest
    [Tier]: Guns [Chance] -> 12.72311%
       Item: (18) Timberwolf
       Item: (488) Desert_Falcon
    [Tier]: Magazines [Chance] -> 18.15609%
       Item: (17) Military_100
       Item: (20) Timberwolf_6
       Item: (489) Desert_Falcon_7
    [Tier]: Sights [Chance] -> 29.58907%
       Item: (296) 16x_Scope
       Item: (21) 8x_Scope
       Item: (148) Red_Chevron_Scope
       Item: (22) Red_Cross_Scope
       Item: (146) Red_Dot_Sight
       Item: (147) Red_Halo_Sight
    [Tier]: Tacticals [Chance] -> 41.02205%
       Item: (151) Tactical_Laser
       Item: (152) Tactical_Light
    [Tier]: Barrels [Chance] -> 52.45503%
       Item: (149) Military_Barrel
       Item: (150) Military_Muzzle
       Item: (7) Military_Suppressor
    [Tier]: Grips [Chance] -> 63.88801%
       Item: (143) Bipod
       Item: (145) Horizontal_Grip
       Item: (8) Vertical_Grip
    [Tier]: Gear [Chance] -> 75.3448%
       Item: (334) Nightvision
       Item: (253) Alicepack
       Item: (81) Bag_MRE
    [Tier]: Grenades [Chance] -> 100%
       Item: (254) Grenade
[Table]: School
    [Tier]: Backpacks [Chance] -> 10.33333%
       Item: (9) Daypack_Red
       Item: (200) Daypack_Black
       Item: (201) Daypack_Blue
       Item: (202) Daypack_Green
       Item: (203) Daypack_Orange
       Item: (204) Daypack_Purple
       Item: (205) Daypack_White
       Item: (206) Daypack_Yellow
    [Tier]: Melee [Chance] -> 33.66667%
       Item: (106) Hockey
    [Tier]: Snacks [Chance] -> 100%
       Item: (84) Bar_Candy
       Item: (83) Bar_Chocolate
       Item: (92) Juice_Grape
       Item: (91) Juice_Apple
[Table]: Food
    [Tier]: Clothes [Chance] -> 3.333333%
       Item: (314) Grocer_Top
       Item: (315) Grocer_Bottom
    [Tier]: Bottled [Chance] -> 12.33333%
       Item: (94) Bottled_Coconut
       Item: (93) Bottled_Energy
       Item: (14) Bottled_Water
       Item: (462) Box_Milk
       Item: (463) Box_Orange
       Item: (472) Bottled_Cola
       Item: (473) Bottled_Soda
    [Tier]: Canned [Chance] -> 21.77778%
       Item: (88) Canned_Bacon
       Item: (13) Canned_Beans
       Item: (89) Canned_Beef
       Item: (87) Canned_Pasta
       Item: (90) Canned_Sardines
       Item: (78) Canned_Soup_Chicken
       Item: (77) Canned_Soup_Tomato
       Item: (79) Canned_Tuna
       Item: (469) Canned_Ham
    [Tier]: Bars [Chance] -> 45.88889%
       Item: (82) Bag_Chips
       Item: (84) Bar_Candy
       Item: (83) Bar_Chocolate
       Item: (86) Bar_Energy
       Item: (85) Bar_Granola
    [Tier]: Box [Chance] -> 69.99999%
       Item: (91) Juice_Apple
       Item: (92) Juice_Grape
       Item: (80) Canned_Cola
       Item: (465) Canned_Soda
    [Tier]: Organic [Chance] -> 99.99999%
       Item: (464) Cheese
       Item: (329) Carrot
       Item: (335) Corn
       Item: (338) Lettuce
       Item: (342) Potato
       Item: (340) Tomato
       Item: (344) Wheat
       Item: (460) Bread
       Item: (470) Eggs
[Table]: Gas
    [Tier]: Clothes [Chance] -> 7.777773%
       Item: (405) Mechanic_Top
       Item: (406) Mechanic_Bottom
    [Tier]: Tools [Chance] -> 28.33333%
       Item: (28) Gas
       Item: (76) Blowtorch
       Item: (277) Carjack
    [Tier]: Melee [Chance] -> 50.33334%
       Item: (276) Flashlight
    [Tier]: Flares [Chance] -> 100%
       Item: (255) Flare_Blue
       Item: (256) Flare_Green
       Item: (257) Flare_Orange
       Item: (258) Flare_Purple
       Item: (259) Flare_Red
       Item: (260) Flare_Yellow
[Table]: Construction
    [Tier]: Shirts [Chance] -> 3.333333%
       Item: (232) Construction_Top
    [Tier]: Hats [Chance] -> 7.177776%
       Item: (240) Construction_Helmet
    [Tier]: Pants [Chance] -> 11.28889%
       Item: (2) Jeans_Work
    [Tier]: Rare [Chance] -> 19.57778%
       Item: (68) Sheet_Metal
       Item: (70) Glue
       Item: (74) Bricks
       Item: (458) Generator
       Item: (459) Spotlight
    [Tier]: Melee [Chance] -> 31.86667%
       Item: (136) Sledgehammer
       Item: (141) Saw
       Item: (138) Hammer
       Item: (1031) Shovel
       Item: (1032) Crowbar
    [Tier]: Average [Chance] -> 57.26668%
       Item: (64) Rope
       Item: (65) Wire
       Item: (69) Tape
       Item: (72) Can
       Item: (285) Bar_Metal
    [Tier]: Common [Chance] -> 100%
       Item: (66) Cloth
       Item: (67) Scrap_Metal
       Item: (71) Nails
[Table]: Camp
    [Tier]: Barricades [Chance] -> 1.32619%
       Item: (362) Campfire
    [Tier]: Bedrolls [Chance] -> 2.719057%
       Item: (288) Bedroll_Black
       Item: (289) Bedroll_Blue
       Item: (290) Bedroll_Green
       Item: (291) Bedroll_Orange
       Item: (292) Bedroll_Purple
       Item: (293) Bedroll_Red
       Item: (294) Bedroll_White
       Item: (295) Bedroll_Yellow
    [Tier]: Pants [Chance] -> 7.585724%
       Item: (511) Fishing_Bottom
    [Tier]: Shirts [Chance] -> 12.80795%
       Item: (510) Fishing_Top
    [Tier]: Hats [Chance] -> 18.07461%
       Item: (509) Fishing_Hat
    [Tier]: Magazines [Chance] -> 25.00081%
       Item: (381) Shells_2
       Item: (103) Schofield_5
       Item: (111) Hawkhound_8
       Item: (485) Sportshot_10
    [Tier]: Guns [Chance] -> 32.60319%
       Item: (109) Hawkhound
       Item: (101) Schofield
       Item: (380) Masterkey
       Item: (484) Sportshot
    [Tier]: Ammo [Chance] -> 40.99606%
       Item: (381) Shells_2
    [Tier]: Food [Chance] -> 56.94447%
       Item: (464) Cheese
       Item: (329) Carrot
       Item: (335) Corn
       Item: (338) Lettuce
       Item: (342) Potato
       Item: (340) Tomato
       Item: (344) Wheat
       Item: (460) Bread
       Item: (470) Eggs
    [Tier]: Tools [Chance] -> 75.22623%
       Item: (337) Canteen
       Item: (333) Binoculars
       Item: (503) Rod_Fishing
    [Tier]: Melee [Chance] -> 100%
       Item: (16) Axe_Camp
       Item: (139) Knife_Swiss
       Item: (276) Flashlight
       Item: (141) Saw
       Item: (1033) Paddle
       Item: (1031) Shovel
[Table]: Prison
    [Tier]: Melee [Chance] -> 7.666665%
       Item: (140) Knife_Butterfly
    [Tier]: Pants [Chance] -> 53.33333%
       Item: (304) Prisoner_Bottom
    [Tier]: Shirts [Chance] -> 100%
       Item: (303) Prisoner_Top
[Table]: Research
    [Tier]: Research [Chance] -> 30%
       Item: (269) Vaccine
    [Tier]: Supply [Chance] -> 100%
       Item: (75) Chemicals
       Item: (391) Vitamins
       Item: (392) Tablets
[Table]: Chef
    [Tier]: Shirt [Chance] -> 1.5%
       Item: (230) Chef_Top
    [Tier]: Hat [Chance] -> 3.830494%
       Item: (239) Chef_Hat
    [Tier]: Pants [Chance] -> 6.49716%
       Item: (231) Chef_Bottom
    [Tier]: Melee [Chance] -> 19.93491%
       Item: (137) Knife_Butcher
       Item: (1030) Pan
    [Tier]: Food [Chance] -> 100%
       Item: (14) Bottled_Water
       Item: (82) Bag_Chips
       Item: (91) Juice_Apple
       Item: (92) Juice_Grape
       Item: (84) Bar_Candy
       Item: (85) Bar_Granola
       Item: (83) Bar_Chocolate
       Item: (464) Cheese
       Item: (329) Carrot
       Item: (335) Corn
       Item: (338) Lettuce
       Item: (342) Potato
       Item: (340) Tomato
       Item: (344) Wheat
       Item: (460) Bread
       Item: (470) Eggs
[Table]: Botanist
    [Tier]: Barricades [Chance] -> 5.333333%
       Item: (331) Planter
    [Tier]: Tools [Chance] -> 22.66666%
       Item: (332) Fertilizer
    [Tier]: Seeds [Chance] -> 100%
       Item: (330) Seed_Carrot
       Item: (336) Seed_Corn
       Item: (339) Seed_Lettuce
       Item: (341) Seed_Tomato
       Item: (343) Seed_Potato
       Item: (345) Seed_Wheat
[Table]: Farm
    [Tier]: Crossbows [Chance] -> 1.998905%
       Item: (346) Crossbow
    [Tier]: Bows [Chance] -> 5.486722%
       Item: (357) Bow_Compound
    [Tier]: Tools [Chance] -> 9.54912%
       Item: (490) Chainsaw
       Item: (332) Fertilizer
    [Tier]: Barricades [Chance] -> 14.00838%
       Item: (331) Planter
    [Tier]: Magazines [Chance] -> 19.25489%
       Item: (111) Hawkhound_8
       Item: (103) Schofield_5
       Item: (381) Shells_2
       Item: (485) Sportshot_10
    [Tier]: Guns [Chance] -> 25.8041%
       Item: (109) Hawkhound
       Item: (101) Schofield
       Item: (380) Masterkey
       Item: (484) Sportshot
    [Tier]: Ammo [Chance] -> 33.10143%
       Item: (44) Civilian_40
       Item: (381) Shells_2
    [Tier]: Melee [Chance] -> 41.10144%
       Item: (1034) Pitchfork
       Item: (1033) Paddle
       Item: (1031) Shovel
    [Tier]: Arrows [Chance] -> 49.1926%
       Item: (347) Arrow_1
    [Tier]: Seeds [Chance] -> 65.80001%
       Item: (330) Seed_Carrot
       Item: (336) Seed_Corn
       Item: (339) Seed_Lettuce
       Item: (341) Seed_Tomato
       Item: (343) Seed_Potato
       Item: (345) Seed_Wheat
    [Tier]: Clothes [Chance] -> 100%
       Item: (242) Farmer_Top
       Item: (243) Farmer_Bottom
       Item: (244) Farmer_Hat
[Table]: Militia
    [Tier]: Special [Chance] -> 1.833333%
       Item: (126) Nykorev
       Item: (127) Nykorev_100
       Item: (519) Launcher_Rocket
       Item: (520) Rocket_1
       Item: (1000) Matamorez
       Item: (1003) Matamorez_10
       Item: (1005) Matamorez_25
    [Tier]: Ammo [Chance] -> 8.11667%
       Item: (119) Ranger_40
    [Tier]: Magazines [Chance] -> 14.43573%
       Item: (123) Ranger_35
       Item: (130) Snayperskya_7
       Item: (125) Ranger_75
       Item: (1040) Kryzkarek_12
    [Tier]: Barrels [Chance] -> 21.22541%
       Item: (144) Ranger_Suppressor
    [Tier]: Sights [Chance] -> 29.80874%
       Item: (153) 7x_Scope
       Item: (1004) Red_Kobra_Sight
    [Tier]: Guns [Chance] -> 40.77063%
       Item: (122) Zubeknakov
       Item: (129) Snayperskya
       Item: (1039) Kryzkarek
    [Tier]: Masks [Chance] -> 53.40316%
       Item: (11) Bandana_Red
       Item: (185) Bandana_Black
       Item: (186) Bandana_Blue
       Item: (187) Bandana_Green
       Item: (188) Bandana_Orange
       Item: (189) Bandana_Purple
       Item: (190) Bandana_White
       Item: (191) Bandana_Yellow
    [Tier]: Hats [Chance] -> 67.14677%
       Item: (434) Balaclava_Black
       Item: (435) Balaclava_Blue
       Item: (436) Balaclava_Green
       Item: (437) Balaclava_Orange
       Item: (438) Balaclava_Purple
       Item: (439) Balaclava_Red
       Item: (440) Balaclava_White
       Item: (441) Balaclava_Yellow
    [Tier]: Melee [Chance] -> 100%
       Item: (140) Knife_Butterfly
       Item: (1035) Machete
       Item: (1036) Katana
[Table]: Guns
    [Tier]: Ammo [Chance] -> 16.00001%
       Item: (44) Civilian_40
    [Tier]: Guns [Chance] -> 34.00001%
       Item: (97) Colt
       Item: (107) Ace
       Item: (484) Sportshot
    [Tier]: Magazines [Chance] -> 100%
       Item: (98) Colt_7
       Item: (108) Ace_6
       Item: (485) Sportshot_10
[Table]: RCMP
    [Tier]: Barricades [Chance] -> 17.61524%
       Item: (386) Barbedwire
       Item: (284) Door_Jail
       Item: (287) Fortification_Bars
    [Tier]: Magazines [Chance] -> 36.54158%
       Item: (113) Shells_8
    [Tier]: Guns [Chance] -> 55.46792%
       Item: (112) Bluntforce
    [Tier]: Clothes [Chance] -> 77.60697%
       Item: (306) RCMP_Top
       Item: (305) RCMP_Bottom
       Item: (313) RCMP_Hat
    [Tier]: Tools [Chance] -> 100%
       Item: (333) Binoculars
[Table]: Kitchen
    [Tier]: Melee [Chance] -> 9.333333%
       Item: (120) Knife_Kitchen
    [Tier]: Food [Chance] -> 100%
       Item: (14) Bottled_Water
       Item: (91) Juice_Apple
       Item: (92) Juice_Grape
       Item: (82) Bag_Chips
       Item: (84) Bar_Candy
       Item: (85) Bar_Granola
       Item: (83) Bar_Chocolate
       Item: (464) Cheese
       Item: (329) Carrot
       Item: (335) Corn
       Item: (338) Lettuce
       Item: (342) Potato
       Item: (340) Tomato
       Item: (344) Wheat
       Item: (460) Bread
       Item: (470) Eggs
[Table]: Alien
    [Tier]: Guns [Chance] -> 10.66666%
       Item: (300) Shadowstalker
    [Tier]: Magazines [Chance] -> 100%
       Item: (301) Rail_1
[Table]: Beach
    [Tier]: Average [Chance] -> 27.66666%
       Item: (80) Canned_Cola
       Item: (465) Canned_Soda
       Item: (473) Bottled_Soda
       Item: (472) Bottled_Cola
    [Tier]: Common [Chance] -> 90.33334%
       Item: (91) Juice_Apple
       Item: (92) Juice_Grape
[Table]: Cloth
    [Tier]: Shirts [Chance] -> 2.486791%
       Item: (211) Plaid_Shirt
       Item: (421) Suit_Top
    [Tier]: Travelpack [Chance] -> 5.153457%
       Item: (245) Travelpack_Black
       Item: (246) Travelpack_Blue
       Item: (247) Travelpack_Green
       Item: (248) Travelpack_Orange
       Item: (249) Travelpack_Purple
       Item: (250) Travelpack_Red
       Item: (251) Travelpack_White
       Item: (252) Travelpack_Yellow
    [Tier]: Toque [Chance] -> 8.281663%
       Item: (192) Toque_Black
       Item: (193) Toque_Blue
       Item: (194) Toque_Green
       Item: (195) Toque_Orange
       Item: (196) Toque_Purple
       Item: (197) Toque_Red
       Item: (198) Toque_White
       Item: (199) Toque_Yellow
    [Tier]: Cap [Chance] -> 11.79876%
       Item: (425) Cap_Black
       Item: (426) Cap_Blue
       Item: (427) Cap_Green
       Item: (428) Cap_Orange
       Item: (429) Cap_Purple
       Item: (430) Cap_Red
       Item: (431) Cap_White
       Item: (432) Cap_Yellow
    [Tier]: Hoodie [Chance] -> 16.8948%
       Item: (3) Hoodie_Orange
       Item: (157) Hoodie_Purple
       Item: (161) Hoodie_Green
       Item: (165) Hoodie_Red
       Item: (169) Hoodie_Yellow
       Item: (173) Hoodie_Blue
       Item: (177) Hoodie_White
       Item: (181) Hoodie_Black
    [Tier]: Daypack [Chance] -> 21.99084%
       Item: (9) Daypack_Red
       Item: (200) Daypack_Black
       Item: (201) Daypack_Blue
       Item: (202) Daypack_Green
       Item: (203) Daypack_Orange
       Item: (204) Daypack_Purple
       Item: (205) Daypack_White
       Item: (206) Daypack_Yellow
    [Tier]: Poncho [Chance] -> 27.47764%
       Item: (410) Poncho_Black
       Item: (411) Poncho_Blue
       Item: (412) Poncho_Green
       Item: (413) Poncho_Orange
       Item: (414) Poncho_Purple
       Item: (415) Poncho_Red
       Item: (416) Poncho_White
       Item: (417) Poncho_Yellow
    [Tier]: Sweatervest [Chance] -> 35.55702%
       Item: (215) Sweatervest_Black
       Item: (216) Sweatervest_Blue
       Item: (217) Sweatervest_Green
       Item: (218) Sweatervest_Orange
       Item: (219) Sweatervest_Purple
       Item: (220) Sweatervest_Red
       Item: (221) Sweatervest_White
       Item: (222) Sweatervest_Yellow
    [Tier]: Pants [Chance] -> 44.20861%
       Item: (2) Jeans_Work
       Item: (207) Jeans_Outfit
       Item: (208) Jeans_Cowboy
       Item: (209) Cargo_Pants
       Item: (212) Khaki_Pants
       Item: (213) Corduroy_Pants
       Item: (214) Trouser_Pants
       Item: (226) Khaki_Shorts
       Item: (227) Cargo_Shorts
       Item: (228) Corduroy_Shorts
       Item: (229) Trouser_Shorts
       Item: (422) Suit_Bottom
    [Tier]: Parka [Chance] -> 55.038%
       Item: (156) Parka_Orange
       Item: (160) Parka_Purple
       Item: (162) Parka_Green
       Item: (166) Parka_Red
       Item: (170) Parka_Yellow
       Item: (174) Parka_Blue
       Item: (178) Parka_White
       Item: (182) Parka_Black
    [Tier]: Tee [Chance] -> 65.86739%
       Item: (155) Tee_Orange
       Item: (159) Tee_Purple
       Item: (164) Tee_Green
       Item: (168) Tee_Red
       Item: (172) Tee_Yellow
       Item: (176) Tee_Blue
       Item: (180) Tee_White
       Item: (184) Tee_Black
    [Tier]: Shirt [Chance] -> 76.69678%
       Item: (154) Shirt_Orange
       Item: (158) Shirt_Purple
       Item: (163) Shirt_Green
       Item: (167) Shirt_Red
       Item: (171) Shirt_Yellow
       Item: (175) Shirt_Blue
       Item: (179) Shirt_White
       Item: (183) Shirt_Black
    [Tier]: Hats [Chance] -> 88.40394%
       Item: (424) Fedora
       Item: (27) Tophat
[Table]: Post
    [Tier]: Common [Chance] -> 100%
       Item: (70) Glue
       Item: (64) Rope
       Item: (69) Tape
[Table]: Civilian
    [Tier]: Magazines [Chance] -> 4.000001%
       Item: (98) Colt_7
       Item: (108) Ace_6
    [Tier]: Guns [Chance] -> 9.666667%
       Item: (97) Colt
       Item: (107) Ace
    [Tier]: Tools [Chance] -> 20.83333%
       Item: (333) Binoculars
    [Tier]: Supplies [Chance] -> 56.05556%
       Item: (70) Glue
       Item: (64) Rope
       Item: (69) Tape
    [Tier]: Melee [Chance] -> 100%
       Item: (105) Bat
       Item: (276) Flashlight
       Item: (135) Golf
       Item: (138) Hammer
       Item: (106) Hockey
       Item: (142) Rake


Now let's start changing some spawns!
Let's say we want to add the new guns to the Mega zombie item drop (and areas that mega zombie loot may spawn ie: Conf bridge)

We'll be looking through the results we found to see what we need to edit, in this case we will be editing:
[Table]: Special -> [Tier]: Guns [Chance] -> 12.72311%

This spawn will only spawn two guns; Timberwolf and Desert_Falcon

So here a code example of changing these spawns:

Code: Select all

private void SetLoot()
        {
            for (int i = 0; i < LevelItems.tables.Count; i++)
            {
                if (LevelItems.tables[i].name == "Special")
                for (int j = 0; j < LevelItems.tables[i].tiers.Count; j++) //Mags, Guns etc..
                {
                    if (LevelItems.tables[i].tiers[j].name == "Guns")
                    {
                        LevelItems.tables[i].tiers[j].table.Clear(); //Remove Current Items.
                        LevelItems.tables[i].tiers[j].chance = (float)0.5; //50% chance of spawning/dropping!

                        LevelItems.tables[i].tiers[j].addItem(297); //Grizzly
                        LevelItems.tables[i].tiers[j].addItem(18); //Timberwolf
                        LevelItems.tables[i].tiers[j].addItem(488); //Desert Falcon
                        LevelItems.tables[i].tiers[j].addItem(132); //Dragonfang
                        LevelItems.tables[i].tiers[j].addItem(4); //Eaglefire
                        LevelItems.tables[i].tiers[j].addItem(1037); //Heartbreaker
                        LevelItems.tables[i].tiers[j].addItem(116); //Honeybadger
                        LevelItems.tables[i].tiers[j].addItem(363); //Maplestrike
                        LevelItems.tables[i].tiers[j].addItem(1024); //Peacemaker
                        LevelItems.tables[i].tiers[j].addItem(1027); //Viper
                    }
                }
            }
        }


This would be a way to add custom workshop guns to the stock maps! ;)

I hope you liked the tutorial!
Kind Regards - LeeIzaZombie
0 x
Image

If you think I was helpful then give me a positive rating! :D (Click the heart)

Rambo_909090
Civil Servant Zombie
Civil Servant Zombie
Posts: 2
Joined: Tue Sep 08, 2015 5:32 am

Re: [Tutorial] Edit item spawns and chance of spawning! (Any map)

Tue Sep 08, 2015 5:34 am

this is exactly what ive been looking for however if i change the spawns will all the players have to re download the map to get into my server?
0 x

User avatar
LeeIzaZombie
Military Zombie
Military Zombie
Donator ($13.24)
Posts: 165
Joined: Tue Apr 07, 2015 9:16 am
Location: Ireland
x 9
Website
Skype

Re: [Tutorial] Edit item spawns and chance of spawning! (Any map)

Tue Sep 08, 2015 1:02 pm

Nope, but however the spawns will be set as Nelson or custom map developer has them when the server starts, so only zombie loot drops and further loot re-spawns will take effect on your changes.
0 x
Image

If you think I was helpful then give me a positive rating! :D (Click the heart)

Rambo_909090
Civil Servant Zombie
Civil Servant Zombie
Posts: 2
Joined: Tue Sep 08, 2015 5:32 am

Re: [Tutorial] Edit item spawns and chance of spawning! (Any map)

Tue Sep 08, 2015 7:29 pm

Thank you for responding however i am still having trouble i guess your tutorial is still a little complex for me i don't have much of a programming background. is there any way you could dumb it down or direct me to a tutorial that may be easier to understand.
0 x

Return to “Development Tutorials & Guides”

Who is online

Users browsing this forum: No registered users and 1 guest

Advertisement