diff --git a/data/prop_spawner/models/Fencing & Walls/barriers.txt b/data/prop_spawner/models/Fencing & Walls/barriers.txt new file mode 100644 index 0000000..987cee7 --- /dev/null +++ b/data/prop_spawner/models/Fencing & Walls/barriers.txt @@ -0,0 +1,28 @@ +Barriers +models/props_fortifications/barricade001_128_reference.mdl Metal Mesh Barricade (128u) +models/props_fortifications/barricade001_64_reference.mdl Metal Mesh Barricade (64u) +models/props_fortifications/barricade_gate001_64_reference.mdl Metal Mesh Barricade Gate (64u) +models/props_fortifications/barricade_razorwire001_128_reference.mdl Barricade Razorwire (128u) (no collision) +models/props_fortifications/concrete_barrier01.mdl Concrete wall +models/props_fortifications/concrete_barrier001_96_reference.mdl Concrete crash barrier (96u) +models/props_fortifications/concrete_barrier001_128_reference.mdl Concrete crash barrier (128u) +models/props_fortifications/concrete_post001_48.mdl Concrete Post (48u) +models/props_fortifications/concrete_wall001_96_reference.mdl Concrete wall (96u) +models/props_fortifications/concrete_block001_128_reference.mdl Concrete block (128u) +models/props_fortifications/police_barrier001_128_reference.mdl Police Barrier Notice +models/props_fortifications/fortification_indoor_01.mdl Luggage Push Fort +models/props_fortifications/sandbags_line2.mdl Building sandbags 6 layers +models/props_fortifications/sandbags_corner3.mdl Building sandbags 4 layers curved +models/props_fortifications/sandbags_corner2.mdl Building sandbags 6 layers curved +models/props_fortifications/traffic_barrier001.mdl Traffic Barrier +models/props_urban/railroad_gate001.mdl Railroad Crossing Light +models/props_urban/railroad_gate_arm001.mdl Railroad Crossing Arm +models/props_downtown/bollards_ornate.mdl Ornate metal bollard +models/props_street/bollards_512.mdl Bollard (512u) +models/props_unique/wooden_barricade.mdl Wooden barricade (no damage) +models/props_unique/wooden_barricade_break1.mdl wooden barricade (low damage) +models/props_unique/wooden_barricade_break2.mdl Wooden barricade (medium damage) +models/props_unique/wooden_barricade_break3.mdl wooden barricade (high damage) +models/props_c17/concrete_barrier001a.mdl Concrete crash barrier-higher +models/props_exteriors/guardrail128a.mdl road guardrail (128u) +models/props_buildables/wall_barricade_helper.mdl Wall Barricade Helper diff --git a/data/prop_spawner/models/Fencing & Walls/fences.txt b/data/prop_spawner/models/Fencing & Walls/fences.txt new file mode 100644 index 0000000..c2d52b4 --- /dev/null +++ b/data/prop_spawner/models/Fencing & Walls/fences.txt @@ -0,0 +1,79 @@ +Fences & Gates +models/lighthouse/props/wooden_gate.mdl Valerie's fancy wooden gate +models/props_exteriors/fence002.mdl wooden fence (very long) +models/props_exteriors/fence002_end.mdl wooden fence end +models/props_urban/fence_gate001_256.mdl urban fence gate (easy to use) +models/props_urban/fence_cover001_64.mdl shelter Fence (64u) +models/props_urban/fence_cover001_128.mdl shelter fence (128u) +models/props_urban/fence_cover001_256.mdl shelter fence (256u) +models/props_fortifications/barricade_gate001_64_reference.mdl roadblock-single layer without handle (easy to use) +models/props_fortifications/barricade001_64_reference.mdl roadblock-single layer +models/props_fortifications/barricade001_128_reference.mdl roadblock-double layer +models/props_unique/airport/temp_barricade.mdl roadblock-airport +models/props_wasteland/exterior_fence002b.mdl Barbed wire fence - 1 wide skinny +models/props_wasteland/exterior_fence002c.mdl Barbed wire fence - 1 wide +models/props_wasteland/exterior_fence002d.mdl Barbed wire fence - 2 wide +models/props_wasteland/exterior_fence002e.mdl Barbed wire fence - 4 wide +models/props_street/police_barricade.mdl Police Barricade - 1 wide +models/props_street/police_barricade2.mdl Police barricade - 3 wide +models/props_street/police_barricade3.mdl Police Barricade - 6 wide +models/props_street/police_barricade_368in.mdl Police Barricade - 8 wide +models/props_street/police_barricade_496in.mdl Police Barricade - 10 wide +models/props_street/police_barricade4.mdl Iron Frame Barricade - 12 wide +models/lostcoast/props_wasteland/gate01a.mdl Iron fence gate a +models/lostcoast/props_wasteland/gate01b.mdl iron fence gate b +models/props_mill/elevator01_cage.mdl Mill Elevator-c4m2 +models/props_mill/elevator01_cagedoor02.mdl Mill Elevator telescopic door-c4m2 (No Collision) +models/props_mill/elevator01_cagedoor.mdl Mill Elevator Cage door +models/props_mill/elevator01_framework.mdl Elevator shaft framework +models/props_mill/freightelevatorbutton01.mdl Mill Freight Elevator Button 1 +models/props_mill/freightelevatorbutton02.mdl Mill Freight Elevator Button 2 +models/props_street/barricade_door_01.mdl Military Agency Door-c9m1 +models/props_urban/fence_768_collapsed.mdl Fence with covered shelter-c4m5 +models/props_urban/gate_wall003_32.mdl Screening fence wall (32u) +models/props_urban/gate_wall003_64.mdl Screening fence wall (64u) +models/props_urban/gate_wall003_128.mdl Shelter fence wall (128u) +models/props_urban/gate_wall_gate003_64.mdl Wall Gate 3 (64u) +models/props_urban/wood_fence001_64.mdl Urban wooden fence a (64u) +models/props_urban/wood_fence001_128.mdl Urban wooden fence a (128u) +models/props_urban/wood_fence001_256.mdl Urban wooden fence a (256u) +models/props_urban/wood_fence002_64.mdl Urban wooden fence b (64u) +models/props_urban/wood_fence002_128.mdl Urban wooden fence b (128u) +models/props_urban/wood_fence002_256.mdl Urban wooden fence b (256u) +models/props_urban/wood_post001.mdl Urban Wood Post 1 +models/props_urban/wood_post002.mdl Urban Wood Post 2 +models/props_cemetery/cemetery_gate.mdl Cemetary Gate Barbed Wire with Spikes +models/props_cemetery/cemetery_gate_32.mdl Cemetary Gate Barbed Wire with Spikes (32u) +models/props_cemetery/cemetery_gate_64.mdl Cemetary Gate Barbed Wire with Spikes (64u) +models/props_cemetery/cemetery_gate_128.mdl Cemetary Gate Barbed Wire with Spikes (128u) +models/props_exteriors/roadsidefence_64.mdl Road fence-single layer (64u) +models/props_exteriors/roadsidefence_512.mdl road fence-eight layers (512u) +models/props_exteriors/fence_plastic001.mdl Plastic Fence +models/props_downtown/garden_gate.mdl Downtown Garden Gate +models/props/de_inferno/wood_fence.mdl De Inferno Wood Fence +models/props/de_inferno/wood_fence_end.mdl De Inferno Wood Fence End +models/props_urban/fence001_128.mdl Urban Chain Link Fence1 (128u) +models/props_urban/fence001_256.mdl Urban Chain Link Fence1 (256u) +models/props_urban/fence001_64.mdl Urban Chain Link Fence1 (64u) +models/props_urban/fence002_128.mdl Urban Chain Link Fence2 (128u) +models/props_urban/fence002_256.mdl Urban Chain Link Fence2 (256u) +models/props_urban/fence002_64.mdl Urban Chain Link Fence2 (64u) +models/props_urban/fence003_128.mdl Urban Chain Link Fence3 (128u) +models/props_urban/fence003_64.mdl Urban Chain Link Fence3 (64u) +models/props_urban/fence004_128.mdl Urban Chain Link Fence Frame (128u) +models/props_urban/fence004_256.mdl Urban Chain Link Fence Frame (256u) +models/props_urban/fence004_64.mdl Urban Fence Chain Link Frame (64u) +models/props_urban/fence_barbwire001_128.mdl Urban Barbwire Fence (128u) +models/props_urban/fence_barbwire001_256.mdl Urban Barbwire Fence (256u) +models/props_urban/fence_barbwire001_64.mdl Urban Barbwire Fence (64u) +models/props_urban/fence_post_barbwire001.mdl Urban Barbwire Fence Post +models/props_urban/fence_gate001_128.mdl Urban Fence Gate1 (128u) +models/props_urban/fence_gate001_256.mdl Urban Fence Gate1 (256u) +models/props_urban/fence_gate002_256.mdl Urban Fence Gate2 (256u) +models/props_urban/fence_gate003.mdl Urban Fence Gate3 (Small) +models/props_urban/fence_gate_post001.mdl Urban Chain Link Fence Gate Post 1 +models/props_urban/fence_gate_post003.mdl Urban Chain Link Fence Gate Post 2 +models/props_urban/fence_post001.mdl Urban Chain Link Fence Post 1 +models/props_urban/fence_post002.mdl Urban Chain Link Fence Post 2 +models/props_urban/fence_post003.mdl Urban Chain Link Fence Post 3 +models/props_urban/gate_column001_32.mdl Urban Gate Column diff --git a/data/prop_spawner/models/Fencing & Walls/walls.txt b/data/prop_spawner/models/Fencing & Walls/walls.txt new file mode 100644 index 0000000..508a5b5 --- /dev/null +++ b/data/prop_spawner/models/Fencing & Walls/walls.txt @@ -0,0 +1,28 @@ +Walls +models/props_update/brick_128.mdl brick wall/floor (128u) +models/props_update/brick_256.mdl brick wall/floor (256u) +models/props_update/concrete_128.mdl cement wall/floor (128u) +models/props_update/concrete_256.mdl cement wall/floor (256u) +models/props_update/plywood_128.mdl wooden wall/floor (128u) +models/props_update/plywood_256.mdl wooden wall/floor (256u) +models/props_update/whitebrick_128.mdl white brick wall (128u) +models/props_update/whitebrick_256.mdl white brick wall (256u) +models/props_update/wood_128.mdl wooden walls (128u) +models/props_update/wood_256.mdl wooden walls (256u) +models/props_urban/gate_wall001_64.mdl Urban Wall (64u) +models/props_urban/gate_wall001_128.mdl Urban Wall (128u) +models/props_urban/gate_wall001_256.mdl Urban Wall (256u) +models/props_urban/gate_wall002_128.mdl urban fence wall (128u) +models/props_unique/zombiebreakwallexteriorairport01_main.mdl Wallpaper - Airport +models/props_unique/zombiebreakwallexteriorairportoffices01_main.mdl Wallpaper - Airport Office +models/props_unique/zombiebreakwallhospitalexterior01_main.mdl Wallpaper - Hospital +models/lighthouse/props/wall_144_324.mdl Wall-144X(324u) (No Side) +models/props_interiors/constructionwalls02checkpoint.mdl steel building framing (with doorway) +models/props_interiors/constructionwalls03.mdl steel building framing +models/props_interiors/constructionwalls04_damage01.mdl Extra-long building steel column +models/props_cemetery/crypts_wall.mdl Thickened stone wall-Cemetery Exposed Brick +models/props_mill/locker_roof_collapsed01.mdl Mill Locker Roof Collapsed (no side) +models/props_mill/millwall_01.mdl Mill wall 1 (no side) +models/props_mill/millwall_02.mdl Mill wall 2 (no side) +models/props_mill/millwall_03.mdl Mill wall 3 (no side) +models/props_mill/column_01.mdl Mill Rebar Column diff --git a/data/randomizer/c10m1_caves.json b/data/randomizer/c10m1_caves.json index 8b5b434..0ae5f35 100644 --- a/data/randomizer/c10m1_caves.json +++ b/data/randomizer/c10m1_caves.json @@ -595,5 +595,67 @@ ] } ] + }, + "truck-bridge-gap": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer_wrecked.mdl", + "origin": [ + -12307.5810546875, + -11925.724609375, + -349.92706298828125 + ], + "angles": [ + 4.0999965667724609, + 72.799995422363281, + -2.0 + ] + } + ] + } + ] + }, + "catwalk-pipes": { + "chance": 0.5, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_mill/pipeset08d_256_001a.mdl", + "origin": [ + -12992.806640625, + -5664.62939453125, + -266.845703125 + ], + "angles": [ + 0.0, + 0.0, + 270.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_mill/pipeset08d_256_001a.mdl", + "origin": [ + -13243.6201171875, + -5662.48095703125, + -267.79513549804688 + ], + "angles": [ + 0.0, + 0.0, + 270.0 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/data/randomizer/c10m2_drainage.json b/data/randomizer/c10m2_drainage.json index f58cf14..b63eb50 100644 --- a/data/randomizer/c10m2_drainage.json +++ b/data/randomizer/c10m2_drainage.json @@ -524,6 +524,578 @@ ] } ] + }, + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + -7604.6962890625, + -5517.0537109375, + -63.71875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + -7600.89892578125, + -5628.1220703125, + -63.71875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + -7598.435546875, + -5730.88330078125, + -63.718753814697266 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + -7599.41845703125, + -5829.40625, + -63.718753814697266 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + -7599.73095703125, + -5930.41748046875, + -63.718746185302734 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_exteriors/roadsidefence_64.mdl", + "origin": [ + -7670.9248046875, + -5441.72509765625, + -96.096488952636719 + ], + "angles": [ + 0.0, + 90.0, + -30.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_exteriors/roadsidefence_64.mdl", + "origin": [ + -7715.326171875, + -5440.0615234375, + -125.46791076660156 + ], + "angles": [ + 0.0, + 90.0, + -30.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_interiors/sheetrock_leaning.mdl", + "origin": [ + -7834.50634765625, + -5506.349609375, + -247.73503112792969 + ], + "angles": [ + 0.0, + -270.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_exteriors/roadsidefence_64.mdl", + "origin": [ + -7768.7626953125, + -5440.03125, + -158.68734741210938 + ], + "angles": [ + 0.0, + 90.0, + -30.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_exteriors/roadsidefence_64.mdl", + "origin": [ + -7824.25048828125, + -5441.51611328125, + -195.01101684570312 + ], + "angles": [ + 0.0, + 90.0, + -30.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_equipment/metalladder002.mdl", + "origin": [ + -8446.7109375, + -6000.96875, + -179.07974243164062 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/cs_assault/forklift.mdl", + "origin": [ + -8446.1474609375, + -5954.8544921875, + -321.01327514648438 + ], + "angles": [ + 0.0, + -90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/warehouse_shelf001.mdl", + "origin": [ + -8764.8349609375, + -6118.96630859375, + -61.846946716308594 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/warehouse_shelf003.mdl", + "origin": [ + -8538.37109375, + -6279.68115234375, + -63.222255706787109 + ], + "angles": [ + 0.0, + -90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_interiors/sheetrock_leaning.mdl", + "origin": [ + -7712.74853515625, + -6103.77587890625, + -63.735023498535156 + ], + "angles": [ + 0.0, + -165.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/cs_militia/shelves_wood.mdl", + "origin": [ + -7655.509765625, + -6076.41162109375, + -61.889106750488281 + ], + "angles": [ + 0.0, + 45.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/warehouse_shelf002.mdl", + "origin": [ + -7701.6396484375, + -6118.47412109375, + -62.106662750244141 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/train_box_open.mdl", + "origin": [ + -7822.83056640625, + -6486.45556640625, + -61.381694793701172 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/train_enginecar.mdl", + "origin": [ + -7410.93994140625, + -6787.6025390625, + -61.410385131835938 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/train_flatcar.mdl", + "origin": [ + -8124.68115234375, + -6636.7177734375, + -62.520648956298828 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/train_box.mdl", + "origin": [ + -8475.91015625, + -6484.85595703125, + -62.520648956298828 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/metal_plate001.mdl", + "origin": [ + -7953.88037109375, + -6027.1240234375, + -50.131851196289062 + ], + "angles": [ + -15.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/metal_plate001.mdl", + "origin": [ + -7959.54736328125, + -5806.42041015625, + -99.561187744140625 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/plywood_leaning.mdl", + "origin": [ + -7823.16748046875, + -5862.0478515625, + -246.55105590820312 + ], + "angles": [ + 15.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/pallet_barrels_water01_docks.mdl", + "origin": [ + -8305.1142578125, + -5699.38525390625, + -319.90985107421875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "env_physics_blocker", + "origin": [ + -7645.275390625, + -5453.0224609375, + -21.96875 + ], + "scale": [ + 10.0, + 15.0, + 100.0 + ] + }, + { + "type": "light_dynamic", + "origin": [ + -8442.83984375, + -5990.68310546875, + -80.129623413085938 + ], + "color": [ + 255, + 255, + 255, + 1 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ], + "scale": [ + 400.0, + -1.0, + -1.0 + ] + }, + { + "type": "infodecal", + "origin": [ + -8508.3330078125, + -5999.96875, + -139.70254516601562 + ], + "model": "decals/checkpointarrow01_black.vmt" + }, + { + "type": "infodecal", + "origin": [ + -7578.3076171875, + -5344.03125, + -1.9795554876327515 + ], + "model": "decals/checkpointarrow01_black.vmt" + }, + { + "type": "prop_dynamic", + "model": "models/props_equipment/light_floodlight.mdl", + "origin": [ + -8609.4853515625, + -5886.58740234375, + -318.59130859375 + ], + "angles": [ + 0.0, + -30.0, + 0.0 + ], + "properties": { + "int": { + "m_nSkin": 1 + } + } + }, + { + "type": "prop_dynamic", + "model": "models/props_equipment/light_floodlight.mdl", + "origin": [ + -7772.57275390625, + -6078.6318359375, + -61.102703094482422 + ], + "angles": [ + 0.0, + -165.0, + 0.0 + ], + "properties": { + "int": { + "m_nSkin": 1 + } + } + }, + { + "type": "light_dynamic", + "origin": [ + -7789.453125, + -6090.96240234375, + -25.968757629394531 + ], + "color": [ + 255, + 255, + 255, + 1 + ], + "angles": [ + -162.0, + 0.0, + 0.0 + ], + "scale": [ + 400.0, + -1.0, + -1.0 + ] + } + ], + "inputs": [ + { + "hammerid": 286780, + "input": "_allow_ladder" + } + ] + } + ] + }, + "start-help": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_urban/metal_plate001.mdl", + "origin": [ + -11552.841796875, + -8238.443359375, + -461.36874389648438 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/metal_plate001.mdl", + "origin": [ + -11452.822265625, + -8187.95556640625, + -462.92050170898438 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/metal_plate001.mdl", + "origin": [ + -11321.1884765625, + -8188.3017578125, + -462.57418823242188 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/metal_plate001.mdl", + "origin": [ + -11188.369140625, + -8189.39599609375, + -462.95126342773438 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_c17/truss02h.mdl", + "origin": [ + -11365.6318359375, + -8171.609375, + -480.19430541992188 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_c17/truss02h.mdl", + "origin": [ + -11244.2041015625, + -8188.748046875, + -478.780517578125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] } ] } diff --git a/data/randomizer/c1m4_atrium.json b/data/randomizer/c1m4_atrium.json new file mode 100644 index 0000000..e5d58a2 --- /dev/null +++ b/data/randomizer/c1m4_atrium.json @@ -0,0 +1,341 @@ +{ + "pills": { + "chance": 0.10000000149011612, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + }, + { + "type": "weapon_pain_pills", + "model": "models/w_models/weapons/w_eq_painpills.mdl", + "origin": [ + -2223.25439453125, + -5297.4228515625, + 657.84283447265625 + ], + "angles": [ + 36.637165069580078, + 166.42544555664062, + -85.725311279296875 + ] + } + ] + } + ] + }, + "gascans": { + "chance": 0.80000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "_gascan", + "origin": [ + -6051.14208984375, + -3448.0810546875, + 10.876523017883301 + ], + "angles": [ + -0.55249863862991333, + 129.0628662109375, + 0.0064697265625 + ] + }, + { + "type": "_gascan", + "origin": [ + -5950.7998046875, + -3225.01025390625, + 10.882441520690918 + ], + "angles": [ + -0.5578463077545166, + -139.19509887695312, + -0.124267578125 + ] + }, + { + "type": "_gascan", + "origin": [ + -4745.12109375, + -2358.740234375, + 10.877493858337402 + ], + "angles": [ + -0.58881288766860962, + -56.487579345703125, + -0.1336669921875 + ] + }, + { + "type": "_gascan", + "origin": [ + -4925.220703125, + -2751.919921875, + 290.86605834960938 + ], + "angles": [ + -0.55006474256515503, + -44.867576599121094, + 0.007659912109375 + ] + }, + { + "type": "_gascan", + "origin": [ + -3909.123291015625, + -2742.46826171875, + 290.86465454101562 + ], + "angles": [ + -0.55862104892730713, + -159.15614318847656, + 0.0079345703125 + ] + }, + { + "type": "_gascan", + "origin": [ + -3879.3017578125, + -3364.2548828125, + 290.87225341796875 + ], + "angles": [ + -0.55406862497329712, + -47.913330078125, + 0.0017852783203125 + ] + }, + { + "type": "_gascan", + "origin": [ + -2867.53466796875, + -3212.300048828125, + 290.868408203125 + ], + "angles": [ + -0.53946495056152344, + 103.97676849365234, + 0.0077972412109375 + ] + }, + { + "type": "_gascan", + "origin": [ + -3061.08349609375, + -3134.86376953125, + 10.877670288085938 + ], + "angles": [ + -0.57504987716674805, + -77.274543762207031, + -0.1275634765625 + ] + }, + { + "type": "_gascan", + "origin": [ + -3607.03955078125, + -3158.387939453125, + 10.877679824829102 + ], + "angles": [ + -0.57509583234786987, + -121.18537902832031, + -0.12750244140625 + ] + }, + { + "type": "_gascan", + "origin": [ + -4482.93115234375, + -4446.20458984375, + 10.853196144104004 + ], + "angles": [ + -0.72719091176986694, + 54.255725860595703, + -0.16156005859375 + ] + }, + { + "type": "_gascan", + "origin": [ + -4020.397705078125, + -4442.953125, + 10.86365795135498 + ], + "angles": [ + 0.3856024444103241, + 114.11133575439453, + -0.273193359375 + ] + }, + { + "type": "_gascan", + "origin": [ + -5399.42822265625, + -4438.22119140625, + 10.882131576538086 + ], + "angles": [ + -0.54621058702468872, + 33.001979827880859, + -0.1214599609375 + ] + }, + { + "type": "_gascan", + "origin": [ + -5424.62451171875, + -4431.45849609375, + 290.86849975585938 + ], + "angles": [ + -0.868499755859375, + 72.193069458007812, + 0.2503509521484375 + ] + } + ] + } + ] + }, + "PEANUT": { + "chance": 1.0, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_fairgrounds/lil'peanut_cutout001.mdl", + "origin": [ + -4683.3173828125, + -2287.525634765625, + 303.778564453125 + ], + "angles": [ + 0.0, + -90.0, + 0.0 + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/data/randomizer/c2m1_highway.json b/data/randomizer/c2m1_highway.json index 82d7bdb..9b11d61 100644 --- a/data/randomizer/c2m1_highway.json +++ b/data/randomizer/c2m1_highway.json @@ -1,28 +1,43 @@ { "bus": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ - { "model": "models/props_vehicles/bus01_2.mdl", - "origin": [9340.55, 7863.68, -520.65], - "angles": [0.00, -176.84, 0.00] + "origin": [ + 9340.5499999999993, + 7863.6800000000003, + -520.64999999999998 + ], + "angles": [ + 0.0, + -176.84, + 0.0 + ] } ] } ] }, "preskip": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ { "model": "models/props_vehicles/deliveryvan.mdl", - "origin": [5938.53, 7845.30, -698.72], - "angles": [0.00, 141.92, 0.00] + "origin": [ + 5938.5299999999997, + 7845.3000000000002, + -698.72000000000003 + ], + "angles": [ + 0.0, + 141.91999999999999, + 0.0 + ] } ] }, @@ -31,41 +46,73 @@ "entities": [ { "model": "models/props_vehicles/news_van.mdl", - "origin": [5971.11, 7821.71, -692.81], - "angles": [0.00, -132.26, 0.00] + "origin": [ + 5971.1099999999997, + 7821.71, + -692.80999999999995 + ], + "angles": [ + 0.0, + -132.25999999999999, + 0.0 + ] }, { "model": "models/props_vehicles/van_glass.mdl", - "origin": [5971.11, 7821.71, -692.81], - "angles": [0.00, -132.26, 0.00] + "origin": [ + 5971.1099999999997, + 7821.71, + -692.80999999999995 + ], + "angles": [ + 0.0, + -132.25999999999999, + 0.0 + ] } ] } ] }, "skipblock": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ { "model": "models/props_foliage/tree_city01.mdl", - "origin": [4577.54, 7472.64, -752.53], - "angles": [0.00, -152.23, 0.00] + "origin": [ + 4577.54, + 7472.6400000000003, + -752.52999999999997 + ], + "angles": [ + 0.0, + -152.22999999999999, + 0.0 + ] } ] } ] }, "bridge": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ { "model": "models/props_vehicles/suv_2001.mdl", - "origin": [4225.25, 7152.90, -706.86], - "angles": [0.00, 123.42, 0.00] + "origin": [ + 4225.25, + 7152.8999999999996, + -706.86000000000001 + ], + "angles": [ + 0.0, + 123.42, + 0.0 + ] } ] }, @@ -73,32 +120,64 @@ "entities": [ { "model": "models/props_urban/fence002_256.mdl", - "origin": [3713.50, 7007.50, -706.36], - "angles": [0.00, -164.60, 0.00] + "origin": [ + 3713.5, + 7007.5, + -706.36000000000001 + ], + "angles": [ + 0.0, + -164.59999999999999, + 0.0 + ] }, { "model": "models/props_urban/fence002_64.mdl", - "origin": [3751.20, 6857.83, -706.04], - "angles": [0.00, 10.15, 0.00] + "origin": [ + 3751.1999999999998, + 6857.8299999999999, + -706.03999999999996 + ], + "angles": [ + 0.0, + 10.15, + 0.0 + ] } ] } ] }, "hallway": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ { "model": "models/props_downtown/dresser.mdl", - "origin": [1262.76, 5023.55, -809.65], - "angles": [0.00, -83.92, 0.00] + "origin": [ + 1262.76, + 5023.5500000000002, + -809.64999999999998 + ], + "angles": [ + 0.0, + -83.920000000000002, + 0.0 + ] }, { "model": "models/props_downtown/dresser.mdl", - "origin": [1265.40, 5034.58, -774.49], - "angles": [0.00, -87.50, 0.00] + "origin": [ + 1265.4000000000001, + 5034.5799999999999, + -774.49000000000001 + ], + "angles": [ + 0.0, + -87.5, + 0.0 + ] } ] }, @@ -106,13 +185,29 @@ "entities": [ { "model": "models/props_vehicles/cara_84sedan.mdl", - "origin": [1211.36, 3629.09, -968.11], - "angles": [0.00, -177.49, 0.00] + "origin": [ + 1211.3599999999999, + 3629.0900000000001, + -968.11000000000001 + ], + "angles": [ + 0.0, + -177.49000000000001, + 0.0 + ] }, { "model": "models/props_vehicles/cara_84sedan_glass.mdl", - "origin": [1211.36, 3629.09, -968.11], - "angles": [0.00, -177.49, 0.00] + "origin": [ + 1211.3599999999999, + 3629.0900000000001, + -968.11000000000001 + ], + "angles": [ + 0.0, + -177.49000000000001, + 0.0 + ] } ] }, @@ -120,36 +215,60 @@ "entities": [ { "model": "models/props_fortifications/barricade001_128_reference.mdl", - "origin": [1265.29, 3631.60, -967.96], - "angles": [0.00, -165.60, 0.00] + "origin": [ + 1265.29, + 3631.5999999999999, + -967.96000000000004 + ], + "angles": [ + 0.0, + -165.59999999999999, + 0.0 + ] } ] } ] }, "hallwayskip": { - "chance": 0.1, + "chance": 0.10000000000000001, "variants": [ { "entities": [ { "model": "models/props_urban/fence_cover001_64.mdl", - "origin": [1954.54, 3763.97, -911.23], - "angles": [60.00, -4.33, 0.00] + "origin": [ + 1954.54, + 3763.9699999999998, + -911.23000000000002 + ], + "angles": [ + 60.0, + -4.3300000000000001, + 0.0 + ] } ] } ] }, "hwend": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ { "model": "models/props_vehicles/hmmwv.mdl", - "origin": [3003.56, 3422.34, -967.53], - "angles": [0.00, 111.72, 0.00] + "origin": [ + 3003.5599999999999, + 3422.3400000000001, + -967.52999999999997 + ], + "angles": [ + 0.0, + 111.72, + 0.0 + ] } ] }, @@ -157,116 +276,239 @@ "entities": [ { "model": "models/props_vehicles/hmmwv.mdl", - "origin": [3003.56, 3422.34, -967.53], - "angles": [0.00, 249.72, 0.00] + "origin": [ + 3003.5599999999999, + 3422.3400000000001, + -967.52999999999997 + ], + "angles": [ + 0.0, + 249.72, + 0.0 + ] } ] } ] }, "hillfence": { - "chance": 0.26, + "chance": 0.26000000000000001, "variants": [ { "entities": [ { "model": "models/props_exteriors/wood_railing001.mdl", - "origin": [2126.43, 2681.44, -1015.73], - "angles": [0.00, -87.78, 0.00] + "origin": [ + 2126.4299999999998, + 2681.4400000000001, + -1015.73 + ], + "angles": [ + 0.0, + -87.780000000000001, + 0.0 + ] }, { "type": "", - "scale": [0.00, 0.00, 0.00], - "origin": [1966.13, 2728.19, -1015.46], - "angles": [0.00, -90.56, 0.00] + "scale": [ + 0.0, + 0.0, + 0.0 + ], + "origin": [ + 1966.1300000000001, + 2728.1900000000001, + -1015.46 + ], + "angles": [ + 0.0, + -90.560000000000002, + 0.0 + ] }, { "model": "models/props_exteriors/wood_railing001.mdl", - "origin": [1807.01, 2665.68, -1013.35], - "angles": [0.00, -95.64, 0.00] + "origin": [ + 1807.01, + 2665.6799999999998, + -1013.35 + ], + "angles": [ + 0.0, + -95.640000000000001, + 0.0 + ] } ] } ] }, "valleyhill": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ - { "model": "models/props/cs_militia/militiarock06.mdl", - "origin": [733.37, 1864.12, -1747.81], - "angles": [0.00, 178.12, 0.00] + "origin": [ + 733.37, + 1864.1199999999999, + -1747.8099999999999 + ], + "angles": [ + 0.0, + 178.12, + 0.0 + ] } ] } ] }, "valleyuphill": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-423.15, 1120.06, -1790.24], - "angles": [0.00, -105.87, 0.00] + "origin": [ + -423.14999999999998, + 1120.0599999999999, + -1790.24 + ], + "angles": [ + 0.0, + -105.87, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-500.38, 1247.74, -1793.48], - "angles": [0.00, -142.13, 0.00] + "origin": [ + -500.38, + 1247.74, + -1793.48 + ], + "angles": [ + 0.0, + -142.13, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-545.50, 1214.06, -1789.35], - "angles": [0.00, -130.56, 0.00] + "origin": [ + -545.5, + 1214.0599999999999, + -1789.3499999999999 + ], + "angles": [ + 0.0, + -130.56, + 0.0 + ] } ] } ] }, "rocks": { - "chance": 0.2, + "chance": 0.20000000000000001, "variants": [ { "entities": [ { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-958.64, 599.03, -1621.60], - "angles": [0.00, -79.86, 0.00] + "origin": [ + -958.63999999999999, + 599.02999999999997, + -1621.5999999999999 + ], + "angles": [ + 0.0, + -79.859999999999999, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1019.25, 530.55, -1623.71], - "angles": [0.00, -91.67, 0.00] + "origin": [ + -1019.25, + 530.54999999999995, + -1623.71 + ], + "angles": [ + 0.0, + -91.670000000000002, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1082.22, 641.94, -1598.58], - "angles": [0.00, -23.66, 0.00] + "origin": [ + -1082.22, + 641.94000000000005, + -1598.5799999999999 + ], + "angles": [ + 0.0, + -23.66, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1141.92, 522.94, -1636.98], - "angles": [0.00, -63.62, 0.00] + "origin": [ + -1141.9200000000001, + 522.94000000000005, + -1636.98 + ], + "angles": [ + 0.0, + -63.619999999999997, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss01.mdl", - "origin": [-1248.78, 484.65, -1566.88], - "angles": [0.00, -69.39, 0.00] + "origin": [ + -1248.78, + 484.64999999999998, + -1566.8800000000001 + ], + "angles": [ + 0.0, + -69.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss03.mdl", - "origin": [-1333.51, 475.09, -1522.29], - "angles": [0.00, -78.39, 0.00] + "origin": [ + -1333.51, + 475.08999999999997, + -1522.29 + ], + "angles": [ + 0.0, + -78.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1416.47, 449.34, -1625.31], - "angles": [0.00, 124.39, 0.00] + "origin": [ + -1416.47, + 449.33999999999997, + -1625.3099999999999 + ], + "angles": [ + 0.0, + 124.39, + 0.0 + ] } ] }, @@ -274,43 +516,107 @@ "entities": [ { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-958.64, 599.03, -1621.60], - "angles": [0.00, -79.86, 0.00] + "origin": [ + -958.63999999999999, + 599.02999999999997, + -1621.5999999999999 + ], + "angles": [ + 0.0, + -79.859999999999999, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1019.25, 530.55, -1623.71], - "angles": [0.00, -91.67, 0.00] + "origin": [ + -1019.25, + 530.54999999999995, + -1623.71 + ], + "angles": [ + 0.0, + -91.670000000000002, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1082.22, 641.94, -1598.58], - "angles": [0.00, -23.66, 0.00] + "origin": [ + -1082.22, + 641.94000000000005, + -1598.5799999999999 + ], + "angles": [ + 0.0, + -23.66, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1141.92, 522.94, -1636.98], - "angles": [0.00, -63.62, 0.00] + "origin": [ + -1141.9200000000001, + 522.94000000000005, + -1636.98 + ], + "angles": [ + 0.0, + -63.619999999999997, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss01.mdl", - "origin": [-1248.78, 484.65, -1566.88], - "angles": [0.00, -69.39, 0.00] + "origin": [ + -1248.78, + 484.64999999999998, + -1566.8800000000001 + ], + "angles": [ + 0.0, + -69.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss03.mdl", - "origin": [-1333.51, 475.09, -1522.29], - "angles": [0.00, -78.39, 0.00] + "origin": [ + -1333.51, + 475.08999999999997, + -1522.29 + ], + "angles": [ + 0.0, + -78.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1416.47, 449.34, -1625.31], - "angles": [0.00, 124.39, 0.00] + "origin": [ + -1416.47, + 449.33999999999997, + -1625.3099999999999 + ], + "angles": [ + 0.0, + 124.39, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1490.60, 403.96, -1560.65], - "angles": [0.00, -55.99, 0.00] + "origin": [ + -1490.5999999999999, + 403.95999999999998, + -1560.6500000000001 + ], + "angles": [ + 0.0, + -55.990000000000002, + 0.0 + ] } ] }, @@ -318,43 +624,107 @@ "entities": [ { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-958.64, 599.03, -1621.60], - "angles": [0.00, -79.86, 0.00] + "origin": [ + -958.63999999999999, + 599.02999999999997, + -1621.5999999999999 + ], + "angles": [ + 0.0, + -79.859999999999999, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1019.25, 530.55, -1623.71], - "angles": [0.00, -91.67, 0.00] + "origin": [ + -1019.25, + 530.54999999999995, + -1623.71 + ], + "angles": [ + 0.0, + -91.670000000000002, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1082.22, 641.94, -1598.58], - "angles": [0.00, -23.66, 0.00] + "origin": [ + -1082.22, + 641.94000000000005, + -1598.5799999999999 + ], + "angles": [ + 0.0, + -23.66, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1141.92, 522.94, -1636.98], - "angles": [0.00, -63.62, 0.00] + "origin": [ + -1141.9200000000001, + 522.94000000000005, + -1636.98 + ], + "angles": [ + 0.0, + -63.619999999999997, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss01.mdl", - "origin": [-1248.78, 484.65, -1566.88], - "angles": [0.00, -69.39, 0.00] + "origin": [ + -1248.78, + 484.64999999999998, + -1566.8800000000001 + ], + "angles": [ + 0.0, + -69.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss03.mdl", - "origin": [-1333.51, 475.09, -1522.29], - "angles": [0.00, -78.39, 0.00] + "origin": [ + -1333.51, + 475.08999999999997, + -1522.29 + ], + "angles": [ + 0.0, + -78.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1416.47, 449.34, -1625.31], - "angles": [0.00, 124.39, 0.00] + "origin": [ + -1416.47, + 449.33999999999997, + -1625.3099999999999 + ], + "angles": [ + 0.0, + 124.39, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-892.46, 579.18, -1601.30], - "angles": [0.00, -93.30, 0.00] + "origin": [ + -892.46000000000004, + 579.17999999999995, + -1601.3 + ], + "angles": [ + 0.0, + -93.299999999999997, + 0.0 + ] } ] }, @@ -362,72 +732,168 @@ "entities": [ { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-958.64, 599.03, -1621.60], - "angles": [0.00, -79.86, 0.00] + "origin": [ + -958.63999999999999, + 599.02999999999997, + -1621.5999999999999 + ], + "angles": [ + 0.0, + -79.859999999999999, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1019.25, 530.55, -1623.71], - "angles": [0.00, -91.67, 0.00] + "origin": [ + -1019.25, + 530.54999999999995, + -1623.71 + ], + "angles": [ + 0.0, + -91.670000000000002, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1082.22, 641.94, -1598.58], - "angles": [0.00, -23.66, 0.00] + "origin": [ + -1082.22, + 641.94000000000005, + -1598.5799999999999 + ], + "angles": [ + 0.0, + -23.66, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss04.mdl", - "origin": [-1141.92, 522.94, -1636.98], - "angles": [0.00, -63.62, 0.00] + "origin": [ + -1141.9200000000001, + 522.94000000000005, + -1636.98 + ], + "angles": [ + 0.0, + -63.619999999999997, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss01.mdl", - "origin": [-1248.78, 484.65, -1566.88], - "angles": [0.00, -69.39, 0.00] + "origin": [ + -1248.78, + 484.64999999999998, + -1566.8800000000001 + ], + "angles": [ + 0.0, + -69.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss03.mdl", - "origin": [-1333.51, 475.09, -1522.29], - "angles": [0.00, -78.39, 0.00] + "origin": [ + -1333.51, + 475.08999999999997, + -1522.29 + ], + "angles": [ + 0.0, + -78.390000000000001, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-1416.47, 449.34, -1625.31], - "angles": [0.00, 124.39, 0.00] + "origin": [ + -1416.47, + 449.33999999999997, + -1625.3099999999999 + ], + "angles": [ + 0.0, + 124.39, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-892.46, 579.18, -1601.30], - "angles": [0.00, -93.30, 0.00] + "origin": [ + -892.46000000000004, + 579.17999999999995, + -1601.3 + ], + "angles": [ + 0.0, + -93.299999999999997, + 0.0 + ] }, { "model": "models/props_wasteland/rock_moss02.mdl", - "origin": [-892.46, 579.18, -1601.30], - "angles": [0.00, -93.30, 0.00] + "origin": [ + -892.46000000000004, + 579.17999999999995, + -1601.3 + ], + "angles": [ + 0.0, + -93.299999999999997, + 0.0 + ] } ] } ] }, "saferoom": { - "chance": 0.3, + "chance": 0.29999999999999999, "variants": [ { "entities": [ { "model": "models/props_urban/fence002_256.mdl", - "origin": [-914.05, -1979.78, -1086.70], - "angles": [0.00, -119.77, 0.00] + "origin": [ + -914.04999999999995, + -1979.78, + -1086.7 + ], + "angles": [ + 0.0, + -119.77, + 0.0 + ] }, { "model": "models/props_urban/fence002_256.mdl", - "origin": [-699.15, -2113.80, -1086.25], - "angles": [0.00, -123.33, 0.00] + "origin": [ + -699.14999999999998, + -2113.8000000000002, + -1086.25 + ], + "angles": [ + 0.0, + -123.33, + 0.0 + ] }, { "model": "models/props_urban/fence002_128.mdl", - "origin": [-595.78, -2179.14, -1086.70], - "angles": [0.00, 44.39, 0.00] + "origin": [ + -595.77999999999997, + -2179.1399999999999, + -1086.7 + ], + "angles": [ + 0.0, + 44.390000000000001, + 0.0 + ] } ] }, @@ -435,37 +901,101 @@ "entities": [ { "model": "models/props_urban/fence002_256.mdl", - "origin": [-914.05, -1979.78, -1086.70], - "angles": [0.00, -119.77, 0.00] + "origin": [ + -914.04999999999995, + -1979.78, + -1086.7 + ], + "angles": [ + 0.0, + -119.77, + 0.0 + ] }, { "model": "models/props_urban/fence002_256.mdl", - "origin": [-699.15, -2113.80, -1086.25], - "angles": [0.00, -123.33, 0.00] + "origin": [ + -699.14999999999998, + -2113.8000000000002, + -1086.25 + ], + "angles": [ + 0.0, + -123.33, + 0.0 + ] }, { "model": "models/props_urban/fence002_128.mdl", - "origin": [-595.78, -2179.14, -1086.70], - "angles": [0.00, 44.39, 0.00] + "origin": [ + -595.77999999999997, + -2179.1399999999999, + -1086.7 + ], + "angles": [ + 0.0, + 44.390000000000001, + 0.0 + ] }, { "model": "models/props_fortifications/barricade001_128_reference.mdl", - "origin": [-512.92, -2346.49, -1086.76], - "angles": [0.00, 176.01, 0.00] + "origin": [ + -512.91999999999996, + -2346.4899999999998, + -1086.76 + ], + "angles": [ + 0.0, + 176.00999999999999, + 0.0 + ] } ] } ] }, "saferoom2": { - "chance": 0.2, + "chance": 0.20000000000000001, "variants": [ { "entities": [ { "model": "models/props_fortifications/barricade001_128_reference.mdl", - "origin": [-1037.46, -2394.61, -1088.00], - "angles": [0.00, -96.25, 0.00] + "origin": [ + -1037.46, + -2394.6100000000001, + -1088.0 + ], + "angles": [ + 0.0, + -96.25, + 0.0 + ] + } + ] + } + ] + }, + "peanut-ranover": { + "chance": 0.80000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_fairgrounds/lil'peanut_cutout001.mdl", + "origin": [ + 10417.2236328125, + 7870.07080078125, + -528.7232666015625 + ], + "angles": [ + -60.0, + 0.0, + 0.0 + ] } ] } diff --git a/data/randomizer/c4m1_milltown_a.json b/data/randomizer/c4m1_milltown_a.json new file mode 100644 index 0000000..250d92b --- /dev/null +++ b/data/randomizer/c4m1_milltown_a.json @@ -0,0 +1,1482 @@ +{ + "rooftop-2-access": { + "chance": 0.60000002384185791, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_c17/truss02d.mdl", + "origin": [ + -6130.37548828125, + 7925.4072265625, + 341.4249267578125 + ], + "angles": [ + 0.0, + 0.0, + 7.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + -6182.025390625, + 7697.3740234375, + 289.32940673828125 + ], + "angles": [ + 32.0, + -107.40000915527344, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_exteriors/fence_plastic001.mdl", + "origin": [ + -6201.5107421875, + 8130.63623046875, + 340.03125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_exteriors/fence_plastic001.mdl", + "origin": [ + -6200.93798828125, + 8256.685546875, + 340.03125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_exteriors/fence_plastic001.mdl", + "origin": [ + -6204.12353515625, + 8342.90625, + 340.03125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "truckblock": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_truck3.mdl", + "origin": [ + -5010.0419921875, + 7734.44091796875, + 98.530517578125 + ], + "angles": [ + 0.0, + 11.899999618530273, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer.mdl", + "origin": [ + -4959.31884765625, + 7431.03857421875, + 98.368728637695312 + ], + "angles": [ + 0.0, + 9.3000001907348633, + 0.0 + ] + } + ] + } + ] + }, + "construct-alley-block": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props/de_prodigy/wood_pallet_01.mdl", + "origin": [ + -612.926513671875, + 6012.0419921875, + 120.98597717285156 + ], + "angles": [ + -80.100006103515625, + 69.199996948242188, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/de_nuke/truck_nuke.mdl", + "origin": [ + -514.7620849609375, + 6061.83154296875, + 98.784637451171875 + ], + "angles": [ + 0.0, + -92.599998474121094, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/de_nuke/truck_nuke_glass.mdl", + "origin": [ + -514.7620849609375, + 6061.83154296875, + 98.784637451171875 + ], + "angles": [ + 0.0, + -92.599998474121094, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/plywood_leaning.mdl", + "origin": [ + -503.701171875, + 5982.18212890625, + 104.27775573730469 + ], + "angles": [ + 19.700002670288086, + -90.20001220703125, + 0.0 + ] + } + ] + } + ] + }, + "house-door-block": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_furniture/chair2.mdl", + "origin": [ + -843.57147216796875, + 5755.11767578125, + 173.48355102539062 + ], + "angles": [ + -60.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_downtown/dresser.mdl", + "origin": [ + -847.906494140625, + 5744.97607421875, + 193.7103271484375 + ], + "angles": [ + -180.0, + 0.0, + 90.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_interiors/bbq_grill.mdl", + "origin": [ + -860.88446044921875, + 5766.09228515625, + 105.82819366455078 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "playground-skip": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + -1209.6839599609375, + 6914.2392578125, + 200.63134765625 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_crates/static_crate_40.mdl", + "origin": [ + -1309.03125, + 6938.50634765625, + 202.41818237304688 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_01.mdl", + "origin": [ + -1254.373046875, + 6826.69384765625, + 112.12223052978516 + ], + "angles": [ + 0.59999990463256836, + -67.699996948242188, + 10.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/fence_cover001_64.mdl", + "origin": [ + -1229.9058837890625, + 6749.8232421875, + 115.98374176025391 + ], + "angles": [ + 30.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_swamp/plank001b_192.mdl", + "origin": [ + -1041.4501953125, + 6920.8828125, + 158.14295959472656 + ], + "angles": [ + 10.199997901916504, + 88.100006103515625, + 32.0 + ] + } + ] + } + ] + }, + "ceda": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_misc/gazebo.mdl", + "origin": [ + -602.975341796875, + 7816.41796875, + 99.958992004394531 + ], + "angles": [ + 0.0, + -42.400001525878906, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_interiors/ceda_easel01.mdl", + "origin": [ + -645.1663818359375, + 7809.6142578125, + 90.9564208984375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_misc/gazebo.mdl", + "origin": [ + -789.31964111328125, + 7590.22216796875, + 113.48371124267578 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_furniture/it_mkt_table2.mdl", + "origin": [ + -748.378173828125, + 7592.13427734375, + 107.78606414794922 + ], + "angles": [ + -0.19999992847442627, + -9.5999994277954102, + -5.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/outhouse001.mdl", + "origin": [ + -1008.3880615234375, + 7493.2470703125, + 100.10147857666016 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/outhouse002.mdl", + "origin": [ + -1005.9328002929688, + 7429.42431640625, + 102.40476226806641 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/ceda_trailer_closed.mdl", + "origin": [ + -199.79443359375, + 7200.08642578125, + 91.016487121582031 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer_freestanding.mdl", + "origin": [ + -145.80682373046875, + 6835.9990234375, + 109.56112670898438 + ], + "angles": [ + 0.0, + -112.09999847412109, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cement_truck01.mdl", + "origin": [ + 321.60610961914062, + 7113.42529296875, + 99.0465087890625 + ], + "angles": [ + 0.0, + -2.1000046730041504, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_misc/ceda_banner.mdl", + "origin": [ + 222.46876525878906, + 7426.16845703125, + 183.120849609375 + ], + "angles": [ + 0.0, + -27.800003051757812, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fairgrounds/alligator.mdl", + "origin": [ + -1022.3969116210938, + 7423.01806640625, + 112.30544281005859 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/deadbodies/ceda/ceda_table_b.mdl", + "origin": [ + -731.69183349609375, + 7605.625, + 109.14176940917969 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "left-boat-skip": { + "chance": 0.20000000298023224, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/boat_ski.mdl", + "origin": [ + -1342.733154296875, + 7642.09716796875, + 142.09251403808594 + ], + "angles": [ + 0.0, + -100.29999542236328, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/boat_trailer20ft.mdl", + "origin": [ + -1331.3797607421875, + 7644.9287109375, + 143.82127380371094 + ], + "angles": [ + 0.0, + -96.500015258789062, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/pickup_truck_2004.mdl", + "origin": [ + -2219.626708984375, + 7607.5283203125, + 99.160079956054688 + ], + "angles": [ + 0.0, + -163.69999694824219, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_crates/static_crate_40.mdl", + "origin": [ + -1502.5404052734375, + 7603.2490234375, + 97.005584716796875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "house-garage-block": { + "chance": 0.5, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props/de_nuke/truck_nuke.mdl", + "origin": [ + 334.34182739257812, + 5404.47998046875, + 100.17530059814453 + ], + "angles": [ + 0.0, + -14.899999618530273, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/cs_militia/shelves_wood.mdl", + "origin": [ + 237.07989501953125, + 5520.53271484375, + 94.864997863769531 + ], + "angles": [ + -6.0000004768371582, + 83.199989318847656, + 0.0 + ] + } + ] + } + ] + }, + "dumpster-skip": { + "chance": 0.5, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/suv_2001.mdl", + "origin": [ + 1817.2623291015625, + 3911.12939453125, + 100.9583740234375 + ], + "angles": [ + 0.0, + -77.5, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/suv_2001_glass.mdl", + "origin": [ + 1817.2623291015625, + 3911.12939453125, + 100.9583740234375 + ], + "angles": [ + 0.0, + -77.5, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/dumpster001.mdl", + "origin": [ + 1958.30126953125, + 3837.324951171875, + 96.284660339355469 + ], + "angles": [ + 0.0, + -88.899993896484375, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001a.mdl", + "origin": [ + 1964.774658203125, + 3715.951904296875, + 173.462158203125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + 1969.86376953125, + 3790.276123046875, + 183.30633544921875 + ], + "angles": [ + -12.799999237060547, + 306.79998779296875, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001a.mdl", + "origin": [ + 1964.503662109375, + 3848.463623046875, + 160.85580444335938 + ], + "angles": [ + 0.0, + 15.899999618530273, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + 1957.3970947265625, + 3896.373291015625, + 178.76214599609375 + ], + "angles": [ + -12.799999237060547, + 87.700004577636719, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + 1954.4771728515625, + 3971.22998046875, + 186.51704406738281 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1915.98876953125, + 3866.54638671875, + 170.85635375976562 + ], + "angles": [ + 0.0, + -83.699996948242188, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1939.1441650390625, + 3819.7646484375, + 160.9354248046875 + ], + "angles": [ + 0.0, + -12.999996185302734, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + 1934.2772216796875, + 3788.553955078125, + 126.39857482910156 + ], + "angles": [ + 77.200004577636719, + -21.600000381469727, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1921.8853759765625, + 3685.9990234375, + 170.81491088867188 + ], + "angles": [ + 0.0, + 84.000007629394531, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + 1980.500732421875, + 3702.30810546875, + 149.97383117675781 + ], + "angles": [ + -39.700000762939453, + 306.79998779296875, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001a.mdl", + "origin": [ + 1952.237060546875, + 3943.56787109375, + 147.94662475585938 + ], + "angles": [ + 0.0, + 15.899999618530273, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1941.6190185546875, + 3980.210693359375, + 170.33621215820312 + ], + "angles": [ + 0.0, + 84.000007629394531, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + 1957.4547119140625, + 3705.260986328125, + 154.65032958984375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1918.654541015625, + 3768.329345703125, + 160.54913330078125 + ], + "angles": [ + 0.0, + -82.299995422363281, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1937.467529296875, + 3714.63330078125, + 171.19769287109375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1993.8851318359375, + 3689.807373046875, + 159.75634765625 + ], + "angles": [ + 0.0, + 84.000007629394531, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1995.285400390625, + 3782.07421875, + 158.66447448730469 + ], + "angles": [ + 0.0, + 84.000007629394531, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1958.77490234375, + 3920.156494140625, + 173.6800537109375 + ], + "angles": [ + 0.0, + -39.799995422363281, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1969.6920166015625, + 3960.96875, + 163.96121215820312 + ], + "angles": [ + 0.0, + 67.000007629394531, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1985.8109130859375, + 3991.06396484375, + 172.69140625 + ], + "angles": [ + 0.0, + 67.000007629394531, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_chunk01a.mdl", + "origin": [ + 1985.2796630859375, + 3943.77294921875, + 161.65048217773438 + ], + "angles": [ + 0.0, + -83.699996948242188, + 0.0 + ] + } + ] + } + ] + }, + "garage2-block": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props/cs_militia/shelves_wood.mdl", + "origin": [ + 2379.632568359375, + 2920.348388671875, + 99.884902954101562 + ], + "angles": [ + 0.0, + 90.300003051757812, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/plastic_bucket001.mdl", + "origin": [ + 2417.281005859375, + 2911.267333984375, + 127.97147369384766 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/paintbucket01_static.mdl", + "origin": [ + 2379.286376953125, + 2915.43408203125, + 126.29402923583984 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/big_wheel001.mdl", + "origin": [ + 2336.673828125, + 2867.917236328125, + 98.511054992675781 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_junk/wheebarrow01a.mdl", + "origin": [ + 2334.95849609375, + 2773.084228515625, + 110.24717712402344 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/carparts_wheel01a_static.mdl", + "origin": [ + 2422.4755859375, + 2757.2548828125, + 109.47286987304688 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/carparts_wheel01a_static.mdl", + "origin": [ + 2460.7109375, + 2755.885498046875, + 112.17292022705078 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_junk/metalbucket02a.mdl", + "origin": [ + 2469.368896484375, + 2912.298095703125, + 107.14229583740234 + ], + "angles": [ + 0.0, + 36.600002288818359, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/cs_militia/shelves_wood.mdl", + "origin": [ + 2574.4013671875, + 2918.22265625, + 96.745361328125 + ], + "angles": [ + 0.0, + 90.300003051757812, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/paintbucket01.mdl", + "origin": [ + 2533.198486328125, + 2920.9853515625, + 122.88316345214844 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/paintbucket01.mdl", + "origin": [ + 2525.225341796875, + 2914.93603515625, + 154.70027160644531 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_junk/metalbucket01a.mdl", + "origin": [ + 2338.1171875, + 2914.409912109375, + 165.678466796875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_interiors/bucket_tools02.mdl", + "origin": [ + 2385.522705078125, + 2916.5068359375, + 96.890380859375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "garage2-alley-block": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_interiors/table_picnic.mdl", + "origin": [ + 2363.767333984375, + 2696.5908203125, + 121.72509765625 + ], + "angles": [ + -38.100002288818359, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/plywood_leaning.mdl", + "origin": [ + 2310.503173828125, + 2656.603759765625, + 99.017684936523438 + ], + "angles": [ + 14.399999618530273, + -77.900001525878906, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_misc/standing_tarp_narrow.mdl", + "origin": [ + 2465.73681640625, + 2661.52490234375, + 100.31044006347656 + ], + "angles": [ + 0.0, + -24.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/cs_assault/washer_box.mdl", + "origin": [ + 2396.148193359375, + 2726.48046875, + 96.866752624511719 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 2214.35107421875, + 2626.3076171875, + 95.359649658203125 + ], + "angles": [ + 83.600006103515625, + 89.699996948242188, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_interiors/coffee_table_oval.mdl", + "origin": [ + 2336.08740234375, + 2712.382080078125, + 98.705101013183594 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_interiors/table_bedside.mdl", + "origin": [ + 2361.804931640625, + 2687.34228515625, + 101.42886352539062 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_foliage/tree_city01.mdl", + "origin": [ + 2587.680908203125, + 2690.486083984375, + 94.296051025390625 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "semi-collision": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/police_car_rural.mdl", + "origin": [ + 2945.1533203125, + -68.587295532226562, + 117.86392974853516 + ], + "angles": [ + 10.199999809265137, + 184.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/police_car_city_glass.mdl", + "origin": [ + 2945.1533203125, + -68.587295532226562, + 117.86392974853516 + ], + "angles": [ + 10.199999809265137, + 184.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/flatnose_truck.mdl", + "origin": [ + 3083.548828125, + 443.6507568359375, + 109.33514404296875 + ], + "angles": [ + 0.0, + -76.900009155273438, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer.mdl", + "origin": [ + 3092.07275390625, + 727.62908935546875, + 102.77457427978516 + ], + "angles": [ + 0.0, + -182.5, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer.mdl", + "origin": [ + 3174.597412109375, + -5.639404296875, + 108.14723205566406 + ], + "angles": [ + 0.0, + -25.600000381469727, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/flatnose_truck.mdl", + "origin": [ + 3273.8466796875, + 205.77471923828125, + 112.70208740234375 + ], + "angles": [ + 0.0, + 66.099998474121094, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/police_barrier001_128_reference.mdl", + "origin": [ + 3005.129638671875, + -277.87005615234375, + 113.38404846191406 + ], + "angles": [ + 0.0, + -79.000007629394531, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/police_barrier001_128_reference.mdl", + "origin": [ + 2922.20263671875, + -321.47174072265625, + 104.12355804443359 + ], + "angles": [ + -1.7000025510787964, + -55.700008392333984, + 7.0 + ] + } + ] + } + ] + }, + "saferoom-ladder-block": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + 3882.66650390625, + -882.27349853515625, + 179.87933349609375 + ], + "angles": [ + -72.0, + 85.800010681152344, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/plywood_leaning.mdl", + "origin": [ + 3954.176513671875, + -887.9573974609375, + 166.52484130859375 + ], + "angles": [ + 19.600000381469727, + 75.100006103515625, + -93.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 3827.516357421875, + -902.08880615234375, + 94.366706848144531 + ], + "angles": [ + 67.599990844726562, + -98.199996948242188, + 0.0 + ] + } + ] + } + ] + }, + "FRED": { + "chance": 1.0, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_fairgrounds/alligator.mdl", + "origin": [ + 4079.801025390625, + -2030.1895751953125, + 128.56544494628906 + ], + "angles": [ + 0.0, + -48.200008392333984, + 0.0 + ] + } + ] + } + ] + }, + "PEANUT": { + "chance": 1.0, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_physics", + "model": "models/props_fairgrounds/lil'peanut_cutout001.mdl", + "origin": [ + 4194.7490234375, + -1562.11767578125, + 105.9647216796875 + ], + "angles": [ + 0.0, + 185.60000610351562, + 0.0 + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/data/randomizer/c4m2_sugarmill_a.json b/data/randomizer/c4m2_sugarmill_a.json new file mode 100644 index 0000000..20745f6 --- /dev/null +++ b/data/randomizer/c4m2_sugarmill_a.json @@ -0,0 +1,1548 @@ +{ + "start-alt": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cement_truck01.mdl", + "origin": [ + 3938.6396484375, + -2938.28369140625, + 103.64805603027344 + ], + "angles": [ + -2.2999999523162842, + 373.39999389648438, + -3.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cement_truck01_windows.mdl", + "origin": [ + 3938.6396484375, + -2938.28369140625, + 103.64805603027344 + ], + "angles": [ + -2.2999999523162842, + 373.39999389648438, + -3.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + 3606.87939453125, + -3589.42236328125, + 244.75967407226562 + ], + "angles": [ + 35.700000762939453, + 52.900001525878906, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris256barricade001a.mdl", + "origin": [ + 3609.428955078125, + -3620.521728515625, + 272.69064331054688 + ], + "angles": [ + 0.0, + -99.000007629394531, + 0.0 + ] + } + ] + } + ] + }, + "start-fence-alt": { + "chance": 0.5, + "variants": [ + { + "weight": 1, + "inputs": [ + { + "targetname": "anv_mapfixes_commonhop_roadclosed", + "input": "kill" + } + ], + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + 3420.606201171875, + -2925.869384765625, + 175.00129699707031 + ], + "angles": [ + 45.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/plywood_leaning.mdl", + "origin": [ + 3379.612060546875, + -2989.818359375, + 176.86412048339844 + ], + "angles": [ + -15.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + 3510.56298828125, + -3052.518310546875, + 178.54568481445312 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_crates/static_crate_40.mdl", + "origin": [ + 3400.85546875, + -3095.1025390625, + 177.76951599121094 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 3555.8076171875, + -3086.749267578125, + 177.36624145507812 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + 3557.99462890625, + -3046.218505859375, + 177.47483825683594 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 3546.722900390625, + -3018.815673828125, + 177.11297607421875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_shacks/shack_deck01.mdl", + "origin": [ + 3470.375, + -2979.120361328125, + -20.194366455078125 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 3553.0224609375, + -2967.691650390625, + 178.85061645507812 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 3556.722412109375, + -2921.4306640625, + 177.95205688476562 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 3428.54931640625, + -2992.919189453125, + 177.55819702148438 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 3431.861328125, + -2865.394775390625, + 179.73797607421875 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + } + ] + } + ] + }, + "vent-alt": { + "chance": 0.80000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props/cs_assault/forklift.mdl", + "origin": [ + 3179.809326171875, + -3510.556884765625, + 96.991729736328125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/wire_spool_01.mdl", + "origin": [ + 3175.184814453125, + -3630.560791015625, + 97.572151184082031 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_crates/static_crate_40.mdl", + "origin": [ + 2336.643310546875, + -3705.84375, + 101.12310791015625 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_crates/static_crate_40.mdl", + "origin": [ + 2317.7216796875, + -3767.1171875, + 101.24301910400391 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_crates/static_crate_40.mdl", + "origin": [ + 2318.4560546875, + -3767.671142578125, + 140.42762756347656 + ], + "angles": [ + 0.0, + 15.0, + 0.0 + ] + }, + { + "type": "prop_physics", + "model": "models/props_junk/plasticcrate01a.mdl", + "origin": [ + 2336.21923828125, + -3640.6357421875, + 107.07093811035156 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_physics", + "model": "models/props_junk/wood_crate002a.mdl", + "origin": [ + 2186.99853515625, + -3769.4130859375, + 128.45585632324219 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/brickpallets.mdl", + "origin": [ + 3005.877685546875, + -3480.378173828125, + 132.2501220703125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/brickpallets_break03.mdl", + "origin": [ + 2984.858154296875, + -3532.777099609375, + 114.96548461914062 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/wire_spool_01.mdl", + "origin": [ + 3083.699462890625, + -3534.236572265625, + 98.854766845703125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/wire_spool_01.mdl", + "origin": [ + 3091.04736328125, + -3534.616943359375, + 152.17906188964844 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic_override", + "model": "models/props_industrial/brickpallets_break03.mdl", + "origin": [ + 3074.112060546875, + -3465.80908203125, + 113.99124145507812 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/cs_office/ladder1.mdl", + "origin": [ + 2368.809326171875, + -3706.584228515625, + 268.08432006835938 + ], + "angles": [ + 0.0, + -90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 2568.534912109375, + -3658.8251953125, + 308.76361083984375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 2567.130859375, + -3706.377685546875, + 308.2470703125 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_01.mdl", + "origin": [ + 2481.004150390625, + -3689.6845703125, + 311.60348510742188 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ], + "inputs": [ + { + "hammerid": 1381638, + "input": "_allow_ladder" + }, + { + "targetname": "anv_mapfixes_vent_roofb", + "input": "kill" + } + ] + } + ] + }, + "yard-block": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_industrial/pallet_barrels_water01_docks.mdl", + "origin": [ + 4845.11083984375, + -4572.68798828125, + 98.105224609375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/pallet_barrels_water01_docks.mdl", + "origin": [ + 4846.587890625, + -4575.4765625, + 150.3343505859375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/de_prodigy/wood_pallet_01.mdl", + "origin": [ + 4883.94873046875, + -4564.677734375, + 117.05396270751953 + ], + "angles": [ + 74.300003051757812, + 31.999998092651367, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer_freestanding.mdl", + "origin": [ + 4694.505859375, + -4223.7451171875, + 109.02796173095703 + ], + "angles": [ + 0.0, + 0.0, + -2.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/longnose_truck.mdl", + "origin": [ + 4743.43896484375, + -3902.3564453125, + 96.850761413574219 + ], + "angles": [ + 0.0, + -23.19999885559082, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/longnose_truck_glass.mdl", + "origin": [ + 4743.43896484375, + -3902.3564453125, + 96.850761413574219 + ], + "angles": [ + 0.0, + -23.19999885559082, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cement_truck01.mdl", + "origin": [ + 4823.47119140625, + -3590.524169921875, + 103.02696228027344 + ], + "angles": [ + 0.0, + 120.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cement_truck01_windows.mdl", + "origin": [ + 4823.47119140625, + -3590.524169921875, + 103.02696228027344 + ], + "angles": [ + 0.0, + 120.0, + 0.0 + ] + } + ] + } + ] + }, + "pipe-block": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris256barricade001a.mdl", + "origin": [ + 2773.5302734375, + -4419.62109375, + 135.14608764648438 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris256pile001a.mdl", + "origin": [ + 2827.361083984375, + -4360.7626953125, + 109.28536987304688 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/fence_cover001_64.mdl", + "origin": [ + 2916.533447265625, + -4021.826171875, + 95.17626953125 + ], + "angles": [ + -63.900012969970703, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/de_train/lockers001a.mdl", + "origin": [ + 2847.973388671875, + -3876.7158203125, + 133.81513977050781 + ], + "angles": [ + 4.5, + -76.700004577636719, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + 2781.437255859375, + -4388.75732421875, + 131.74613952636719 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "env_player_blocker", + "origin": [ + 2761.187255859375, + -4390.15087890625, + 100.26711273193359 + ], + "scale": [ + 15.0, + 30.0, + 100.0 + ] + } + ] + } + ] + }, + "pipe-ladder": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props/cs_assault/ladder_tall.mdl", + "origin": [ + 1302.6827392578125, + -4854.2275390625, + 279.26580810546875 + ], + "angles": [ + 0.0, + -180.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_mill/pipeset32d_corner128da.mdl", + "origin": [ + 1249.6107177734375, + -4724.2470703125, + 122.76670074462891 + ], + "angles": [ + 180.0, + 120.0, + 75.0 + ] + } + ], + "inputs": [ + { + "hammerid": 1318903, + "input": "_allow_ladder" + } + ] + } + ] + }, + "shortcut": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + 2512.59228515625, + -5314.69970703125, + 119.12522888183594 + ], + "angles": [ + 45.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris256pile001a.mdl", + "origin": [ + 2534.916748046875, + -5239.9228515625, + 110.53338623046875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 2709.08935546875, + -5345.20654296875, + 109.02704620361328 + ], + "angles": [ + 15.0, + -30.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + 2643.96728515625, + -5333.56787109375, + 110.07864379882812 + ], + "angles": [ + 75.0, + 120.0, + 0.0 + ] + }, + { + "type": "prop_dynamic_override", + "model": "models/lighthouse/checkpoint_door_lighthouse01_plank.mdl", + "origin": [ + 2568.40283203125, + -5246.11083984375, + 117.67844390869141 + ], + "angles": [ + -75.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "catwalk-alt": { + "chance": 0.40000000596046448, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_industrial/pallet_barrels_water01_docks.mdl", + "origin": [ + 1993.7821044921875, + -6089.38671875, + 114.58966827392578 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props/cs_office/ladder1.mdl", + "origin": [ + 1958.212158203125, + -6087.47265625, + 278.74249267578125 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + } + ], + "inputs": [ + { + "hammerid": 1048039, + "input": "_allow_ladder" + }, + { + "classname": "env_player_blocker", + "input": "kill" + } + ], + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_urban/outhouse001.mdl", + "origin": [ + 1983.56494140625, + -6019.49267578125, + 227.60931396484375 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_industrial/pallet_stack_docks.mdl", + "origin": [ + 2068.80908203125, + -6016.74267578125, + 229.84625244140625 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_unique/mopbucket01.mdl", + "origin": [ + 2014.8980712890625, + -5976.42578125, + 227.23452758789062 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_junk/pooh_bucket_01.mdl", + "origin": [ + 1975.092041015625, + -5971.39990234375, + 228.75106811523438 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "truss-help": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_c17/truss02g.mdl", + "origin": [ + 763.59515380859375, + -6029.3125, + 280.80496215820312 + ], + "angles": [ + -30.0, + 90.0, + -30.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_c17/truss02d.mdl", + "origin": [ + 982.071533203125, + -6057.63427734375, + 333.56112670898438 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + } + ], + "inputs": [ + { + "classname": "env_player_blocker", + "input": "kill" + } + ] + } + ] + }, + "trailer": { + "chance": 0.40000000000000002, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer.mdl", + "origin": [ + -149.14341735839844, + -7601.3212890625, + 104.34027862548828 + ], + "angles": [ + 0.0, + 90.0, + -5.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/longnose_truck.mdl", + "origin": [ + -453.22744750976562, + -7604.01416015625, + 86.495895385742188 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/metal_plate001.mdl", + "origin": [ + -548.467529296875, + -7513.0703125, + 152.66046142578125 + ], + "angles": [ + 70.199996948242188, + 46.800003051757812, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + -646.151611328125, + -7518.79931640625, + 95.411109924316406 + ], + "angles": [ + 123.70001220703125, + -78.700004577636719, + 0.0 + ] + } + ] + } + ] + }, + "pipe": { + "chance": 0.60000002384185791, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_pipes/pipeset32d_256_001a.mdl", + "origin": [ + -684.09722900390625, + -7820.384765625, + 239.37014770507812 + ], + "angles": [ + 15.0, + 90.0, + 90.0 + ], + "color": [ + 254, + 254, + 254, + 255 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_pipes/pipeset32d_256_001a.mdl", + "origin": [ + -734.09722900390625, + -7820.384765625, + 239.37014770507812 + ], + "angles": [ + 15.0, + 90.0, + 90.0 + ], + "color": [ + 205, + 205, + 205, + 255 + ] + } + ] + } + ] + }, + "railing": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_mill/mill_railing_128.mdl", + "origin": [ + -1247.545654296875, + -8769.6367179999997, + 604.87127685546875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_mill/mill_railing_64.mdl", + "origin": [ + -1330.17431640625, + -8769.6367179999997, + 586.93646240234375 + ], + "angles": [ + -45.0, + 45.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_mill/mill_railing_128.mdl", + "origin": [ + -1460.89599609375, + -8769.6367179999997, + 604.70611572265625 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "irrigation": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_equipment/irrigation_system_end.mdl", + "origin": [ + -1034.26953125, + -11247.0244140625, + 91.64385986328125 + ], + "angles": [ + 0.0, + 30.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_equipment/irrigation_system.mdl", + "origin": [ + -1035.354736328125, + -11246.4208984375, + 91.56475830078125 + ], + "angles": [ + 0.0, + 30.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_equipment/irrigation_system.mdl", + "origin": [ + -1035.354736328125, + -11246.4208984375, + 91.56475830078125 + ], + "angles": [ + 0.0, + 210.0, + 0.0 + ] + } + ] + } + ] + }, + "gas-ent-block": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer.mdl", + "origin": [ + -1180.2857666015625, + -13233.6845703125, + 115.96822357177734 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/flatnose_truck.mdl", + "origin": [ + -1210.4561767578125, + -12946.3564453125, + 115.198974609375 + ], + "angles": [ + 0.0, + 120.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/flatnose_truck_glass.mdl", + "origin": [ + -1210.4561767578125, + -12946.3564453125, + 115.198974609375 + ], + "angles": [ + 0.0, + 120.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + -1307.11328125, + -13387.828125, + 128.878173828125 + ], + "angles": [ + 90.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_02.mdl", + "origin": [ + -1356.28076171875, + -13388.0810546875, + 141.94827270507812 + ], + "angles": [ + 90.0, + 90.0, + 0.0 + ] + }, + { + "scale": [ + -59.0, + 659.400390625, + 47.889999389648438 + ], + "type": "hammerid", + "model": "405252", + "origin": [ + -1351.0, + -13938.400390625, + 187.36000061035156 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_street/garbage_can_static.mdl", + "origin": [ + -1381.843505859375, + -13335.083984375, + 122.46968078613281 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_junk/trashcluster01a.mdl", + "origin": [ + -1394.243896484375, + -13313.779296875, + 115.70468139648438 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/fence_cover001_64.mdl", + "origin": [ + -1294.0377197265625, + -13515.1640625, + 125.73538970947266 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/fence_cover001_64.mdl", + "origin": [ + -1294.5433349609375, + -13446.1884765625, + 135.69027709960938 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_urban/fence_cover001_64.mdl", + "origin": [ + -1422.7735595703125, + -13345.123046875, + 140.71403503417969 + ], + "angles": [ + 0.0, + 0.0, + -15.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_01.mdl", + "origin": [ + -1399.2940673828125, + -13386.1826171875, + 79.564247131347656 + ], + "angles": [ + 90.0, + -90.0, + 0.0 + ] + } + ], + "inputs": [ + {"hammerid": 405225, "input": "_lock_nobreak"} + ] + } + ] + }, + "armytruck": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/army_truck.mdl", + "origin": [ + -987.73681640625, + -12166.1806640625, + 114.33696746826172 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "gas-cars": { + "chance": 0.80000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "_car", + "model": "models/props_vehicles/van.mdl", + "origin": [ + -959.8787841796875, + -13697.0888671875, + 117.88813781738281 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "_car_alarm", + "model": "models/props_vehicles/cara_95sedan.mdl", + "origin": [ + -809.1656494140625, + -13360.07421875, + 122.15287780761719 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + } + ] + }, + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/ambulance.mdl", + "origin": [ + -935.3623046875, + -13167.8173828125, + 114.05971527099609 + ], + "angles": [ + 0.0, + 180.0, + 4.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/police_car_rural.mdl", + "origin": [ + -815.83148193359375, + -13673.4716796875, + 117.42774200439453 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/police_car_rural_trunkopen_glass.mdl", + "origin": [ + -815.83148193359375, + -13673.4716796875, + 117.42774200439453 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "gas-forklift": { + "chance": 0.69999998807907104, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props/cs_assault/forklift.mdl", + "origin": [ + -1215.8017578125, + -13628.8193359375, + 119.1187744140625 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "fuel-truck": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/airport_fuel_truck.mdl", + "origin": [ + -946.544921875, + -13895.6640625, + 118.66380310058594 + ], + "angles": [ + 0.0, + 85.800003051757812, + 0.0 + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/data/randomizer/c5m5_bridge.json b/data/randomizer/c5m5_bridge.json index a55fa64..3847d66 100644 --- a/data/randomizer/c5m5_bridge.json +++ b/data/randomizer/c5m5_bridge.json @@ -22,5 +22,251 @@ ] } ] + }, + "trailer": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001b.mdl", + "origin": [ + -5020.86962890625, + 6377.85693359375, + 641.72576904296875 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/hmmwv.mdl", + "origin": [ + -4926.7568359375, + 6393.20068359375, + 626.56927490234375 + ], + "angles": [ + -3.8999967575073242, + 61.0, + 9.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001a.mdl", + "origin": [ + -4907.00537109375, + 6379.3125, + 701.50091552734375 + ], + "angles": [ + 19.80000114440918, + -10.699999809265137, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/semi_trailer_wrecked.mdl", + "origin": [ + -5159.9794921875, + 6288.13427734375, + 516.46624755859375 + ], + "angles": [ + 0.0, + 118.30000305175781, + -5.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_debris/concrete_debris128pile001a.mdl", + "origin": [ + -4939.30126953125, + 6397.275390625, + 697.10382080078125 + ], + "angles": [ + 4.4000000953674316, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "bus": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/bus01_2.mdl", + "origin": [ + -3170.48095703125, + 6297.6298828125, + 640.4088134765625 + ], + "angles": [ + -23.000001907348633, + 49.799995422363281, + -20.0 + ] + } + ] + } + ] + }, + "humvee": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/hmmwv.mdl", + "origin": [ + 4218.40283203125, + 6309.74951171875, + 455.75555419921875 + ], + "angles": [ + 0.0, + -93.300003051757812, + 0.0 + ] + } + ] + } + ] + }, + "car-block": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cara_95sedan.mdl", + "origin": [ + 4680.36962890625, + 6451.8359375, + 598.89410400390625 + ], + "angles": [ + -16.500001907348633, + 113.90000152587891, + -3.0 + ] + } + ] + } + ] + }, + "bus-down-alt": { + "chance": 0.40000000596046448, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cara_84sedan.mdl", + "origin": [ + 9448.177734375, + 2465.4091796875, + 402.39703369140625 + ], + "angles": [ + -19.69999885559082, + -7.8000001907348633, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_vehicles/cara_95sedan_wrecked.mdl", + "origin": [ + 9574.169921875, + 2354.686279296875, + 230.94760131835938 + ], + "angles": [ + -3.7000000476837158, + 66.599998474121094, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + 9241.9619140625, + 2593.072998046875, + 395.70574951171875 + ], + "angles": [ + -1.5000001192092896, + -16.5, + 3.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + 9209.5185546875, + 2495.00341796875, + 387.2938232421875 + ], + "angles": [ + -1.5000001192092896, + -16.5, + 3.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_128_reference.mdl", + "origin": [ + 9276.5849609375, + 2693.54833984375, + 405.56076049804688 + ], + "angles": [ + -1.5000001192092896, + -16.5, + 3.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_fortifications/barricade001_64_reference.mdl", + "origin": [ + 9286.923828125, + 2788.736328125, + 409.21328735351562 + ], + "angles": [ + 0.0, + -22.400001525878906, + 5.0 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/data/randomizer/c7m3_port.json b/data/randomizer/c7m3_port.json index 680a4ea..5d65cb3 100644 --- a/data/randomizer/c7m3_port.json +++ b/data/randomizer/c7m3_port.json @@ -1004,6 +1004,61 @@ 69.000007629394531, 0.0 ] + }, + { + "type": "prop_dynamic", + "model": "models/props_street/concertinawire128.mdl", + "origin": [ + 1089.169921875, + 1763.4981689453125, + 291.31658935546875 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_street/concertinawire128.mdl", + "origin": [ + 964.45440673828125, + 1765.302490234375, + 291.97311401367188 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_street/concertinawire128.mdl", + "origin": [ + 837.82415771484375, + 1765.9117431640625, + 289.5538330078125 + ], + "angles": [ + 0.0, + 90.0, + 0.0 + ] + }, + { + "type": "env_physics_blocker", + "origin": [ + 752.350830078125, + 2041.630615234375, + 548.03125 + ], + "scale": [ + 15.0, + 240.0, + 100.0 + ] } ] } @@ -1369,7 +1424,7 @@ "weight": 1, "entities": [ { - "type": "prop_dynamic", + "type": "prop_dynamic_override", "model": "models/props_junk/gnome.mdl", "origin": [ -1365.762451171875, @@ -1385,5 +1440,123 @@ ] } ] + }, + "bar-block": { + "chance": 0.30000001192092896, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 273.46566772460938, + -357.96719360351562, + 0.3364105224609375 + ], + "angles": [ + 90.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_03.mdl", + "origin": [ + 273.00442504882812, + -405.81011962890625, + 7.7817878723144531 + ], + "angles": [ + 90.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_01.mdl", + "origin": [ + 249.58372497558594, + -385.9383544921875, + -25.917247772216797 + ], + "angles": [ + 90.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_01.mdl", + "origin": [ + 253.77641296386719, + -356.08816528320312, + -4.7134323120117188 + ], + "angles": [ + 90.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_01.mdl", + "origin": [ + 253.83631896972656, + -362.62399291992188, + 55.695259094238281 + ], + "angles": [ + 90.0, + 0.0, + 0.0 + ] + }, + { + "type": "prop_dynamic", + "model": "models/props_highway/plywood_01.mdl", + "origin": [ + 252.20606994628906, + -385.1119384765625, + 46.342216491699219 + ], + "angles": [ + 90.0, + 0.0, + 0.0 + ] + } + ] + } + ] + }, + "sedan": { + "chance": 0.20000000298023224, + "variants": [ + { + "weight": 1, + "entities": [ + { + "type": "_car_physics", + "model": "models/props_vehicles/cara_95sedan.mdl", + "origin": [ + 11.371078491210938, + -84.446060180664062, + -2.687330961227417 + ], + "angles": [ + 0.0, + 0.0, + 0.0 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/data/randomizer/c9m2_lots.json b/data/randomizer/c9m2_lots.json index b44d316..ee0890f 100644 --- a/data/randomizer/c9m2_lots.json +++ b/data/randomizer/c9m2_lots.json @@ -297,12 +297,12 @@ "type": "prop_dynamic", "model": "models/props_c17/metalladder001.mdl", "origin": [ - 3513.515673828125, + 3513.5156738281248, 3324.55859375, 84.583740234375 ], "angles": [ - 0.3999999761581421, + 0.39999997615814209, -91.400001525878906, 0.0 ] @@ -511,7 +511,7 @@ "type": "prop_dynamic", "model": "models/props_vehicles/bus01.mdl", "origin": [ - 7087.00927734375, + 7099.00927734375, 5887.7353515625, 41.365642547607422 ], @@ -576,6 +576,19 @@ 0.0, 0.0 ] + }, + { + "type": "env_physics_blocker", + "origin": [ + 7155.35693359375, + 5903.732421875, + 134.93994140625 + ], + "scale": [ + 18.0, + 240.0, + 40.0 + ] } ] } diff --git a/plugins/l4d2_extraplayeritems.smx b/plugins/l4d2_extraplayeritems.smx index 9890602..e0d6a23 100644 Binary files a/plugins/l4d2_extraplayeritems.smx and b/plugins/l4d2_extraplayeritems.smx differ diff --git a/plugins/l4d2_randomizer.smx b/plugins/l4d2_randomizer.smx index 92f9a9c..def22d1 100644 Binary files a/plugins/l4d2_randomizer.smx and b/plugins/l4d2_randomizer.smx differ diff --git a/scripting/include/epi/director.sp b/scripting/include/epi/director.sp index c685f93..dc2fa02 100644 --- a/scripting/include/epi/director.sp +++ b/scripting/include/epi/director.sp @@ -489,24 +489,9 @@ void DirectorSpawn(specialType special, int player = -1) { } } -// Finds a player that is suitable (lowest intensity) -// TODO: biased random (lower intensity : bias) -// dice roll, #sides = #players, sort list of players by intensity -// then use biased left dice, therefore lower intensity = higher random weight int g_iLastVictim; int GetSuitableVictim() { - // TODO: randomize? return GetRandomSurvivor(1, -1); - // ArrayList survivors = new ArrayList(2); - // for(int i = 1; i <= MaxClients; i++) { - // if(IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i)) { - // int index = survivors.Push(i); - // survivors.Set(index, 1, L4D_GetPlayerIntensity(i)); - // } - // } - // // Soe - // survivors.SortCustom() - int victim = -1; float lowestIntensity = 0.0; for(int i = 1; i <= MaxClients; i++) { diff --git a/scripting/include/gamemodes/ents.inc b/scripting/include/gamemodes/ents.inc index 8d1975b..664d046 100644 --- a/scripting/include/gamemodes/ents.inc +++ b/scripting/include/gamemodes/ents.inc @@ -46,7 +46,7 @@ stock int CreateEnvBlockerScaled(const char[] entClass, const float pos[3], cons int entity = CreateEntityByName(entClass); DispatchKeyValue(entity, "targetname", ENT_BLOCKER_NAME); DispatchKeyValue(entity, "initialstate", "1"); - DispatchKeyValue(entity, "BlockType", "0"); + DispatchKeyValueInt(entity, "BlockType", StrEqual(entClass, "env_physics_blocker") ? 4 : 0); static float mins[3]; mins = scale; NegateVector(mins); @@ -85,8 +85,8 @@ enum struct PortalData { float portalOffsets[3]; } static AnyMap portals; - stock int CreatePortal(PortalType type, const char model[64], const float pos[3], const float offset[3] = { 40.0, 40.0, 0.0 }, const float scale[3] = { 5.0, 5.0, 5.0 }) { + #pragma unused model int entity = CreateEntityByName("trigger_multiple"); if(entity == -1) return -1; DispatchKeyValue(entity, "spawnflags", "513"); @@ -160,11 +160,12 @@ stock void ClearPortalData() { portals.Clear(); } -stock int StartPropCreate(const char[] entClass, const char[] model, const float pos[3], const float ang[3] = NULL_VECTOR, const float vel[3] = NULL_VECTOR) { +stock int StartPropCreate(const char[] entClass, const char[] model, const float pos[3], const float ang[3] = NULL_VECTOR, const float vel[3] = NULL_VECTOR, bool hasCollision = true) { int entity = CreateEntityByName(entClass); if(entity == -1) return -1; DispatchKeyValue(entity, "model", model); - DispatchKeyValue(entity, "solid", "6"); + if(hasCollision) + DispatchKeyValue(entity, "solid", "6"); DispatchKeyValue(entity, "targetname", ENT_PROP_NAME); DispatchKeyValue(entity, "disableshadows", "1"); TeleportEntity(entity, pos, ang, vel); diff --git a/scripting/include/jutils.inc b/scripting/include/jutils.inc index ec2efea..8c13e79 100644 --- a/scripting/include/jutils.inc +++ b/scripting/include/jutils.inc @@ -884,6 +884,7 @@ stock bool IsAreaClear(const float pos[3], const float ang[3], const float minBo } stock Action Timer_KillEntity(Handle h, int entity) { + RemoveEntity(entity); return Plugin_Handled; } diff --git a/scripting/include/randomizer/caralarm.sp b/scripting/include/randomizer/caralarm.sp index 2daf78e..8cc90cb 100644 --- a/scripting/include/randomizer/caralarm.sp +++ b/scripting/include/randomizer/caralarm.sp @@ -1,3 +1,27 @@ +#define WINDSHIELD_LIST_COUNT 1 +char VEHICLE_MODEL_WINDSHIELD_KEY[WINDSHIELD_LIST_COUNT][] = { + "models/props_vehicles/cement_truck01.mdl" +}; +char VEHICLE_MODEL_WINDSHIELD_VAL[WINDSHIELD_LIST_COUNT][] = { + "models/props_vehicles/cement_truck01_windows.mdl" +}; + +bool GetWindshieldModel(const char[] vehicleModel, char[] model, int modelSize) { + bool found = false; + for(int i = 0; i < WINDSHIELD_LIST_COUNT; i++) { + if(StrEqual(VEHICLE_MODEL_WINDSHIELD_KEY[i], vehicleModel)) { + strcopy(model, modelSize, VEHICLE_MODEL_WINDSHIELD_VAL[i]); + found = true; + break; + } + } + if(!found) { + strcopy(model, modelSize, vehicleModel); + ReplaceString(model, modelSize, ".mdl", "_glass.mdl"); + } + return PrecacheModel(model); +} + int SpawnCar(VariantEntityData entity) { if(entity.model[0] == '\0') { LogError("Missing model for entity with type \"%s\"", entity.type); @@ -12,14 +36,12 @@ int SpawnCar(VariantEntityData entity) { } char glassModel[64]; - strcopy(glassModel, sizeof(glassModel), entity.model); - ReplaceString(glassModel, sizeof(glassModel), ".mdl", "_glass.mdl"); if(StrEqual(entity.type, "_car_physics")) { vehicle = CreateProp("prop_physics", entity.model, entity.origin, entity.angles); } else { vehicle = CreateProp("prop_dynamic", entity.model, entity.origin, entity.angles); } - if(PrecacheModel(glassModel)) { + if(GetWindshieldModel(entity.model, glassModel, sizeof(glassModel))) { int glass = CreateProp("prop_dynamic", glassModel, entity.origin, entity.angles); if(glass != -1) { SetVariantString("!activator"); diff --git a/scripting/include/randomizer/defs.sp b/scripting/include/randomizer/defs.sp new file mode 100644 index 0000000..44a32ea --- /dev/null +++ b/scripting/include/randomizer/defs.sp @@ -0,0 +1,599 @@ +#define MAX_SCENE_NAME_LENGTH 32 +#define MAX_INPUTS_CLASSNAME_LENGTH 64 + +int DEFAULT_COLOR[4] = { 255, 255, 255, 255 }; + +MapData g_MapData; // The global map data +SceneSelection g_selection; // The selected scenes from the global map data +BuilderData g_builder; // The global instance of the builder +ArrayList g_mapTraverseSelectionStack; // For maps that traverse backwards, holds record of the selected scenes so they can be re-applied + +int g_ropeIndex; // Unique id for ropes on spawn, is reset to 0 for every new spawn attempt +ArrayList g_gascanRespawnQueue; // Queue that gascan respawns pop from to respawn to +AnyMap g_gascanSpawners; // Mapping of , for when a can is destroyed it can be respawned in position + +int g_iLaserIndex; + +public void InitGlobals() { + g_gascanSpawners = new AnyMap(); + g_mapTraverseSelectionStack = new ArrayList(sizeof(TraverseData)); +} + +enum struct TraverseData { + char map[64]; + ArrayList selection; +} + +methodmap SceneSelection < ArrayList { + public SceneSelection() { + ArrayList selectedScenes = new ArrayList(sizeof(SelectedSceneData)); + return view_as(selectedScenes); + } + + property int Count { + public get() { + return (view_as(this)).Length; + } + } + + public void Cleanup() { + delete this; + } + + public void Activate(MapData data, int flags = 0) { + g_ropeIndex = 0; + SelectedSceneData aScene; + SceneData scene; + SceneVariantData choice; + ArrayList list = view_as(this); + for(int i = 0; i < list.Length; i++) { + list.GetArray(i, aScene); + Log("Activating scene \"%s\" with %d variants", aScene.name, aScene.selectedVariantIndexes.Length); + + // Fetch the scene that aScene marks + if(!data.scenesKv.GetArray(aScene.name, scene, sizeof(scene))) { + Log("WARN: Selected scene \"%s\" not found, skipping", aScene.name); + continue; + } + + for(int v = 0; v < aScene.selectedVariantIndexes.Length; v++) { + int variantIndex = aScene.selectedVariantIndexes.Get(v); + + + scene.variants.GetArray(variantIndex, choice); + activateVariant(choice, flags); + } + } + } + + public void Get(int sceneIndex, SelectedSceneData scene) { + (view_as(this)).GetArray(sceneIndex, scene); + } + + property ArrayList List { + public get() { + return view_as(this); + } + } + + public void AddScene(SelectedSceneData aScene) { + view_as(this).PushArray(aScene); + } +} + +void StoreTraverseSelection(const char[] name, SceneSelection selection) { + // Pushes selection and map to the stack + TraverseData data; + strcopy(data.map, sizeof(data.map), name); + data.selection = selection.List.Clone(); + g_mapTraverseSelectionStack.PushArray(data); +} + +bool PopTraverseSelection(TraverseData data) { + if(g_mapTraverseSelectionStack.Length == 0) { + Log("WARN: PopTraverseSelection() called but stack is empty"); + return false; + } + int index = g_mapTraverseSelectionStack.Length - 1; + g_mapTraverseSelectionStack.GetArray(index, data); + g_mapTraverseSelectionStack.Erase(index); + return true; +} + +void ClearTraverseStack() { + TraverseData trav; + for(int i = 0; i < g_mapTraverseSelectionStack.Length; i++) { + g_mapTraverseSelectionStack.GetArray(i, trav, sizeof(trav)); + delete trav.selection; + } + g_mapTraverseSelectionStack.Clear(); +} + +enum struct SelectedSceneData { + char name[MAX_SCENE_NAME_LENGTH]; + ArrayList selectedVariantIndexes; +} + +enum struct GascanSpawnerData { + float origin[3]; + float angles[3]; +} + +enum struct MapData { + StringMap scenesKv; + ArrayList scenes; + ArrayList lumpEdits; + ArrayList activeScenes; + ArrayList gascanSpawners; + StringMap groups; + + void Cleanup() { + SceneData scene; + for(int i = 0; i < this.scenes.Length; i++) { + this.scenes.GetArray(i, scene); + scene.Cleanup(); + } + delete this.scenes; + delete this.scenesKv; + delete this.lumpEdits; + delete this.activeScenes; + delete this.gascanSpawners; + delete this.groups; + } + + SceneSelection GenerateSelection(int flags) { + return selectScenes(this, flags); + } + + bool ApplySelection(SceneSelection selection, int flags) { + Profiler profiler = new Profiler(); + + profiler.Start(); + selection.Activate(this, flags); + spawnGascans(this); + profiler.Stop(); + + // _ropeIndex = 0; + + Log("Done applying selection in %.4f seconds", profiler.Time); + return true; + } + + bool IsLoaded() { + return this.scenes != null; + } +} + +enum loadFlags { + FLAG_NONE = 0, + FLAG_ALL_SCENES = 1, // Pick all scenes, no random chance + FLAG_ALL_VARIANTS = 2, // Pick all variants (for debug purposes), + FLAG_REFRESH = 4, // Load data bypassing cache + FLAG_FORCE_ACTIVE = 8, // Similar to ALL_SCENES, bypasses % chance + FLAG_IGNORE_TRAVERSE_STORE = 16 // Do not load stored selection from the g_mapTraverseSelections +} + +enum struct BuilderData { + JSONObject mapData; + + JSONObject selectedSceneData; + char selectedSceneId[64]; + + JSONObject selectedVariantData; + int selectedVariantIndex; + + bool IsLoaded() { + return this.mapData != null; + } + + void Cleanup() { + this.selectedSceneData = null; + this.selectedVariantData = null; + this.selectedVariantIndex = -1; + this.selectedSceneId[0] = '\0'; + if(this.mapData != null) + delete this.mapData; + // JSONcleanup_and_delete(this.mapData); + } + + bool SelectScene(const char[] group) { + if(!g_builder.mapData.HasKey(group)) return false; + this.selectedSceneData = view_as(g_builder.mapData.Get(group)); + strcopy(this.selectedSceneId, sizeof(this.selectedSceneId), group); + return true; + } + + /** + * Select a variant, enter -1 to not select any (scene's entities) + */ + bool SelectVariant(int index = -1) { + if(this.selectedSceneData == null) LogError("SelectVariant called, but no group selected"); + JSONArray variants = view_as(this.selectedSceneData.Get("variants")); + if(index >= variants.Length) return false; + else if(index < -1) return false; + else if(index > -1) { + this.selectedVariantData = view_as(variants.Get(index)); + } else { + this.selectedVariantData = null; + } + this.selectedVariantIndex = index; + return true; + } + + void AddEntity(int entity, ExportType exportType = Export_Model) { + JSONObject entityData = ExportEntity(entity, exportType); + this.AddEntityData(entityData); + } + + void AddEntityData(JSONObject entityData) { + JSONArray entities; + if(g_builder.selectedVariantData == null) { + // Create .entities if doesn't exist: + if(!g_builder.selectedSceneData.HasKey("entities")) { + g_builder.selectedSceneData.Set("entities", new JSONArray()); + } + entities = view_as(g_builder.selectedSceneData.Get("entities")); + } else { + entities = view_as(g_builder.selectedVariantData.Get("entities")); + } + entities.Push(entityData); + } +} + + + +enum struct SceneData { + char name[MAX_SCENE_NAME_LENGTH]; + float chance; + char group[MAX_SCENE_NAME_LENGTH]; + ArrayList variants; + + void Cleanup() { + SceneVariantData choice; + for(int i = 0; i < this.variants.Length; i++) { + this.variants.GetArray(i, choice); + choice.Cleanup(); + } + delete this.variants; + } +} + +enum struct SceneVariantData { + int weight; + ArrayList inputsList; + ArrayList entities; + ArrayList forcedScenes; + + void Cleanup() { + delete this.inputsList; + VariantEntityData entity; + for(int i = 0; i < this.entities.Length; i++) { + this.entities.GetArray(i, entity, sizeof(entity)); + entity.Cleanup(); + } + delete this.entities; + delete this.forcedScenes; + } +} + +enum propertyType { + PROPERTY_NONE = -1, + PROPERTY_STRING, + PROPERTY_INTEGER, + PROPERTY_FLOAT +} + +// This is horrible but we need a way to know what the type of the netprop to set is +enum struct PropertyStore { + JSONObject intKv; + JSONObject stringKv; + JSONObject floatKv; + + void Cleanup() { + if(this.intKv != null) delete this.intKv; + if(this.stringKv != null) delete this.stringKv; + if(this.floatKv != null) delete this.floatKv; + } + + bool GetInt(const char[] name, int &value) { + if(this.intKv == null) return false; + if(!this.intKv.HasKey(name)) return false; + value = this.intKv.GetInt(name); + return true; + } + + bool GetString(const char[] name, char[] buffer, int maxlen) { + if(this.stringKv == null) return false; + if(!this.stringKv.HasKey(name)) return false; + this.stringKv.GetString(name, buffer, maxlen); + return true; + } + + bool GetFloat(const char[] name, float &value) { + if(this.floatKv == null) return false; + if(!this.floatKv.HasKey(name)) return false; + value = this.floatKv.GetFloat(name); + return true; + } + + propertyType GetPropertyType(const char[] key) { + if(this.intKv != null && this.intKv.HasKey(key)) return PROPERTY_INTEGER; + if(this.floatKv != null && this.floatKv.HasKey(key)) return PROPERTY_FLOAT; + if(this.stringKv != null && this.stringKv.HasKey(key)) return PROPERTY_STRING; + return PROPERTY_NONE; + } + + bool HasAny() { + return this.intKv != null || this.floatKv != null || this.stringKv != null; + } + + ArrayList Keys() { + char key[128]; + ArrayList list = new ArrayList(ByteCountToCells(128)); + JSONObjectKeys keys; + if(this.stringKv != null) { + keys = this.stringKv.Keys() + while(keys.ReadKey(key, sizeof(key))) { + list.PushString(key); + } + delete keys; + } + if(this.intKv != null) { + keys = this.intKv.Keys() + while(keys.ReadKey(key, sizeof(key))) { + list.PushString(key); + } + delete keys; + } + if(this.floatKv != null) { + keys = this.floatKv.Keys() + while(keys.ReadKey(key, sizeof(key))) { + list.PushString(key); + } + delete keys; + } + return list; + } + + StringMap Entries() { + char key[128]; + StringMap kv = new StringMap(); + JSONObjectKeys keys; + if(this.stringKv != null) { + keys = this.stringKv.Keys() + while(keys.ReadKey(key, sizeof(key))) { + kv.SetValue(key, PROPERTY_STRING); + } + delete keys; + } + if(this.intKv != null) { + keys = this.intKv.Keys() + while(keys.ReadKey(key, sizeof(key))) { + kv.SetValue(key, PROPERTY_INTEGER); + } + delete keys; + } + if(this.floatKv != null) { + keys = this.floatKv.Keys() + while(keys.ReadKey(key, sizeof(key))) { + kv.SetValue(key, PROPERTY_FLOAT); + } + delete keys; + } + return kv; + } +} + +enum struct VariantEntityData { + char type[32]; + char model[128]; + char targetname[128]; + float origin[3]; + float angles[3]; + float scale[3]; + int color[4]; + + ArrayList keyframes; + PropertyStore properties; + JSONObject propertiesInt; + JSONObject propertiesString; + JSONObject propertiesFloat; + + void Cleanup() { + if(this.keyframes != null) { + delete this.keyframes; + } + this.properties.Cleanup(); + } + + void ApplyProperties(int entity) { + if(!this.properties.HasAny()) return; + char key[64], buffer[128]; + ArrayList keys = this.properties.Keys(); + for(int i = 0; i < keys.Length; i++) { + keys.GetString(i, key, sizeof(key)); + // Only want to apply netprops (m_ prefix) + if(key[0] == 'm' && key[1] == '_') { + propertyType type = this.properties.GetPropertyType(key); + Debug("netprop %s type %d", key, type); + switch(type) { + case PROPERTY_STRING: { + this.properties.GetString(key, buffer, sizeof(buffer)); + Debug("Applying netprop %s (val=%s) on %d", key, buffer, entity); + SetEntPropString(entity, Prop_Send, key, buffer); + break; + } + case PROPERTY_INTEGER: { + int val; + this.properties.GetInt(key, val); + Debug("Applying netprop %s (val=%d) on %d", key, val, entity); + SetEntProp(entity, Prop_Send, key, val); + break; + } + case PROPERTY_FLOAT: { + float val; + this.properties.GetFloat(key, val); + Debug("Applying netprop %s (val=%f) on %d", key, val, entity); + SetEntPropFloat(entity, Prop_Send, key, val); + break; + } + } + } + } + delete keys; + } +} + +enum InputType { + Input_Classname, + Input_Targetname, + Input_HammerId +} +enum struct VariantInputData { + char name[MAX_INPUTS_CLASSNAME_LENGTH]; + InputType type; + char input[64]; + + void Trigger() { + int entity = -1; + switch(this.type) { + case Input_Classname: { + while((entity = FindEntityByClassname(entity, this.name)) != INVALID_ENT_REFERENCE) { + this._trigger(entity); + } + } + case Input_Targetname: { + char targetname[64]; + int count = 0; + while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) { + GetEntPropString(entity, Prop_Data, "m_iName", targetname, sizeof(targetname)); + if(StrEqual(targetname, this.name)) { + this._trigger(entity); + count++; + } + } + if(count == 0) { + PrintToServer("[Randomizer::WARN] Input TargetName=\"%s\" matched 0 entties", this.name); + } + } + case Input_HammerId: { + int targetId = StringToInt(this.name); + int count = 0; + while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) { + int hammerId = GetEntProp(entity, Prop_Data, "m_iHammerID"); + if(hammerId == targetId ) { + this._trigger(entity); + count++; + break; + } + } + if(count == 0) { + PrintToServer("[Randomizer::WARN] Input HammerId=%d matched 0 entties", targetId); + } + } + } + } + + void _trigger(int entity) { + if(entity > 0 && IsValidEntity(entity)) { + if(StrEqual(this.input, "_allow_ladder")) { + if(HasEntProp(entity, Prop_Send, "m_iTeamNum")) { + SetEntProp(entity, Prop_Send, "m_iTeamNum", 0); + } else { + Log("Warn: Entity (%d) with id \"%s\" has no teamnum for \"_allow_ladder\"", entity, this.name); + } + } else if(StrEqual(this.input, "_lock")) { + AcceptEntityInput(entity, "Close"); + AcceptEntityInput(entity, "Lock"); + } else if(StrEqual(this.input, "_lock_nobreak")) { + AcceptEntityInput(entity, "Close"); + AcceptEntityInput(entity, "Lock"); + AcceptEntityInput(entity, "SetUnbreakable"); + } else { + char cmd[32]; + // Split input "a b" to a with variant "b" + int len = SplitString(this.input, " ", cmd, sizeof(cmd)); + if(len > -1) { + SetVariantString(this.input[len]); + AcceptEntityInput(entity, cmd); + Debug("_trigger(%d): %s (v=%s)", entity, cmd, this.input[len]); + } else { + Debug("_trigger(%d): %s", entity, this.input); + AcceptEntityInput(entity, this.input); + } + + } + } + } +} + +enum struct LumpEditData { + char name[MAX_INPUTS_CLASSNAME_LENGTH]; + InputType type; + char action[32]; + char value[64]; + + int _findLumpIndex(int startIndex = 0, EntityLumpEntry entry) { + int length = EntityLump.Length(); + char val[64]; + Debug("Scanning for \"%s\" (type=%d)", this.name, this.type); + for(int i = startIndex; i < length; i++) { + entry = EntityLump.Get(i); + int index = entry.FindKey("hammerid"); + if(index != -1) { + entry.Get(index, "", 0, val, sizeof(val)); + if(StrEqual(val, this.name)) { + return i; + } + } + + index = entry.FindKey("classname"); + if(index != -1) { + entry.Get(index, "", 0, val, sizeof(val)); + Debug("%s vs %s", val, this.name); + if(StrEqual(val, this.name)) { + return i; + } + } + + index = entry.FindKey("targetname"); + if(index != -1) { + entry.Get(index, "", 0, val, sizeof(val)); + if(StrEqual(val, this.name)) { + return i; + } + } + delete entry; + } + Log("Warn: Could not find any matching lump for \"%s\" (type=%d)", this.name, this.type); + return -1; + } + + void Trigger() { + int index = 0; + EntityLumpEntry entry; + while((index = this._findLumpIndex(index, entry) != -1)) { + // for(int i = 0; i < entry.Length; i++) { + // entry.Get(i, a, sizeof(a), v, sizeof(v)); + // Debug("%s=%s", a, v); + // } + this._trigger(entry); + } + } + + void _updateKey(EntityLumpEntry entry, const char[] key, const char[] value) { + int index = entry.FindKey(key); + if(index != -1) { + Debug("update key %s = %s", key, value); + entry.Update(index, key, value); + } + } + + void _trigger(EntityLumpEntry entry) { + if(StrEqual(this.action, "setclassname")) { + this._updateKey(entry, "classname", this.value); + } + + delete entry; + } +} \ No newline at end of file diff --git a/scripting/include/randomizer/loader_functions.sp b/scripting/include/randomizer/loader_functions.sp new file mode 100644 index 0000000..dcf8b93 --- /dev/null +++ b/scripting/include/randomizer/loader_functions.sp @@ -0,0 +1,268 @@ +public bool LoadGlobalMapData(const char[] map, int flags) { + Cleanup(); + g_selection = null; + return ParseMapData(g_MapData, map, flags); +} + +public JSONObject LoadMapJson(const char[] map) { + Debug("Loading config for %s", map); + char filePath[PLATFORM_MAX_PATH]; + BuildPath(Path_SM, filePath, sizeof(filePath), "data/randomizer/%s.json", map); + if(!FileExists(filePath)) { + Log("No map config file (data/randomizer/%s.json), not loading", map); + return null; + } + + JSONObject data = JSONObject.FromFile(filePath); + if(data == null) { + LogError("Could not parse map config file (data/randomizer/%s.json)", map); + return null; + } + return data; +} +public void SaveMapJson(const char[] map, JSONObject json) { + Debug("Saving config for %s", map); + char filePath[PLATFORM_MAX_PATH], filePathTemp[PLATFORM_MAX_PATH]; + BuildPath(Path_SM, filePathTemp, sizeof(filePath), "data/randomizer/%s.json.tmp", map); + BuildPath(Path_SM, filePath, sizeof(filePath), "data/randomizer/%s.json", map); + + json.ToFile(filePathTemp, JSON_INDENT(4)); + RenameFile(filePath, filePathTemp); + SetFilePermissions(filePath, FPERM_U_WRITE | FPERM_U_READ | FPERM_G_WRITE | FPERM_G_READ | FPERM_O_READ); +} + +/// Parses map data into first parameter, bool for success +public bool ParseMapData(MapData data, const char[] map, int flags) { + JSONObject json = LoadMapJson(map); + if(json == null) { + return false; + } + + Debug("Starting parsing json data"); + + data.scenes = new ArrayList(sizeof(SceneData)); + data.scenesKv = new StringMap(); + data.lumpEdits = new ArrayList(sizeof(LumpEditData)); + + Profiler profiler = new Profiler(); + profiler.Start(); + + JSONObjectKeys iterator = json.Keys(); + char key[32]; + while(iterator.ReadKey(key, sizeof(key))) { + if(key[0] == '_') { + if(StrEqual(key, "_lumps")) { + JSONArray lumpsList = view_as(json.Get(key)); + if(lumpsList != null) { + for(int l = 0; l < lumpsList.Length; l++) { + loadLumpData(data.lumpEdits, view_as(lumpsList.Get(l))); + } + } + } else { + Debug("Unknown special entry \"%s\", skipping", key); + } + } else { + // if(data.GetType(key) != JSONType_Object) { + // Debug("Invalid normal entry \"%s\" (not an object), skipping", key); + // continue; + // } + JSONObject scene = view_as(json.Get(key)); + // Parses scene data and inserts to scenes + loadScene(data, key, scene); + } + } + delete json; + + data.groups = new StringMap(); + getSceneGroups(data, data.groups); + + profiler.Stop(); + Log("Parsed map %s(%d) in %.4f seconds (%d scenes)", map, flags, profiler.Time, data.scenes.Length); + delete profiler; + return true; +} + +void getSceneGroups(MapData data, StringMap groups) { + ArrayList groupList; + SceneData scene; + for(int i = 0; i < data.scenes.Length; i++) { + data.scenes.GetArray(i, scene); + if(scene.group[0] != '\0') { + // Load it into group list + if(!groups.GetValue(scene.group, groupList)) { + groupList = new ArrayList(); + } + groupList.Push(i); + groups.SetValue(scene.group, groupList); + } + } +} + +void loadScene(MapData data, const char key[MAX_SCENE_NAME_LENGTH], JSONObject sceneData) { + SceneData scene; + scene.name = key; + scene.chance = sceneData.GetFloat("chance"); + if(scene.chance < 0.0 || scene.chance > 1.0) { + LogError("Scene \"%s\" has invalid chance (%f)", scene.name, scene.chance); + return; + } else if(!sceneData.HasKey("variants")) { + ThrowError("Failed to load: Scene \"%s\" has missing \"variants\" array", scene.name); + return; + } + // TODO: load "entities", merge with choice.entities + sceneData.GetString("group", scene.group, sizeof(scene.group)); + scene.variants = new ArrayList(sizeof(SceneVariantData)); + + JSONArray entities; + if(sceneData.HasKey("entities")) { + entities = view_as(sceneData.Get("entities")); + } + + // Load all variants + JSONArray variants = view_as(sceneData.Get("variants")); + for(int i = 0; i < variants.Length; i++) { + // Parses choice and loads to scene.choices + loadChoice(scene, view_as(variants.Get(i)), entities); + } + + data.scenes.PushArray(scene); + data.scenesKv.SetArray(scene.name, scene, sizeof(scene)); +} + +void loadChoice(SceneData scene, JSONObject choiceData, JSONArray extraEntities) { + SceneVariantData choice; + choice.weight = choiceData.HasKey("weight") ? choiceData.GetInt("weight") : 1; + choice.entities = new ArrayList(sizeof(VariantEntityData)); + choice.inputsList = new ArrayList(sizeof(VariantInputData)); + choice.forcedScenes = new ArrayList(ByteCountToCells(MAX_SCENE_NAME_LENGTH)); + // Load in any variant-based entities + if(choiceData.HasKey("entities")) { + JSONArray entities = view_as(choiceData.Get("entities")); + for(int i = 0; i < entities.Length; i++) { + // Parses entities and loads to choice.entities + loadChoiceEntity(choice.entities, view_as(entities.Get(i))); + } + delete entities; + } + // Load in any entities that the scene has + if(extraEntities != null) { + for(int i = 0; i < extraEntities.Length; i++) { + // Parses entities and loads to choice.entities + loadChoiceEntity(choice.entities, view_as(extraEntities.Get(i))); + } + // delete extraEntities; + } + // Load all inputs + if(choiceData.HasKey("inputs")) { + JSONArray inputsList = view_as(choiceData.Get("inputs")); + for(int i = 0; i < inputsList.Length; i++) { + loadChoiceInput(choice.inputsList, view_as(inputsList.Get(i))); + } + delete inputsList; + } + if(choiceData.HasKey("force_scenes")) { + JSONArray scenes = view_as(choiceData.Get("force_scenes")); + char sceneId[32]; + for(int i = 0; i < scenes.Length; i++) { + scenes.GetString(i, sceneId, sizeof(sceneId)); + choice.forcedScenes.PushString(sceneId); + Debug("scene %s: require %s", scene.name, sceneId); + } + delete scenes; + } + scene.variants.PushArray(choice); +} + +void loadChoiceInput(ArrayList list, JSONObject inputData) { + VariantInputData input; + input.type = Input_Classname; + // Check classname -> targetname -> hammerid + if(!inputData.GetString("classname", input.name, sizeof(input.name))) { + if(inputData.GetString("targetname", input.name, sizeof(input.name))) { + input.type = Input_Targetname; + } else { + if(inputData.GetString("hammerid", input.name, sizeof(input.name))) { + input.type = Input_HammerId; + } else { + int id = inputData.GetInt("hammerid"); + if(id > 0) { + input.type = Input_HammerId; + IntToString(id, input.name, sizeof(input.name)); + } else { + LogError("Missing valid input specification (hammerid, classname, targetname)"); + return; + } + } + } + } + inputData.GetString("input", input.input, sizeof(input.input)); + list.PushArray(input); +} + +void loadLumpData(ArrayList list, JSONObject inputData) { + LumpEditData input; + // Check classname -> targetname -> hammerid + if(!inputData.GetString("classname", input.name, sizeof(input.name))) { + if(inputData.GetString("targetname", input.name, sizeof(input.name))) { + input.type = Input_Targetname; + } else { + if(inputData.GetString("hammerid", input.name, sizeof(input.name))) { + input.type = Input_HammerId; + } else { + int id = inputData.GetInt("hammerid"); + if(id > 0) { + input.type = Input_HammerId; + IntToString(id, input.name, sizeof(input.name)); + } else { + LogError("Missing valid input specification (hammerid, classname, targetname)"); + return; + } + } + } + } + inputData.GetString("action", input.action, sizeof(input.action)); + inputData.GetString("value", input.value, sizeof(input.value)); + list.PushArray(input); +} + +void loadChoiceEntity(ArrayList list, JSONObject entityData) { + VariantEntityData entity; + entityData.GetString("model", entity.model, sizeof(entity.model)); + if(entityData.GetString("targetname", entity.targetname, sizeof(entity.targetname))) { + Format(entity.targetname, sizeof(entity.targetname), "randomizer_%s", entity.targetname); + } + if(!entityData.GetString("type", entity.type, sizeof(entity.type))) { + entity.type = "prop_dynamic"; + } /*else if(entity.type[0] == '_') { + LogError("Invalid custom entity type \"%s\"", entity.type); + return; + }*/ + + if(StrEqual(entity.type, "move_rope")) { + if(!entityData.HasKey("keyframes")) { + LogError("move_rope entity is missing keyframes: Vec[] property"); + return; + } + entity.keyframes = new ArrayList(3); + JSONArray keyframesData = view_as(entityData.Get("keyframes")); + float vec[3]; + for(int i = 0 ; i < keyframesData.Length; i++) { + JSONArray vecArray = view_as(keyframesData.Get(i)); + vec[0] = vecArray.GetFloat(0); + vec[1] = vecArray.GetFloat(1); + vec[2] = vecArray.GetFloat(2); + entity.keyframes.PushArray(vec); + } + } + GetVector(entityData, "origin", entity.origin); + GetVector(entityData, "angles", entity.angles); + GetVector(entityData, "scale", entity.scale); + GetColor(entityData, "color", entity.color, DEFAULT_COLOR); + if(entityData.HasKey("properties")) { + JSONObject propRoot = view_as(entityData.Get("properties")); + if(propRoot.HasKey("int")) entity.properties.intKv = view_as(propRoot.Get("int")); + if(propRoot.HasKey("float")) entity.properties.floatKv = view_as(propRoot.Get("float")); + if(propRoot.HasKey("string")) entity.properties.stringKv = view_as(propRoot.Get("string")); + } + list.PushArray(entity); +} \ No newline at end of file diff --git a/scripting/include/randomizer/select_functions.sp b/scripting/include/randomizer/select_functions.sp new file mode 100644 index 0000000..4db1730 --- /dev/null +++ b/scripting/include/randomizer/select_functions.sp @@ -0,0 +1,230 @@ +bool IsTraverseMapA(const char[] map) { + return String_EndsWith(map, "_a"); +} +bool IsTraverseMapB(const char[] map) { + // c4m1_milltown_a was added twice so _escape can pop it off and re-use + return StrEqual(map, "c4m5_milltown_escape") || String_EndsWith(map, "_b"); +} + +public bool LoadRunGlobalMap(const char[] map, int flags) { + // Unless FLAG_IGNORE_TRAVERSE_STORE, if the map is the _b variant, then load the stored _a value + SceneSelection selection; + // Only load map data if we don't already have it + if(g_MapData.scenes == null || g_selection == null || flags & view_as(FLAG_REFRESH)) { + if(~flags & view_as(FLAG_IGNORE_TRAVERSE_STORE) && IsTraverseMapB(map) ) { + Log("LoadRunGlobal: Trying to load traverse selection"); + TraverseData traverse; + if(PopTraverseSelection(traverse)) { + Debug("traverse map: %s", traverse.map); + // Try Load the A variant + if(LoadGlobalMapData(traverse.map, flags)) { + selection = view_as(traverse.selection); + } + } + } + if(selection == null) { + // This is called if not traverse map or previous data not found + Log("LoadRunGlobal: Loading & generating selection"); + if(!LoadGlobalMapData(map, flags)) { + return false; + } + selection = selectScenes(g_MapData, flags); + } + } + if(selection == null) { + LogError("LoadRunGlobalMap: No selection was loaded"); + } + + g_selection = selection; + + return g_MapData.ApplySelection(selection, flags); +} + +void trySelectScene(SceneSelection selection, SceneData scene, int flags) { + // Use the .chance field unless FLAG_ALL_SCENES or FLAG_FORCE_ACTIVE is set + if(~flags & view_as(FLAG_ALL_SCENES) && ~flags & view_as(FLAG_FORCE_ACTIVE) && GetURandomFloat() > scene.chance) { + return; + } + + if(scene.variants.Length == 0) { + LogError("Warn: No variants were found for scene \"%s\"", scene.name); + return; + } + + // TODO: select variant... + SelectedSceneData aScene; + aScene.name = scene.name; + aScene.selectedVariantIndexes = new ArrayList(); + + ArrayList choices = new ArrayList(); + SceneVariantData choice; + int chosenIndex; + Debug("Scene %s has %d variants", scene.name, scene.variants.Length); + // Weighted random: Push N times dependent on weight + for(int i = 0; i < scene.variants.Length; i++) { + scene.variants.GetArray(i, choice); + if(flags & view_as(FLAG_ALL_VARIANTS)) { + aScene.selectedVariantIndexes.Push(i); + } else { + if(choice.weight <= 0) { + PrintToServer("Warn: Variant %d in scene %s has invalid weight", i, scene.name); + continue; + } + for(int c = 0; c < choice.weight; c++) { + choices.Push(i); + } + } + } + + if(flags & view_as(FLAG_ALL_VARIANTS)) { + + } else if(choices.Length > 0) { + // Pick a random variant from list + chosenIndex = GetURandomInt() % choices.Length; + chosenIndex = choices.Get(chosenIndex); + Log("Chosen scene \"%s\" with variant #%d", scene.name, chosenIndex); + + aScene.selectedVariantIndexes.Push(chosenIndex); + } + delete choices; + + selection.AddScene(aScene); +} + +void selectGroups(SceneSelection selection, MapData data, int flags) { + StringMapSnapshot snapshot = data.groups.Snapshot(); + char key[MAX_SCENE_NAME_LENGTH]; + ArrayList groupList; + SceneData scene; + for(int i = 0; i < snapshot.Length; i++) { + snapshot.GetKey(i, key, sizeof(key)); + data.groups.GetValue(key, groupList); + + // Select a random scene from the group: + int index = GetURandomInt() % groupList.Length; + index = groupList.Get(index); + data.scenes.GetArray(index, scene); + + Debug("Selected scene \"%s\" for group %s (%d members)", scene.name, key, groupList.Length); + trySelectScene(selection, scene, flags); + delete groupList; + } + delete snapshot; +} + +void selectForcedScenes(SceneSelection selection, MapData data, int flags) { + // Traverse active scenes, loading any other scene it requires (via .force_scenes) + SelectedSceneData aScene; + SceneVariantData choice; + SceneData scene; + // list of scenes that will need to be forced if not already: + ArrayList forcedScenes = new ArrayList(ByteCountToCells(MAX_SCENE_NAME_LENGTH)); + char key[MAX_SCENE_NAME_LENGTH]; + for(int i = 0; i < selection.Count; i++) { + selection.Get(i, aScene); + // Load scene from active scene entry + if(!data.scenesKv.GetArray(aScene.name, scene, sizeof(scene))) { + // this shouldn't happen + Log("WARN: scene \"%s\" not found in scene selection", aScene.name); + // can't find scene, ignore + continue; + } + for(int v = 0; v < aScene.selectedVariantIndexes.Length; v++) { + aScene.selectedVariantIndexes.GetArray(v, choice); + // If the choice has forced scenes + if(choice.forcedScenes != null) { + // Add each scene to the list to be added + for(int j = 0; j < choice.forcedScenes.Length; j++) { + choice.forcedScenes.GetString(j, key, sizeof(key)); + forcedScenes.PushString(key); + } + } + } + } + + if(forcedScenes.Length > 0) { + Debug("Loading %d forced scenes", forcedScenes.Length); + } + // Iterate and activate any forced scenes + for(int i = 0; i < forcedScenes.Length; i++) { + forcedScenes.GetString(i, key, sizeof(key)); + // Check if scene was already loaded + bool isSceneAlreadyLoaded = false; + for(int j = 0; j < data.activeScenes.Length; j++) { + data.activeScenes.GetArray(j, aScene); + if(StrEqual(aScene.name, key)) { + isSceneAlreadyLoaded = true; + break; + } + } + if(isSceneAlreadyLoaded) continue; + data.scenesKv.GetArray(key, scene, sizeof(scene)); + trySelectScene(selection, scene, flags | view_as(FLAG_FORCE_ACTIVE)); + } + delete forcedScenes; +} + +// Selects what scenes and its variants to apply and returns list - does not activate +SceneSelection selectScenes(MapData data, int flags = 0) { + SceneData scene; + SceneSelection selection = new SceneSelection(); + + Profiler profiler = new Profiler(); + profiler.Start(); + + for(int i = 0; i < data.scenes.Length; i++) { + data.scenes.GetArray(i, scene); + if(scene.group[0] == '\0') { + trySelectScene(selection, scene, flags); + } + } + selectGroups(selection, data, flags); + selectForcedScenes(selection, data, flags); + + profiler.Stop(); + Log("Done generating selection in %.4f seconds", profiler.Time); + return selection; +} + +void spawnGascans(MapData data) { + if(data.gascanSpawners != null && data.gascanSpawners.Length > 0) { + // Iterate through every gascan until we run out - picking a random spawner each time + int entity = -1; + char targetname[9]; + GascanSpawnerData spawner; + int spawnerCount = data.gascanSpawners.Length; + int count; + while((entity = FindEntityByClassname(entity, "weapon_gascan")) != INVALID_ENT_REFERENCE) { + GetEntPropString(entity, Prop_Data, "m_iName", targetname, sizeof(targetname)); + int hammerid = GetEntProp(entity, Prop_Data, "m_iHammerID"); + int glowColor = GetEntProp(entity, Prop_Send, "m_glowColorOverride"); // check if white + if(hammerid == 0 && glowColor == 16777215 && targetname[0] == '\0' && !g_gascanSpawners.ContainsKey(entity)) { + // Found a valid gascan, apply a random spawner + int spawnerIndex = GetRandomInt(0, data.gascanSpawners.Length - 1); + data.gascanSpawners.GetArray(spawnerIndex, spawner); + data.gascanSpawners.Erase(spawnerIndex); // only want one can to use this spawner + + AssignGascan(entity, spawner); + count++; + } + } + Debug("Assigned %d gascans to %d spawners", count, spawnerCount); + } +} + +void activateVariant(SceneVariantData choice, int flags) { + #pragma unused flags + VariantEntityData entity; + for(int i = 0; i < choice.entities.Length; i++) { + choice.entities.GetArray(i, entity); + spawnEntity(entity); + } + + if(choice.inputsList.Length > 0) { + VariantInputData input; + for(int i = 0; i < choice.inputsList.Length; i++) { + choice.inputsList.GetArray(i, input); + input.Trigger(); + } + } +} diff --git a/scripting/include/randomizer/util.sp b/scripting/include/randomizer/util.sp new file mode 100644 index 0000000..60b5641 --- /dev/null +++ b/scripting/include/randomizer/util.sp @@ -0,0 +1,40 @@ +public bool GetVector(JSONObject obj, const char[] key, float out[3]) { + if(!obj.HasKey(key)) return false; + JSONArray vecArray = view_as(obj.Get(key)); + if(vecArray != null) { + out[0] = vecArray.GetFloat(0); + out[1] = vecArray.GetFloat(1); + out[2] = vecArray.GetFloat(2); + } + return true; +} + +public void GetColor(JSONObject obj, const char[] key, int out[4], int defaultColor[4]) { + if(obj.HasKey(key)) { + JSONArray vecArray = view_as(obj.Get(key)); + out[0] = vecArray.GetInt(0); + out[1] = vecArray.GetInt(1); + out[2] = vecArray.GetInt(2); + if(vecArray.Length == 4) + out[3] = vecArray.GetInt(3); + else + out[3] = 255; + } else { + out = defaultColor; + } +} + +stock JSONArray FromFloatArray(float[] vec, int count) { + JSONArray arr = new JSONArray(); + for(int i = 0 ; i < count; i++) { + arr.PushFloat(vec[i]); + } + return arr; +} +stock JSONArray FromIntArray(int[] vec, int count) { + JSONArray arr = new JSONArray(); + for(int i = 0 ; i < count; i++) { + arr.PushInt(vec[i]); + } + return arr; +} \ No newline at end of file diff --git a/scripting/l4d2_extraplayeritems.sp b/scripting/l4d2_extraplayeritems.sp index 22157e0..7c0080c 100644 --- a/scripting/l4d2_extraplayeritems.sp +++ b/scripting/l4d2_extraplayeritems.sp @@ -55,11 +55,6 @@ #undef REQUIRE_PLUGIN #include -#define L4D2_WEPUPGFLAG_NONE (0 << 0) -#define L4D2_WEPUPGFLAG_INCENDIARY (1 << 0) -#define L4D2_WEPUPGFLAG_EXPLOSIVE (1 << 1) -#define L4D2_WEPUPGFLAG_LASER (1 << 2) - #define AMMOPACK_ENTID 0 #define AMMOPACK_USERS 1 @@ -1779,7 +1774,7 @@ Action Timer_UpdateHud(Handle h) { void PopulateItems() { if(g_areItemsPopulated) return; UpdateSurvivorCount(); - PrintToServer("[EPI:TEMP] PopulateItems hasRan=%b finale=%b willRun=%b players=%d", g_areItemsPopulated, L4D_IsMissionFinalMap(true), !g_areItemsPopulated&&IsEPIActive, g_realSurvivorCount); + PrintToServer("[EPI:TEMP] PopulateItems hasRan=%b finale=%b willRun=%b players=%d", g_areItemsPopulated, L4D_IsMissionFinalMap(true), !g_areItemsPopulated&&IsEPIActive(), g_realSurvivorCount); if(!IsEPIActive()) return; g_areItemsPopulated = true; @@ -1821,6 +1816,20 @@ void PopulateItems() { PopulateCabinets(); } +int CalculateExtraDefibCount() { + if(L4D_IsMissionFinalMap()) { + int maxCount = g_survivorCount - 4; + if(maxCount < 0) maxCount = 0; + + return DiceRoll(0, maxCount, 2, BIAS_LEFT); + } else if(g_survivorCount > 4) { + float chance = float(g_survivorCount) / 64.0; + return GetRandomFloat() > chance ? 1 : 0; + } else { + return 0; + } +} + void PopulateItemSpawns(int minWalls = 4) { ArrayList navs = new ArrayList(); L4D_GetAllNavAreas(navs); @@ -1837,6 +1846,9 @@ void PopulateItemSpawns(int minWalls = 4) { float mapFlowMax = L4D2Direct_GetMapMaxFlowDistance(); PrintToServer("[EPI] PopulateItemSpawns: flow[0, %f]", mapFlowMax); int maxSpawns = RoundFloat(mapFlowMax / MAX_RANDOM_SPAWNS); + int defibCount = CalculateExtraDefibCount(); + bool isFinale = L4D_IsMissionFinalMap(); + for(int i = 0; i < navs.Length; i++) { Address nav = navs.Get(i); int spawnFlags = L4D_GetNavArea_SpawnAttributes(nav); @@ -1866,8 +1878,19 @@ void PopulateItemSpawns(int minWalls = 4) { } if(wpn == -1) continue; if(++count >= maxSpawns) break; + } else if(defibCount > 0) { + if(isFinale) { + if(spawnFlags & NAV_SPAWN_FINALE) { + CreateWeaponSpawn(pos, "weapon_defibrilator", tier); + defibCount--; + } + } else { + CreateWeaponSpawn(pos, "weapon_defibrilator", tier); + defibCount--; + } } } + } } PrintToServer("[EPI] Spawned %d/%d new item spawns (tier=%d)", count, maxSpawns, tier); diff --git a/scripting/l4d2_randomizer.sp b/scripting/l4d2_randomizer.sp index 60c1086..6e60c7a 100644 --- a/scripting/l4d2_randomizer.sp +++ b/scripting/l4d2_randomizer.sp @@ -18,99 +18,27 @@ #undef REQUIRE_PLUGIN #include -int g_iLaserIndex; +#include + #if defined DEBUG_BLOCKERS #include #endif +#include #define ENT_PROP_NAME "randomizer" #define ENT_ENV_NAME "randomizer" #define ENT_BLOCKER_NAME "randomizer" #include -#define MAX_SCENE_NAME_LENGTH 32 -#define MAX_INPUTS_CLASSNAME_LENGTH 64 +ConVar cvarEnabled; // is map enabled - -ConVar cvarEnabled; -enum struct ActiveSceneData { - char name[MAX_SCENE_NAME_LENGTH]; - int variantIndex; -} -MapData g_MapData; -BuilderData g_builder; char currentMap[64]; -static int _ropeIndex; -enum struct GascanSpawnerData { - float origin[3]; - float angles[3]; -} -ArrayList g_gascanRespawnQueue; -AnyMap g_gascanSpawners; +bool randomizerRan = false; -enum struct BuilderData { - JSONObject mapData; - - JSONObject selectedSceneData; - char selectedSceneId[64]; - - JSONObject selectedVariantData; - int selectedVariantIndex; - - void Cleanup() { - this.selectedSceneData = null; - this.selectedVariantData = null; - this.selectedVariantIndex = -1; - this.selectedSceneId[0] = '\0'; - if(this.mapData != null) - delete this.mapData; - // JSONcleanup_and_delete(this.mapData); - } - - bool SelectScene(const char[] group) { - if(!g_builder.mapData.HasKey(group)) return false; - this.selectedSceneData = view_as(g_builder.mapData.Get(group)); - strcopy(this.selectedSceneId, sizeof(this.selectedSceneId), group); - return true; - } - - /** - * Select a variant, enter -1 to not select any (scene's entities) - */ - bool SelectVariant(int index = -1) { - if(this.selectedSceneData == null) LogError("SelectVariant called, but no group selected"); - JSONArray variants = view_as(this.selectedSceneData.Get("variants")); - if(index >= variants.Length) return false; - else if(index < -1) return false; - else if(index > -1) { - this.selectedVariantData = view_as(variants.Get(index)); - } else { - this.selectedVariantData = null; - } - this.selectedVariantIndex = index; - return true; - } - - void AddEntity(int entity, ExportType exportType = Export_Model) { - JSONObject entityData = ExportEntity(entity, exportType); - this.AddEntityData(entityData); - } - - void AddEntityData(JSONObject entityData) { - JSONArray entities; - if(g_builder.selectedVariantData == null) { - // Create .entities if doesn't exist: - if(!g_builder.selectedSceneData.HasKey("entities")) { - g_builder.selectedSceneData.Set("entities", new JSONArray()); - } - entities = view_as(g_builder.selectedSceneData.Get("entities")); - } else { - entities = view_as(g_builder.selectedVariantData.Get("entities")); - } - entities.Push(entityData); - } -} +#include +#include +#include #include #include @@ -129,21 +57,25 @@ public void OnPluginStart() { SetFailState("This plugin is for L4D/L4D2 only."); } - HookEvent("round_start_post_nav", Event_RoundStartPostNav); RegAdminCmd("sm_rcycle", Command_CycleRandom, ADMFLAG_CHEATS); RegAdminCmd("sm_expent", Command_ExportEnt, ADMFLAG_GENERIC); RegAdminCmd("sm_rbuild", Command_RandomizerBuild, ADMFLAG_CHEATS); + RegAdminCmd("sm_randomizer", Command_Debug, ADMFLAG_GENERIC); cvarEnabled = CreateConVar("sm_randomizer_enabled", "0"); HookEvent("player_first_spawn", Event_PlayerFirstSpawn); + HookEvent("game_end", Event_GameEnd); - g_MapData.activeScenes = new ArrayList(sizeof(ActiveSceneData)); - g_gascanSpawners = new AnyMap(); + InitGlobals(); +} + +void Event_GameEnd(Event event, const char[] name ,bool dontBroadcast) { + // Purge the traverse stack after a campaign is played + ClearTraverseStack(); } -bool randomizerRan = false; void Event_PlayerFirstSpawn(Event event, const char[] name ,bool dontBroadcast) { if(!randomizerRan) { @@ -158,40 +90,32 @@ void Event_PlayerFirstSpawn(Event event, const char[] name ,bool dontBroadcast) } } -void Event_RoundStartPostNav(Event event, const char[] name ,bool dontBroadcast) { - // if(cvarEnabled.BoolValue) - // CreateTimer(15.0, Timer_Run); -} - -// TODO: on round start public void OnMapStart() { g_iLaserIndex = PrecacheModel("materials/sprites/laserbeam.vmt", true); GetCurrentMap(currentMap, sizeof(currentMap)); -} + // We wait a while before running to prevent some edge cases i don't remember +} public void OnMapEnd() { randomizerRan = false; g_builder.Cleanup(); - Cleanup(); -} - -public void OnMapInit(const char[] map) { - // if(cvarEnabled.BoolValue) { - // if(LoadMapData(currentMap, FLAG_NONE) && g_MapData.lumpEdits.Length > 0) { - // Log("Found %d lump edits, running...", g_MapData.lumpEdits.Length); - // LumpEditData lump; - // for(int i = 0; i < g_MapData.lumpEdits.Length; i++) { - // g_MapData.lumpEdits.GetArray(i, lump); - // lump.Trigger(); - // } - // hasRan = true; - // } - // } -} - -public void OnConfigsExecuted() { + // For maps that players traverse backwards, like hard rain (c4m1_milltown_a -> c4m3_milltown_b ) + // We store the selection of the _a map, to later be loaded for _b maps + // This is done at end of map just in case a user re-runs the cycle and generates a different selection + if(g_selection != null) { + if(IsTraverseMapA(currentMap)) { + Log("Storing %s in map traversal store", currentMap); + StoreTraverseSelection(currentMap, g_selection); + } + // We want to store milltown_a twice, so the c4m5_milltown_escape can also pop it off + if(StrEqual(currentMap, "c4m1_milltown_a")) { + StoreTraverseSelection(currentMap, g_selection); + } + } + // don't clear entities because they will be deleted anyway (and errors if you tryq) + Cleanup(false); } public void OnEntityCreated(int entity, const char[] classname) { @@ -211,8 +135,9 @@ void Frame_RandomizeGascan(int gascan) { } Action Timer_Run(Handle h) { - if(cvarEnabled.BoolValue) - RunMap(currentMap, FLAG_NONE); + if(cvarEnabled.BoolValue) { + LoadRunGlobalMap(currentMap, FLAG_NONE); + } return Plugin_Handled; } @@ -238,27 +163,110 @@ stock int GetLookingPosition(int client, TraceEntityFilter filter, float pos[3]) } return -1; } +Action Command_Debug(int client, int args) { + // TODO is builder active, selection active, list of traverse pool, can pool + if(args > 0) { + char arg[32]; + GetCmdArg(1, arg, sizeof(arg)); + if(StrEqual(arg, "scenes")) { + if(g_MapData.IsLoaded()) { + StringMapSnapshot snapshot = g_MapData.scenesKv.Snapshot(); + char buffer[MAX_SCENE_NAME_LENGTH]; + for(int i = 0; i < snapshot.Length; i++) { + snapshot.GetKey(i, buffer, sizeof(buffer)); + ReplyToCommand(client, "%d. %s", i, buffer); + } + delete snapshot; + } else { + ReplyToCommand(client, "No map data loaded"); + } + } if(StrEqual(arg, "traverse")) { + TraverseData trav; + for(int i = 0; i < g_mapTraverseSelectionStack.Length; i++) { + g_mapTraverseSelectionStack.GetArray(i, trav, sizeof(trav)); + if(trav.selection == null) { + ReplyToCommand(client, " #%d - %s: ERROR", i, trav.map); + } else { + ReplyToCommand(client, " #%d - %s: %d scenes", i, trav.map, trav.selection.Length); + } + } + } else if(StrEqual(arg, "store")) { + char buffer[64]; + if(args == 1) { + strcopy(buffer, sizeof(buffer), currentMap); + } else { + GetCmdArg(2, buffer, sizeof(buffer)); + } + StoreTraverseSelection(buffer, g_selection); + ReplyToCommand(client, "Stored current selection as %s", buffer); + } /*else if(StrEqual(arg, "identify")) { + if(args == 1) { + ReplyToCommand(client, "Specify scene name"); + } else if(!g_MapData.IsLoaded()) { + ReplyToCommand(client, "No map data loaded"); + } else { + GetCmdArg(2, arg, sizeof(arg)); + SceneData scene; + g_MapData.sceneKv.GetArray() + } + }*/ + else { + ReplyToCommand(client, "unknown subcommand"); + } + return Plugin_Handled; + } + ReplyToCommand(client, "Enabled: %b", cvarEnabled.BoolValue); + ReplyToCommand(client, "Map Data: %s", g_MapData.IsLoaded() ? "Loaded" : "-"); + if(g_selection != null) { + ReplyToCommand(client, "Scene Selection: %d selected", g_selection.Count); + } else { + ReplyToCommand(client, "Scene Selection: -"); + } + ReplyToCommand(client, "Builder Data: %s", g_builder.IsLoaded() ? "Loaded" : "-"); + ReplyToCommand(client, "Traverse Store: count=%d", g_mapTraverseSelectionStack.Length); + if(g_gascanRespawnQueue != null) { + ReplyToCommand(client, "Gascan Spawners: count=%d queue_size=%d", g_gascanSpawners.Size, g_gascanRespawnQueue.Length); + } else { + ReplyToCommand(client, "Gascan Spawners: count=%d queue_size=-", g_gascanSpawners.Size); + } + return Plugin_Handled; +} public Action Command_CycleRandom(int client, int args) { if(args > 0) { DeleteCustomEnts(); int flags = GetCmdArgInt(1); - if(flags != -1) { - RunMap(currentMap, flags | view_as(FLAG_REFRESH)); + if(flags < 0) { + ReplyToCommand(client, "Invalid flags"); + } else { + if(args > 1) { + char buffer[64]; + GetCmdArg(2, buffer, sizeof(buffer)); + LoadRunGlobalMap(buffer, flags | view_as(FLAG_REFRESH)); + PrintCenterText(client, "Cycled %s flags=%d", buffer, flags); + } else { + LoadRunGlobalMap(currentMap, flags | view_as(FLAG_REFRESH)); + } + if(client > 0) + PrintCenterText(client, "Cycled flags=%d", flags); } - if(client > 0) - PrintCenterText(client, "Cycled flags=%d", flags); } else { - if(g_MapData.activeScenes == null) { - ReplyToCommand(client, "No map data"); + if(g_selection == null) { + ReplyToCommand(client, "No map selection active"); return Plugin_Handled; } - ReplyToCommand(client, "Active Scenes (%d/%d):", g_MapData.activeScenes.Length, g_MapData.scenes.Length); - ActiveSceneData scene; - for(int i = 0; i < g_MapData.activeScenes.Length; i++) { - g_MapData.activeScenes.GetArray(i, scene); - ReplyToCommand(client, "\t%s: variant #%d", scene.name, scene.variantIndex); + ReplyToCommand(client, "Active Scenes (%d/%d):", g_selection.Count, g_MapData.scenes.Length); + SelectedSceneData aScene; + char buffer[32]; + for(int i = 0; i < g_selection.Count; i++) { + g_selection.Get(i, aScene); + buffer[0] = '\0'; + for(int v = 0; v < aScene.selectedVariantIndexes.Length; v++) { + int index = aScene.selectedVariantIndexes.Get(v); + Format(buffer, sizeof(buffer), "#%d ", index); + } + ReplyToCommand(client, "\t%s: variants %s", aScene.name, buffer); } } return Plugin_Handled; @@ -391,7 +399,6 @@ Action Command_RandomizerBuild(int client, int args) { ReplyToCommand(client, "Please load map data, select a scene and a variant."); return Plugin_Handled; } - float origin[3]; char arg1[32]; int entity = GetCmdArgInt(2); if(entity <= 0 && !IsValidEntity(entity)) { @@ -420,7 +427,7 @@ Action Command_RandomizerBuild(int client, int args) { Effect_DrawBeamBoxRotatableToAll(pos, { -5.0, -5.0, -5.0}, { 5.0, 5.0, 5.0}, NULL_VECTOR, g_iLaserIndex, 0, 0, 0, 40.0, 0.1, 0.1, 0, 0.0, {73, 0, 130, 255}, 0); JSONObject obj = new JSONObject(); obj.SetString("type", "infodecal"); - obj.Set("origin", VecToArray(pos)); + obj.Set("origin", FromFloatArray(pos, 3)); obj.SetString("model", "decals/checkpointarrow01_black.vmt"); g_builder.AddEntityData(obj); ReplyToCommand(client, "Added sprite to variant #%d", g_builder.selectedVariantIndex); @@ -433,7 +440,7 @@ Action Command_RandomizerBuild(int client, int args) { GetLookingPosition(client, Filter_IgnorePlayer, pos); JSONObject obj = new JSONObject(); obj.SetString("type", "env_fire"); - obj.Set("origin", VecToArray(pos)); + obj.Set("origin", FromFloatArray(pos, 3)); g_builder.AddEntityData(obj); ReplyToCommand(client, "Added fire to variant #%d", g_builder.selectedVariantIndex); } else if(StrEqual(arg, "light")) { @@ -461,7 +468,7 @@ Action Command_RandomizerBuild(int client, int args) { } float pos[3]; float scale[3] = { 15.0, 30.0, 100.0 }; - GetLookingPosition(client, Filter_IgnorePlayer, pos); + GetClientAbsOrigin(client, pos); JSONObject obj = new JSONObject(); obj.SetString("type", "env_player_blocker"); obj.Set("origin", FromFloatArray(pos, 3)); @@ -511,7 +518,7 @@ JSONObject ExportEntity(int entity, ExportType exportType = Export_Model) { JSONObject entityData = new JSONObject(); GetEntityClassname(entity, classname, sizeof(classname)); if(StrContains(classname, "prop_") == -1) { - entityData.Set("scale", VecToArray(size)); + entityData.Set("scale", FromFloatArray(size, 3)); } if(exportType == Export_HammerId) { int hammerid = GetEntProp(entity, Prop_Data, "m_iHammerID"); @@ -528,8 +535,8 @@ JSONObject ExportEntity(int entity, ExportType exportType = Export_Model) { entityData.SetString("type", classname); entityData.SetString("model", model); } - entityData.Set("origin", VecToArray(origin)); - entityData.Set("angles", VecToArray(angles)); + entityData.Set("origin", FromFloatArray(origin, 3)); + entityData.Set("angles", FromFloatArray(angles, 3)); return entityData; } JSONObject ExportEntityInput(int entity, const char[] input) { @@ -608,27 +615,7 @@ void OnSelectorDone(int client, ArrayList entities) { } } -JSONArray VecToArray(float vec[3]) { - JSONArray arr = new JSONArray(); - arr.PushFloat(vec[0]); - arr.PushFloat(vec[1]); - arr.PushFloat(vec[2]); - return arr; -} -JSONArray FromFloatArray(float[] vec, int count) { - JSONArray arr = new JSONArray(); - for(int i = 0 ; i < count; i++) { - arr.PushFloat(vec[i]); - } - return arr; -} -JSONArray FromIntArray(int[] vec, int count) { - JSONArray arr = new JSONArray(); - for(int i = 0 ; i < count; i++) { - arr.PushInt(vec[i]); - } - return arr; -} + void Command_RandomizerBuild_Scenes(int client, int args) { char arg[16]; @@ -690,6 +677,7 @@ void Command_RandomizerBuild_Scenes(int client, int args) { } void Command_RandomizerBuild_Variants(int client, int args) { + #pragma unused args if(g_builder.selectedSceneId[0] == '\0') { ReplyToCommand(client, "No scene selected, select with /rbuild groups select "); return; @@ -731,684 +719,12 @@ void Command_RandomizerBuild_Variants(int client, int args) { } } - -enum struct SceneData { - char name[MAX_SCENE_NAME_LENGTH]; - float chance; - char group[MAX_SCENE_NAME_LENGTH]; - ArrayList variants; - - void Cleanup() { - g_MapData.activeScenes.Clear(); - SceneVariantData choice; - for(int i = 0; i < this.variants.Length; i++) { - this.variants.GetArray(i, choice); - choice.Cleanup(); - } - delete this.variants; - } -} - -enum struct SceneVariantData { - int weight; - ArrayList inputsList; - ArrayList entities; - ArrayList forcedScenes; - - void Cleanup() { - delete this.inputsList; - delete this.entities; - delete this.forcedScenes; - } -} - -enum struct VariantEntityData { - char type[32]; - char model[128]; - char targetname[128]; - float origin[3]; - float angles[3]; - float scale[3]; - int color[4]; - - ArrayList keyframes; -} - -enum InputType { - Input_Classname, - Input_Targetname, - Input_HammerId -} -enum struct VariantInputData { - char name[MAX_INPUTS_CLASSNAME_LENGTH]; - InputType type; - char input[64]; - - void Trigger() { - int entity = -1; - switch(this.type) { - case Input_Classname: { - while((entity = FindEntityByClassname(entity, this.name)) != INVALID_ENT_REFERENCE) { - this._trigger(entity); - } - } - case Input_Targetname: { - char targetname[64]; - int count = 0; - while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) { - GetEntPropString(entity, Prop_Data, "m_iName", targetname, sizeof(targetname)); - if(StrEqual(targetname, this.name)) { - this._trigger(entity); - count++; - } - } - if(count == 0) { - PrintToServer("[Randomizer::WARN] Input TargetName=\"%s\" matched 0 entties", this.name); - } - } - case Input_HammerId: { - int targetId = StringToInt(this.name); - int count = 0; - while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) { - int hammerId = GetEntProp(entity, Prop_Data, "m_iHammerID"); - if(hammerId == targetId ) { - this._trigger(entity); - count++; - break; - } - } - if(count == 0) { - PrintToServer("[Randomizer::WARN] Input HammerId=%d matched 0 entties", targetId); - } - } - } - } - - void _trigger(int entity) { - if(entity > 0 && IsValidEntity(entity)) { - if(StrEqual(this.input, "_allow_ladder")) { - if(HasEntProp(entity, Prop_Send, "m_iTeamNum")) { - SetEntProp(entity, Prop_Send, "m_iTeamNum", 0); - } else { - Log("Warn: Entity (%d) with id \"%s\" has no teamnum for \"_allow_ladder\"", entity, this.name); - } - } else if(StrEqual(this.input, "_lock")) { - AcceptEntityInput(entity, "Close"); - AcceptEntityInput(entity, "Lock"); - } else if(StrEqual(this.input, "_lock_nobreak")) { - AcceptEntityInput(entity, "Close"); - AcceptEntityInput(entity, "Lock"); - AcceptEntityInput(entity, "SetUnbreakable"); - } else { - char cmd[32]; - // Split input "a b" to a with variant "b" - int len = SplitString(this.input, " ", cmd, sizeof(cmd)); - if(len > -1) { - SetVariantString(this.input[len]); - AcceptEntityInput(entity, cmd); - Debug("_trigger(%d): %s (v=%s)", entity, cmd, this.input[len]); - } else { - Debug("_trigger(%d): %s", entity, this.input); - AcceptEntityInput(entity, this.input); - } - - } - } - } -} - -enum struct LumpEditData { - char name[MAX_INPUTS_CLASSNAME_LENGTH]; - InputType type; - char action[32]; - char value[64]; - - int _findLumpIndex(int startIndex = 0, EntityLumpEntry entry) { - int length = EntityLump.Length(); - char val[64]; - Debug("Scanning for \"%s\" (type=%d)", this.name, this.type); - for(int i = startIndex; i < length; i++) { - entry = EntityLump.Get(i); - int index = entry.FindKey("hammerid"); - if(index != -1) { - entry.Get(index, "", 0, val, sizeof(val)); - if(StrEqual(val, this.name)) { - return i; - } - } - - index = entry.FindKey("classname"); - if(index != -1) { - entry.Get(index, "", 0, val, sizeof(val)); - Debug("%s vs %s", val, this.name); - if(StrEqual(val, this.name)) { - return i; - } - } - - index = entry.FindKey("targetname"); - if(index != -1) { - entry.Get(index, "", 0, val, sizeof(val)); - if(StrEqual(val, this.name)) { - return i; - } - } - delete entry; - } - Log("Warn: Could not find any matching lump for \"%s\" (type=%d)", this.name, this.type); - return -1; - } - - void Trigger() { - int index = 0; - EntityLumpEntry entry; - while((index = this._findLumpIndex(index, entry) != -1)) { - // for(int i = 0; i < entry.Length; i++) { - // entry.Get(i, a, sizeof(a), v, sizeof(v)); - // Debug("%s=%s", a, v); - // } - this._trigger(entry); - } - } - - void _updateKey(EntityLumpEntry entry, const char[] key, const char[] value) { - int index = entry.FindKey(key); - if(index != -1) { - Debug("update key %s = %s", key, value); - entry.Update(index, key, value); - } - } - - void _trigger(EntityLumpEntry entry) { - if(StrEqual(this.action, "setclassname")) { - this._updateKey(entry, "classname", this.value); - } - - delete entry; - } -} - -enum struct MapData { - StringMap scenesKv; - ArrayList scenes; - ArrayList lumpEdits; - ArrayList activeScenes; - ArrayList gascanSpawners; -} - -enum loadFlags { - FLAG_NONE = 0, - FLAG_ALL_SCENES = 1, // Pick all scenes, no random chance - FLAG_ALL_VARIANTS = 2, // Pick all variants (for debug purposes), - FLAG_REFRESH = 4, // Load data bypassing cache - FLAG_FORCE_ACTIVE = 8 // Similar to ALL_SCENES, bypasses % chance -} - -// Reads (mapname).json file and parses it -public JSONObject LoadMapJson(const char[] map) { - Debug("Loading config for %s", map); - char filePath[PLATFORM_MAX_PATH]; - BuildPath(Path_SM, filePath, sizeof(filePath), "data/randomizer/%s.json", map); - if(!FileExists(filePath)) { - Log("[Randomizer] No map config file (data/randomizer/%s.json), not loading", map); - return null; - } - - JSONObject data = JSONObject.FromFile(filePath); - if(data == null) { - LogError("Could not parse map config file (data/randomizer/%s.json)", map); - return null; - } - return data; -} -public void SaveMapJson(const char[] map, JSONObject json) { - Debug("Saving config for %s", map); - char filePath[PLATFORM_MAX_PATH], filePathTemp[PLATFORM_MAX_PATH]; - BuildPath(Path_SM, filePathTemp, sizeof(filePath), "data/randomizer/%s.json.tmp", map); - BuildPath(Path_SM, filePath, sizeof(filePath), "data/randomizer/%s.json", map); - - json.ToFile(filePathTemp, JSON_INDENT(4)); - RenameFile(filePath, filePathTemp); - SetFilePermissions(filePath, FPERM_U_WRITE | FPERM_U_READ | FPERM_G_WRITE | FPERM_G_READ | FPERM_O_READ); -} - -public bool LoadMapData(const char[] map, int flags) { - JSONObject data = LoadMapJson(map); - if(data == null) { - return false; - } - - Debug("Starting parsing json data"); - - Cleanup(); - g_MapData.scenes = new ArrayList(sizeof(SceneData)); - g_MapData.scenesKv = new StringMap(); - g_MapData.lumpEdits = new ArrayList(sizeof(LumpEditData)); - g_MapData.activeScenes.Clear(); - - Profiler profiler = new Profiler(); - profiler.Start(); - - JSONObjectKeys iterator = data.Keys(); - char key[32]; - while(iterator.ReadKey(key, sizeof(key))) { - if(key[0] == '_') { - if(StrEqual(key, "_lumps")) { - JSONArray lumpsList = view_as(data.Get(key)); - if(lumpsList != null) { - for(int l = 0; l < lumpsList.Length; l++) { - loadLumpData(g_MapData.lumpEdits, view_as(lumpsList.Get(l))); - } - } - } else { - Debug("Unknown special entry \"%s\", skipping", key); - } - } else { - // if(data.GetType(key) != JSONType_Object) { - // Debug("Invalid normal entry \"%s\" (not an object), skipping", key); - // continue; - // } - JSONObject scene = view_as(data.Get(key)); - // Parses scene data and inserts to scenes - loadScene(key, scene); - } - } - - delete data; - profiler.Stop(); - Log("Parsed map file for %s(%d) and found %d scenes in %.4f seconds", map, flags, g_MapData.scenes.Length, profiler.Time); - delete profiler; - return true; -} - -// Calls LoadMapData (read&parse (mapname).json) then select scenes -public bool RunMap(const char[] map, int flags) { - if(g_MapData.scenes == null || flags & view_as(FLAG_REFRESH)) { - if(!LoadMapData(map, flags)) { - return false; - } - } - Profiler profiler = new Profiler(); - - profiler.Start(); - selectScenes(flags); - spawnGascans(); - profiler.Stop(); - - _ropeIndex = 0; - - Log("Done processing in %.4f seconds", g_MapData.scenes.Length, profiler.Time); - return true; -} - -void spawnGascans() { - if(g_MapData.gascanSpawners != null && g_MapData.gascanSpawners.Length > 0) { - // Iterate through every gascan until we run out - picking a random spawner each time - int entity = -1; - char targetname[9]; - GascanSpawnerData spawner; - int spawnerCount = g_MapData.gascanSpawners.Length; - int count; - while((entity = FindEntityByClassname(entity, "weapon_gascan")) != INVALID_ENT_REFERENCE) { - GetEntPropString(entity, Prop_Data, "m_iName", targetname, sizeof(targetname)); - int hammerid = GetEntProp(entity, Prop_Data, "m_iHammerID"); - int glowColor = GetEntProp(entity, Prop_Send, "m_glowColorOverride"); // check if white - if(hammerid == 0 && glowColor == 16777215 && targetname[0] == '\0' && !g_gascanSpawners.ContainsKey(entity)) { - // Found a valid gascan, apply a random spawner - int spawnerIndex = GetRandomInt(0, g_MapData.gascanSpawners.Length - 1); - g_MapData.gascanSpawners.GetArray(spawnerIndex, spawner); - g_MapData.gascanSpawners.Erase(spawnerIndex); // only want one can to use this spawner - - AssignGascan(entity, spawner); - count++; - } - } - Debug("Assigned %d gascans to %d spawners", count, spawnerCount); - } -} - void AssignGascan(int gascan, GascanSpawnerData spawner) { g_gascanSpawners.SetArray(gascan, spawner, sizeof(spawner)); TeleportEntity(gascan, spawner.origin, spawner.angles, NULL_VECTOR); Debug("Assigning gascan %d to spawner at %.0f %.0f %.0f", gascan, spawner.origin[0], spawner.origin[1], spawner.origin[2]); } -void loadScene(const char key[MAX_SCENE_NAME_LENGTH], JSONObject sceneData) { - SceneData scene; - scene.name = key; - scene.chance = sceneData.GetFloat("chance"); - if(scene.chance < 0.0 || scene.chance > 1.0) { - LogError("Scene \"%s\" has invalid chance (%f)", scene.name, scene.chance); - return; - } - // TODO: load "entities", merge with choice.entities - sceneData.GetString("group", scene.group, sizeof(scene.group)); - scene.variants = new ArrayList(sizeof(SceneVariantData)); - if(!sceneData.HasKey("variants")) { - ThrowError("Failed to load: Scene \"%s\" has missing \"variants\" array", scene.name); - return; - } - JSONArray entities; - if(sceneData.HasKey("entities")) { - entities = view_as(sceneData.Get("entities")); - } - - JSONArray variants = view_as(sceneData.Get("variants")); - for(int i = 0; i < variants.Length; i++) { - // Parses choice and loads to scene.choices - loadChoice(scene, view_as(variants.Get(i)), entities); - } - g_MapData.scenes.PushArray(scene); - g_MapData.scenesKv.SetArray(scene.name, scene, sizeof(scene)); -} - -void loadChoice(SceneData scene, JSONObject choiceData, JSONArray extraEntities) { - SceneVariantData choice; - choice.weight = 1; - if(choiceData.HasKey("weight")) - choice.weight = choiceData.GetInt("weight"); - choice.entities = new ArrayList(sizeof(VariantEntityData)); - choice.inputsList = new ArrayList(sizeof(VariantInputData)); - choice.forcedScenes = new ArrayList(ByteCountToCells(MAX_SCENE_NAME_LENGTH)); - // Load in any variant-based entities - if(choiceData.HasKey("entities")) { - JSONArray entities = view_as(choiceData.Get("entities")); - for(int i = 0; i < entities.Length; i++) { - // Parses entities and loads to choice.entities - loadChoiceEntity(choice.entities, view_as(entities.Get(i))); - } - delete entities; - } - // Load in any entities that the scene has - if(extraEntities != null) { - for(int i = 0; i < extraEntities.Length; i++) { - // Parses entities and loads to choice.entities - loadChoiceEntity(choice.entities, view_as(extraEntities.Get(i))); - } - // delete extraEntities; - } - // Load all inputs - if(choiceData.HasKey("inputs")) { - JSONArray inputsList = view_as(choiceData.Get("inputs")); - for(int i = 0; i < inputsList.Length; i++) { - loadChoiceInput(choice.inputsList, view_as(inputsList.Get(i))); - } - delete inputsList; - } - if(choiceData.HasKey("force_scenes")) { - JSONArray scenes = view_as(choiceData.Get("force_scenes")); - char sceneId[32]; - for(int i = 0; i < scenes.Length; i++) { - scenes.GetString(i, sceneId, sizeof(sceneId)); - choice.forcedScenes.PushString(sceneId); - Debug("scene %s: require %s", scene.name, sceneId); - } - delete scenes; - } - scene.variants.PushArray(choice); -} - -void loadChoiceInput(ArrayList list, JSONObject inputData) { - VariantInputData input; - input.type = Input_Classname; - // Check classname -> targetname -> hammerid - if(!inputData.GetString("classname", input.name, sizeof(input.name))) { - if(inputData.GetString("targetname", input.name, sizeof(input.name))) { - input.type = Input_Targetname; - } else { - if(inputData.GetString("hammerid", input.name, sizeof(input.name))) { - input.type = Input_HammerId; - } else { - int id = inputData.GetInt("hammerid"); - if(id > 0) { - input.type = Input_HammerId; - IntToString(id, input.name, sizeof(input.name)); - } else { - LogError("Missing valid input specification (hammerid, classname, targetname)"); - return; - } - } - } - } - inputData.GetString("input", input.input, sizeof(input.input)); - list.PushArray(input); -} - -void loadLumpData(ArrayList list, JSONObject inputData) { - LumpEditData input; - // Check classname -> targetname -> hammerid - if(!inputData.GetString("classname", input.name, sizeof(input.name))) { - if(inputData.GetString("targetname", input.name, sizeof(input.name))) { - input.type = Input_Targetname; - } else { - if(inputData.GetString("hammerid", input.name, sizeof(input.name))) { - input.type = Input_HammerId; - } else { - int id = inputData.GetInt("hammerid"); - if(id > 0) { - input.type = Input_HammerId; - IntToString(id, input.name, sizeof(input.name)); - } else { - LogError("Missing valid input specification (hammerid, classname, targetname)"); - return; - } - } - } - } - inputData.GetString("action", input.action, sizeof(input.action)); - inputData.GetString("value", input.value, sizeof(input.value)); - list.PushArray(input); -} - -void loadChoiceEntity(ArrayList list, JSONObject entityData) { - VariantEntityData entity; - entityData.GetString("model", entity.model, sizeof(entity.model)); - if(entityData.GetString("targetname", entity.targetname, sizeof(entity.targetname))) { - Format(entity.targetname, sizeof(entity.targetname), "randomizer_%s", entity.targetname); - } - if(!entityData.GetString("type", entity.type, sizeof(entity.type))) { - entity.type = "prop_dynamic"; - } /*else if(entity.type[0] == '_') { - LogError("Invalid custom entity type \"%s\"", entity.type); - return; - }*/ - - if(StrEqual(entity.type, "move_rope")) { - if(!entityData.HasKey("keyframes")) { - LogError("move_rope entity is missing keyframes: Vec[] property"); - return; - } - entity.keyframes = new ArrayList(3); - JSONArray keyframesData = view_as(entityData.Get("keyframes")); - float vec[3]; - for(int i = 0 ; i < keyframesData.Length; i++) { - JSONArray vecArray = view_as(keyframesData.Get(i)); - vec[0] = vecArray.GetFloat(0); - vec[1] = vecArray.GetFloat(1); - vec[2] = vecArray.GetFloat(2); - entity.keyframes.PushArray(vec); - } - } - GetVector(entityData, "origin", entity.origin); - GetVector(entityData, "angles", entity.angles); - GetVector(entityData, "scale", entity.scale); - GetColor(entityData, "color", entity.color); - list.PushArray(entity); -} - -bool GetVector(JSONObject obj, const char[] key, float out[3]) { - if(!obj.HasKey(key)) return false; - JSONArray vecArray = view_as(obj.Get(key)); - if(vecArray != null) { - out[0] = vecArray.GetFloat(0); - out[1] = vecArray.GetFloat(1); - out[2] = vecArray.GetFloat(2); - } - return true; -} - -void GetColor(JSONObject obj, const char[] key, int out[4], int defaultColor[4] = { 255, 255, 255, 255 }) { - if(obj.HasKey(key)) { - JSONArray vecArray = view_as(obj.Get(key)); - out[0] = vecArray.GetInt(0); - out[1] = vecArray.GetInt(1); - out[2] = vecArray.GetInt(2); - if(vecArray.Length == 4) - out[3] = vecArray.GetInt(3); - else - out[3] = 255; - } else { - out = defaultColor; - } -} - -void selectScenes(int flags = 0) { - SceneData scene; - StringMap groups = new StringMap(); - ArrayList list; - // Select and spawn non-group scenes - // TODO: refactor to use .scenesKv - for(int i = 0; i < g_MapData.scenes.Length; i++) { - g_MapData.scenes.GetArray(i, scene); - // TODO: Exclusions - // Select scene if not in group, or add to list of groups - if(scene.group[0] == '\0') { - selectScene(scene, flags); - } else { - // Load it into group list - if(!groups.GetValue(scene.group, list)) { - list = new ArrayList(); - } - list.Push(i); - groups.SetValue(scene.group, list); - } - } - - // Iterate through groups and select a random scene: - StringMapSnapshot snapshot = groups.Snapshot(); - char key[MAX_SCENE_NAME_LENGTH]; - for(int i = 0; i < snapshot.Length; i++) { - snapshot.GetKey(i, key, sizeof(key)); - groups.GetValue(key, list); - // Select a random scene from the group: - int index = GetURandomInt() % list.Length; - index = list.Get(index); - g_MapData.scenes.GetArray(index, scene); - - Debug("Selected scene \"%s\" for group %s (%d members)", scene.name, key, list.Length); - selectScene(scene, flags); - delete list; - } - // Traverse active scenes, loading any other scene it requires (via .force_scenes) - ActiveSceneData aScene; - SceneVariantData choice; - char sceneId[64]; - // list of scenes that will need to be forced if not already: - ArrayList forcedScenes = new ArrayList(ByteCountToCells(MAX_SCENE_NAME_LENGTH)); - for(int i = 0; i < g_MapData.activeScenes.Length; i++) { - g_MapData.activeScenes.GetArray(i, aScene); - // Load scene from active scene entry - if(!g_MapData.scenesKv.GetArray(aScene.name, scene, sizeof(scene))) { - // can't find scene, ignore - continue; - } - if(aScene.variantIndex < scene.variants.Length) { - scene.variants.GetArray(aScene.variantIndex, choice); - if(choice.forcedScenes != null) { - for(int j = 0; j < choice.forcedScenes.Length; j++) { - choice.forcedScenes.GetString(j, key, sizeof(key)); - forcedScenes.PushString(key); - } - } - } - } - if(forcedScenes.Length > 0) { - Debug("Loading %d forced scenes", forcedScenes.Length); - } - // Iterate and activate any forced scenes - for(int i = 0; i < forcedScenes.Length; i++) { - forcedScenes.GetString(i, key, sizeof(key)); - // Check if scene was already loaded - bool isSceneAlreadyLoaded = false; - for(int j = 0; j < g_MapData.activeScenes.Length; j++) { - g_MapData.activeScenes.GetArray(j, aScene); - if(StrEqual(aScene.name, key)) { - isSceneAlreadyLoaded = true; - break; - } - } - if(isSceneAlreadyLoaded) continue; - g_MapData.scenesKv.GetArray(key, scene, sizeof(scene)); - selectScene(scene, flags | view_as(FLAG_FORCE_ACTIVE)); - } - - delete forcedScenes; - delete snapshot; - delete groups; -} - -void selectScene(SceneData scene, int flags) { - // Use the .chance field unless FLAG_ALL_SCENES or FLAG_FORCE_ACTIVE is set - if(~flags & view_as(FLAG_ALL_SCENES) && ~flags & view_as(FLAG_FORCE_ACTIVE) && GetURandomFloat() > scene.chance) { - return; - } - - if(scene.variants.Length == 0) { - LogError("Warn: No variants were found for scene \"%s\"", scene.name); - return; - } - - ArrayList choices = new ArrayList(); - SceneVariantData choice; - int index; - Debug("Scene %s has %d variants", scene.name, scene.variants.Length); - // Weighted random: Push N times dependent on weight - for(int i = 0; i < scene.variants.Length; i++) { - scene.variants.GetArray(i, choice); - if(flags & view_as(FLAG_ALL_VARIANTS)) { - spawnVariant(choice); - } else { - if(choice.weight <= 0) { - PrintToServer("Warn: Variant %d in scene %s has invalid weight", i, scene.name); - continue; - } - for(int c = 0; c < choice.weight; c++) { - choices.Push(i); - } - } - } - if(flags & view_as(FLAG_ALL_VARIANTS)) { - delete choices; - } else if(choices.Length > 0) { - index = GetURandomInt() % choices.Length; - index = choices.Get(index); - delete choices; - Log("Spawned scene \"%s\" with variant #%d", scene.name, index); - scene.variants.GetArray(index, choice); - spawnVariant(choice); - } - ActiveSceneData aScene; - strcopy(aScene.name, sizeof(aScene.name), scene.name); - aScene.variantIndex = index; - g_MapData.activeScenes.PushArray(aScene); -} - -void spawnVariant(SceneVariantData choice) { - VariantEntityData entity; - for(int i = 0; i < choice.entities.Length; i++) { - choice.entities.GetArray(i, entity); - spawnEntity(entity); - } - - if(choice.inputsList.Length > 0) { - VariantInputData input; - for(int i = 0; i < choice.inputsList.Length; i++) { - choice.inputsList.GetArray(i, input); - input.Trigger(); - } - } -} - int CreateLight(const float origin[3], const float angles[3], const int color[4] = { 255, 255, 255, 1 }, float distance = 100.0) { int entity = CreateEntityByName("light_dynamic"); if(entity == -1) return -1; @@ -1422,6 +738,7 @@ int CreateLight(const float origin[3], const float angles[3], const int color[4] TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR); if(!DispatchSpawn(entity)) return -1; SetEntityRenderColor(entity, color[0], color[1], color[2], color[3]); + SetEntityRenderMode(entity, RENDER_TRANSCOLOR); AcceptEntityInput(entity, "TurnOn"); return entity; } @@ -1439,6 +756,11 @@ void AddGascanSpawner(VariantEntityData data) { } void spawnEntity(VariantEntityData entity) { + // if(entity.type[0] == '_') { + // if(StrEqual(entity.type, "_gascan")) { + // AddGascanSpawner(entity); + // } + // } if(StrEqual(entity.type, "_gascan")) { AddGascanSpawner(entity); } else if(StrEqual(entity.type, "env_fire")) { @@ -1462,6 +784,17 @@ void spawnEntity(VariantEntityData entity) { } int prop = CreateProp(entity.type, entity.model, entity.origin, entity.angles); SetEntityRenderColor(prop, entity.color[0], entity.color[1], entity.color[2], entity.color[3]); + entity.ApplyProperties(prop); + } else if(StrContains(entity.type, "weapon_") == 0) { + if(entity.model[0] == '\0') { + LogError("Missing model for entity with type \"%s\"", entity.type); + return; + } else if(!PrecacheModel(entity.model)) { + LogError("Precache of entity model \"%s\" with type \"%s\" failed", entity.model, entity.type); + return; + } + int prop = CreateProp(entity.type, entity.model, entity.origin, entity.angles); + SetEntityRenderColor(prop, entity.color[0], entity.color[1], entity.color[2], entity.color[3]); } else if(StrEqual(entity.type, "hammerid")) { int targetId = StringToInt(entity.model); if(targetId > 0) { @@ -1520,21 +853,21 @@ void spawnEntity(VariantEntityData entity) { int CreateRope(VariantEntityData data) { char targetName[32], nextKey[32]; - Format(targetName, sizeof(targetName), "randomizer_rope%d", _ropeIndex); - Format(nextKey, sizeof(nextKey), "randomizer_rope%d_0", _ropeIndex); + Format(targetName, sizeof(targetName), "randomizer_rope%d", g_ropeIndex); + Format(nextKey, sizeof(nextKey), "randomizer_rope%d_0", g_ropeIndex); int entity = _CreateRope("move_rope", targetName, nextKey, data.model, data.origin); float pos[3]; for(int i = 0; i < data.keyframes.Length; i++) { nextKey[0] = '\0'; - Format(targetName, sizeof(targetName), "randomizer_rope%d_%d", _ropeIndex, i); + Format(targetName, sizeof(targetName), "randomizer_rope%d_%d", g_ropeIndex, i); if(i < data.keyframes.Length - 1) { - Format(nextKey, sizeof(nextKey), "randomizer_rope%d_%d", _ropeIndex, i + 1); + Format(nextKey, sizeof(nextKey), "randomizer_rope%d_%d", g_ropeIndex, i + 1); } data.keyframes.GetArray(i, pos, sizeof(pos)); _CreateRope("move_rope", targetName, nextKey, data.model, pos); } - Debug("created rope #%d with %d keyframes. entid:%d", _ropeIndex, data.keyframes.Length, entity); - _ropeIndex++; + Debug("created rope #%d with %d keyframes. entid:%d", g_ropeIndex, data.keyframes.Length, entity); + g_ropeIndex++; return entity; } int _CreateRope(const char[] type, const char[] targetname, const char[] nextKey, const char[] texture, const float origin[3]) { @@ -1584,32 +917,28 @@ void Log(const char[] format, any ...) { PrintToServer("[Randomizer] %s", buffer); } -void Cleanup() { +void Cleanup(bool clearEntities = true) { if(g_MapData.scenes != null) { - SceneData scene; - for(int i = 0; i < g_MapData.scenes.Length; i++) { - g_MapData.scenes.GetArray(i, scene); - scene.Cleanup(); - } - delete g_MapData.scenes; + g_MapData.Cleanup(); } delete g_MapData.lumpEdits; delete g_MapData.gascanSpawners; // Cleanup all alarm car entities: - int entity = -1; - char targetname[128]; - while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) { - if(!IsValidEntity(entity)) continue; - GetEntPropString(entity, Prop_Data, "m_iName", targetname, sizeof(targetname)); - if(StrContains(targetname, "randomizer_") != -1) { - RemoveEntity(entity); + if(clearEntities) { + int entity = -1; + char targetname[128]; + while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) { + if(!IsValidEntity(entity)) continue; + GetEntPropString(entity, Prop_Data, "m_iName", targetname, sizeof(targetname)); + if(StrContains(targetname, "randomizer_") != -1) { + RemoveEntity(entity); + } } + DeleteCustomEnts(); } // TODO: delete car alarms - DeleteCustomEnts(); - g_MapData.activeScenes.Clear(); g_gascanSpawners.Clear(); delete g_gascanRespawnQueue; } \ No newline at end of file