|
1 |
| ---Customize your crafting table here. Each constant has a comment above it to tell you what it does. |
2 |
| - |
3 |
| ---[[ |
4 |
| - NOTE: Some of the table customizations have been moved to ConVars, meaning you can change them through the server console or spawn menu. |
5 |
| - Below are the customizations that are configurable through ConVars by default. If you want to configure everything through this file, |
6 |
| - uncomment the lines below. |
7 |
| ---]] |
8 |
| - |
9 |
| ---Health of the table |
10 |
| ---CRAFT_CONFIG_MAX_HEALTH = 100 |
11 |
| - |
12 |
| ---Model of the table |
13 |
| ---CRAFT_CONFIG_MODEL = "models/props_wasteland/controlroom_desk001b.mdl" |
14 |
| - |
15 |
| ---Material of the table, leave as an empty string if you want to keep the default model texture |
16 |
| ---CRAFT_CONFIG_MATERIAL = "" |
17 |
| - |
18 |
| ---Sound that plays when an item is placed on the table |
19 |
| ---CRAFT_CONFIG_PLACE_SOUND = "physics/metal/metal_solid_impact_hard1.wav" |
20 |
| - |
21 |
| ---Sound that plays when an item is crafted |
22 |
| ---CRAFT_CONFIG_CRAFT_SOUND = "ambient/machines/catapult_throw.wav" |
23 |
| - |
24 |
| ---Sound that plays when a button is pressed in the menu |
25 |
| ---CRAFT_CONFIG_UI_SOUND = "ui/buttonclickrelease.wav" |
26 |
| - |
27 |
| ---Sound that plays when an item is selected |
28 |
| ---CRAFT_CONFIG_SELECT_SOUND = "buttons/lightswitch2.wav" |
29 |
| - |
30 |
| ---Sound that plays when crafting fails |
31 |
| ---CRAFT_CONFIG_FAIL_SOUND = "buttons/button2.wav" |
32 |
| - |
33 |
| ---Sound that plays when an ingredient is manually removed from the table |
34 |
| ---CRAFT_CONFIG_DROP_SOUND = "physics/metal/metal_canister_impact_soft1.wav" |
35 |
| - |
36 |
| ---Sound that plays when the table is destroyed, only plays when the explosion is disabled, you don't need to have math.random, I only added that for variety |
37 |
| ---CRAFT_CONFIG_DESTROY_SOUND = "physics/metal/metal_box_break"..math.random( 1, 2 )..".wav" |
38 |
| - |
39 |
| ---Whether or not the table should explode when its health reaches 0 |
40 |
| ---CRAFT_CONFIG_SHOULD_EXPLODE = true |
41 |
| - |
42 |
| ---Health of the trees |
43 |
| ---CRAFT_CONFIG_TREE_HEALTH = 100 |
44 |
| - |
45 |
| ---How long in seconds it takes for a tree to respawn |
46 |
| ---CRAFT_CONFIG_TREE_RESPAWN = 300 |
47 |
| - |
48 |
| ---Minimum number of entities that can be mined from a rock or tree |
49 |
| ---CRAFT_CONFIG_MIN_SPAWN = 2 |
50 |
| - |
51 |
| ---Maximum number of entities that can be mined from a rock or tree |
52 |
| ---CRAFT_CONFIG_MAX_SPAWN = 6 |
53 |
| - |
54 |
| ---Health of the rocks |
55 |
| ---CRAFT_CONFIG_ROCK_HEALTH = 100 |
56 |
| - |
57 |
| ---How long in seconds it takes for a rock to respawn |
58 |
| ---CRAFT_CONFIG_ROCK_RESPAWN = 300 |
59 |
| - |
60 |
| ---Whether or not players should be allowed to use the automation feature |
61 |
| ---CRAFT_CONFIG_ALLOW_AUTOMATION = true |
62 |
| - |
63 |
| ---The time it takes in seconds for the table to complete an automation process |
64 |
| ---CRAFT_CONFIG_AUTOMATION_TIME = 120 |
65 |
| - |
66 |
| ---Max range in hammer units that the player can be away from the table to get automation messages. Set to 0 for infinite |
67 |
| ---CRAFT_CONFIG_AUTOMATION_MESSAGE_RANGE = 0 |
68 |
| - |
69 |
| - |
70 |
| ---[[ |
71 |
| - NOTE: Below are all of the customizations that don't have ConVar counterparts. Commenting out these lines will cause errors. |
72 |
| -]] |
73 |
| - |
74 |
| ---Color of the table, default is white (which means no change) |
75 |
| -CRAFT_CONFIG_COLOR = color_white --Using a global for optimization, you can also use Color() |
76 |
| - |
77 |
| ---Color of the menu background |
78 |
| -CRAFT_CONFIG_MENU_COLOR = Color( 49, 53, 61, 200 ) |
79 |
| - |
80 |
| ---Color of the buttons |
81 |
| -CRAFT_CONFIG_BUTTON_COLOR = Color( 230, 93, 80, 255 ) |
82 |
| - |
83 |
| ---Color of the button text if all required ingredients are on the table |
84 |
| -CRAFT_CONFIG_BUTTON_TEXT_COLOR = color_white |
85 |
| - |
86 |
| ---List of models the rocks can have |
87 |
| -CRAFT_CONFIG_ROCK_MODELS = { |
88 |
| - "models/props_debris/barricade_short01a.mdl", |
89 |
| - "models/props_debris/barricade_short02a.mdl", |
90 |
| - "models/props_debris/barricade_tall01a.mdl" |
91 |
| -} |
92 |
| - |
93 |
| ---List of entities that can be dropped from mining a rock |
94 |
| -CRAFT_CONFIG_ROCK_INGREDIENTS = { |
95 |
| - { "iron", 100 } --First entry is the entity name, second entry is the chance it has of spawning from 1 to 100 |
96 |
| -} |
97 |
| - |
98 |
| ---List of models the trees can have |
99 |
| -CRAFT_CONFIG_TREE_MODELS = { |
100 |
| - "models/props_foliage/tree_deciduous_01a-lod.mdl", |
101 |
| - "models/props_foliage/tree_poplar_01.mdl" |
102 |
| -} |
103 |
| - |
104 |
| ---List of entities that can be dropped from mining a tree |
105 |
| -CRAFT_CONFIG_TREE_INGREDIENTS = { |
106 |
| - { "wood", 100 } |
107 |
| -} |
108 |
| - |
109 |
| ---List of allowed weapons to be used to mine trees |
110 |
| -CRAFT_CONFIG_MINE_WHITELIST_TREE = { |
111 |
| - ["weapon_crowbar"] = true |
112 |
| -} |
113 |
| - |
114 |
| ---Same as above but for rocks |
115 |
| -CRAFT_CONFIG_MINE_WHITELIST_ROCK = { |
116 |
| - ["weapon_crowbar"] = true |
117 |
| -} |
118 |
| - |
119 |
| ---Specify weapons to deal specific damage to rocks and trees. Any weapons listed here must be in one of the whitelists to work. |
120 |
| ---Any weapons not listed here but are in the whitelist will assume their default damage values |
121 |
| -CRAFT_CONFIG_MINE_DAMAGE_OVERRIDE = { |
122 |
| - ["weapon_crowbar"] = 5 |
123 |
| -} |
124 |
| - |
125 |
| - |
126 |
| ---Don't touch anything below this line unless you know what you're doing |
127 |
| - |
128 |
| ---Function to see if part of the entity is outside of the world, not just it's origin |
129 |
| ---Only accurate on models with simple geometry |
130 |
| -function util.IsAllInWorld( ent ) |
131 |
| - if IsValid( ent ) and IsEntity( ent ) then |
132 |
| - local inworld = ent:IsInWorld() |
133 |
| - local vec1, vec2 = ent:GetCollisionBounds() |
134 |
| - local realvec1, realvec2 = ent:WorldToLocal( vec1 ), ent:WorldToLocal( vec2 ) |
135 |
| - if inworld and util.IsInWorld( realvec1 ) and util.IsInWorld( realvec2 ) then |
136 |
| - return true |
137 |
| - end |
138 |
| - end |
139 |
| - return false |
140 |
| -end |
| 1 | +--Customize your crafting table here. Each constant has a comment above it to tell you what it does. |
| 2 | + |
| 3 | +--[[ |
| 4 | + NOTE: Some of the table customizations have been moved to ConVars, meaning you can change them through the server console or spawn menu. |
| 5 | + Below are the customizations that are configurable through ConVars by default. If you want to configure everything through this file, |
| 6 | + uncomment the lines below. |
| 7 | +--]] |
| 8 | + |
| 9 | +--Health of the table |
| 10 | +--CRAFT_CONFIG_MAX_HEALTH = 100 |
| 11 | + |
| 12 | +--Model of the table |
| 13 | +--CRAFT_CONFIG_MODEL = "models/props_wasteland/controlroom_desk001b.mdl" |
| 14 | + |
| 15 | +--Material of the table, leave as an empty string if you want to keep the default model texture |
| 16 | +--CRAFT_CONFIG_MATERIAL = "" |
| 17 | + |
| 18 | +--Sound that plays when an item is placed on the table |
| 19 | +--CRAFT_CONFIG_PLACE_SOUND = "physics/metal/metal_solid_impact_hard1.wav" |
| 20 | + |
| 21 | +--Sound that plays when an item is crafted |
| 22 | +--CRAFT_CONFIG_CRAFT_SOUND = "ambient/machines/catapult_throw.wav" |
| 23 | + |
| 24 | +--Sound that plays when a button is pressed in the menu |
| 25 | +--CRAFT_CONFIG_UI_SOUND = "ui/buttonclickrelease.wav" |
| 26 | + |
| 27 | +--Sound that plays when an item is selected |
| 28 | +--CRAFT_CONFIG_SELECT_SOUND = "buttons/lightswitch2.wav" |
| 29 | + |
| 30 | +--Sound that plays when crafting fails |
| 31 | +--CRAFT_CONFIG_FAIL_SOUND = "buttons/button2.wav" |
| 32 | + |
| 33 | +--Sound that plays when an ingredient is manually removed from the table |
| 34 | +--CRAFT_CONFIG_DROP_SOUND = "physics/metal/metal_canister_impact_soft1.wav" |
| 35 | + |
| 36 | +--Sound that plays when the table is destroyed, only plays when the explosion is disabled, you don't need to have math.random, I only added that for variety |
| 37 | +--CRAFT_CONFIG_DESTROY_SOUND = "physics/metal/metal_box_break"..math.random( 1, 2 )..".wav" |
| 38 | + |
| 39 | +--Whether or not the table should explode when its health reaches 0 |
| 40 | +--CRAFT_CONFIG_SHOULD_EXPLODE = true |
| 41 | + |
| 42 | +--Health of the trees |
| 43 | +--CRAFT_CONFIG_TREE_HEALTH = 100 |
| 44 | + |
| 45 | +--How long in seconds it takes for a tree to respawn |
| 46 | +--CRAFT_CONFIG_TREE_RESPAWN = 300 |
| 47 | + |
| 48 | +--Minimum number of entities that can be mined from a rock or tree |
| 49 | +--CRAFT_CONFIG_MIN_SPAWN = 2 |
| 50 | + |
| 51 | +--Maximum number of entities that can be mined from a rock or tree |
| 52 | +--CRAFT_CONFIG_MAX_SPAWN = 6 |
| 53 | + |
| 54 | +--Health of the rocks |
| 55 | +--CRAFT_CONFIG_ROCK_HEALTH = 100 |
| 56 | + |
| 57 | +--How long in seconds it takes for a rock to respawn |
| 58 | +--CRAFT_CONFIG_ROCK_RESPAWN = 300 |
| 59 | + |
| 60 | +--Whether or not players should be allowed to use the automation feature |
| 61 | +--CRAFT_CONFIG_ALLOW_AUTOMATION = true |
| 62 | + |
| 63 | +--The time it takes in seconds for the table to complete an automation process |
| 64 | +--CRAFT_CONFIG_AUTOMATION_TIME = 120 |
| 65 | + |
| 66 | +--Max range in hammer units that the player can be away from the table to get automation messages. Set to 0 for infinite |
| 67 | +--CRAFT_CONFIG_AUTOMATION_MESSAGE_RANGE = 0 |
| 68 | + |
| 69 | + |
| 70 | +--[[ |
| 71 | + NOTE: Below are all of the customizations that don't have ConVar counterparts. Commenting out these lines will cause errors. |
| 72 | +]] |
| 73 | + |
| 74 | +--Color of the table, default is white (which means no change) |
| 75 | +CRAFT_CONFIG_COLOR = color_white --Using a global for optimization, you can also use Color() |
| 76 | + |
| 77 | +--Color of the menu background |
| 78 | +CRAFT_CONFIG_MENU_COLOR = Color( 49, 53, 61, 200 ) |
| 79 | + |
| 80 | +--Color of the buttons |
| 81 | +CRAFT_CONFIG_BUTTON_COLOR = Color( 230, 93, 80, 255 ) |
| 82 | + |
| 83 | +--Color of the button text if all required ingredients are on the table |
| 84 | +CRAFT_CONFIG_BUTTON_TEXT_COLOR = color_white |
| 85 | + |
| 86 | +--List of models the rocks can have |
| 87 | +CRAFT_CONFIG_ROCK_MODELS = { |
| 88 | + "models/props_debris/barricade_short01a.mdl", |
| 89 | + "models/props_debris/barricade_short02a.mdl", |
| 90 | + "models/props_debris/barricade_tall01a.mdl" |
| 91 | +} |
| 92 | + |
| 93 | +--List of entities that can be dropped from mining a rock |
| 94 | +CRAFT_CONFIG_ROCK_INGREDIENTS = { |
| 95 | + { "iron", 100 } --First entry is the entity name, second entry is the chance it has of spawning from 1 to 100 |
| 96 | +} |
| 97 | + |
| 98 | +--List of models the trees can have |
| 99 | +CRAFT_CONFIG_TREE_MODELS = { |
| 100 | + "models/props_foliage/tree_deciduous_01a-lod.mdl", |
| 101 | + "models/props_foliage/tree_poplar_01.mdl" |
| 102 | +} |
| 103 | + |
| 104 | +--List of entities that can be dropped from mining a tree |
| 105 | +CRAFT_CONFIG_TREE_INGREDIENTS = { |
| 106 | + { "wood", 100 } |
| 107 | +} |
| 108 | + |
| 109 | +--List of allowed weapons to be used to mine trees |
| 110 | +CRAFT_CONFIG_MINE_WHITELIST_TREE = { |
| 111 | + ["weapon_crowbar"] = true |
| 112 | +} |
| 113 | + |
| 114 | +--Same as above but for rocks |
| 115 | +CRAFT_CONFIG_MINE_WHITELIST_ROCK = { |
| 116 | + ["weapon_crowbar"] = true |
| 117 | +} |
| 118 | + |
| 119 | +--Specify weapons to deal specific damage to rocks and trees. Any weapons listed here must be in one of the whitelists to work. |
| 120 | +--Any weapons not listed here but are in the whitelist will assume their default damage values |
| 121 | +CRAFT_CONFIG_MINE_DAMAGE_OVERRIDE = { |
| 122 | + ["weapon_crowbar"] = 5 |
| 123 | +} |
| 124 | + |
| 125 | + |
| 126 | +--Don't touch anything below this line unless you know what you're doing |
| 127 | + |
| 128 | +--Function to see if part of the entity is outside of the world, not just it's origin |
| 129 | +--Only accurate on models with simple geometry |
| 130 | +function util.IsAllInWorld( ent ) |
| 131 | + if IsValid( ent ) and IsEntity( ent ) then |
| 132 | + local inworld = ent:IsInWorld() |
| 133 | + local vec1, vec2 = ent:GetCollisionBounds() |
| 134 | + local realvec1, realvec2 = ent:WorldToLocal( vec1 ), ent:WorldToLocal( vec2 ) |
| 135 | + if inworld and util.IsInWorld( realvec1 ) and util.IsInWorld( realvec2 ) then |
| 136 | + return true |
| 137 | + end |
| 138 | + end |
| 139 | + return false |
| 140 | +end |
| 141 | + |
| 142 | +local version = "1.20.3" |
| 143 | +MsgC( Color( 0, 0, 255 ), "Universal Crafting System v"..version.." by OPGman successfully loaded.\n" ) |
0 commit comments