diff options
| author | Apickx <apickx@cogarr.com> | 2018-03-24 20:47:32 -0400 |
|---|---|---|
| committer | Apickx <apickx@cogarr.com> | 2018-03-24 20:47:32 -0400 |
| commit | d22897e044a422e125f46e52c3467473a3656378 (patch) | |
| tree | b7eedbaa95f3ec6c7c28a2b33405dda84adbf945 | |
| download | artery_stranded-d22897e044a422e125f46e52c3467473a3656378.tar.gz artery_stranded-d22897e044a422e125f46e52c3467473a3656378.tar.bz2 artery_stranded-d22897e044a422e125f46e52c3467473a3656378.zip | |
Inital commit
Inital commit
31 files changed, 2566 insertions, 0 deletions
diff --git a/content/materials/svg/delapouite/originals/svg/000000/transparent/stone-pile.svg b/content/materials/svg/delapouite/originals/svg/000000/transparent/stone-pile.svg new file mode 100644 index 0000000..8399409 --- /dev/null +++ b/content/materials/svg/delapouite/originals/svg/000000/transparent/stone-pile.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M317.727 108.904l-95.192 96.592-26.93 86.815 17.54 36.723 20.417 9.287 33.182-55.082 11.297-3.61 61.75 26.85 20.26-12.998 4.47-43.7 11.42 53.634-10.622 14.162 3.772 1.64 5.238 6.5 6.832 34.343 55.977-66.775 13.98.23 22.397 28.575-9.453-52.244L434.01 166.81l-116.28-57.906zM123.61 120.896L94.08 173l-4.603 27.62 25.98-8.442 11.704 7.377.084.634 28.295 59.865 13.773-4.543 10.94 4.668 3.922 8.21 19.517-62.917-1.074-33.336-40.15-.522-29.732-23.78 34.06 10.888 42.49-7.727 26.034 15.88 36.282-36.815c-2.777-1.18-5.615-2.356-8.58-3.52l-79.58 10.126-3.528-.25-56.307-15.52zm249.33 36.422l47.058 66.02 2.107 62.51-25.283-59.698-65.322-60.404 41.44-8.428zm-262.2 55.32l-64.234 20.876-16.71 78.552 50.794 5.582.596-7.14 37.662-36.707-8.108-61.16zm56.688 62.45l-36.44 12.016-31.644 30.84 22.588 30.867 57.326 1.74 16.5-16.16-28.33-59.302zm110.666 24.19l-44.307 73.546-.033 57.14 97.264 12.216 44.242-19.528-17.666-88.806-79.5-34.567zM443.8 313.36l-46.843 55.876.287 1.774 65.147 13.887 25.78-14.926-44.37-56.613zm-138.382 15.89l39.23 22.842 13.41 50.658-26.82 23.838-45.015-2.553 38.562-28.242 2.483-39.23-21.85-27.312zm-238.37 53.838l-8.77 28.51 13.152 48.498 91.037-11.91 1.32-26.418-62.582-31.995-34.156-6.684z" stroke-linejoin="bevel"/></svg>
\ No newline at end of file diff --git a/content/materials/svg/faithtoken/originals/svg/000000/transparent/minerals.svg b/content/materials/svg/faithtoken/originals/svg/000000/transparent/minerals.svg new file mode 100644 index 0000000..c7d6edc --- /dev/null +++ b/content/materials/svg/faithtoken/originals/svg/000000/transparent/minerals.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M263.396 491.136l-21.303-131.13-13.116 127.847-44.258-24.593 49.024-168.947 41.122 67.33 19.665 91.792-31.134 37.7zm-153.69-3.88l-7.82-27.853-27.776-9.022 27.838-7.826 9.02-27.784 7.83 27.845 27.783 9.03-27.844 7.82-9.03 27.79zm60.94-55.476l-28.97-2.242-64.16-105.39-4.148-82.91 78.463 30.34 51.1 67.966-16.398 62.952-63.105-83.046 47.22 112.33zm145.663-28.756l-17.02-2.127-8.508-43.624-14.28-26.774 91.794-91.793 31.15 9.825-13.115 73.764-70.02 80.728zm18.348-41.894l27.27-32.52 9.98-40.923-25.183 32.52-12.067 40.923zM209.74 322.725l-38.527-51.62 22.13-109.025 77.046-95.052 63.105 85.227-6.55 105.735-59.012 60.64-37.7-57.373-20.493 61.468zm47.32-47.25l27.18-94.6 24.738-22.858-28.03 3.85-11.132-43.28-6.558 43.28-45.345 5.516 45.108 16.17-5.96 91.92zm-97.248-19.727l-27.876-44.267 9.84-93.413 31.143 62.286-13.108 75.395zm232.258-22.46l-9.87-35.175-35.077-11.393 35.153-9.887 11.393-35.076 9.886 35.16 35.076 11.402-35.153 9.87-11.41 35.1zm-213.9-97.943l-12.344-43.99-43.876-14.25 43.976-12.365 14.247-43.876L192.54 64.84l43.867 14.263-43.968 12.35-14.27 43.892z"/></svg>
\ No newline at end of file diff --git a/content/materials/svg/faithtoken/originals/svg/000000/transparent/ore.svg b/content/materials/svg/faithtoken/originals/svg/000000/transparent/ore.svg new file mode 100644 index 0000000..ff76c69 --- /dev/null +++ b/content/materials/svg/faithtoken/originals/svg/000000/transparent/ore.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M344.578 493.54l-117.214-2.024L118.9 338.536l14.355-51.353 35.264 9.38 40.145 42.033-17.467-59.874 23.836-35.358-42.748-104.034 43.165-79.45 72.434 22.468 46.26 80.46-29.474 5-38.478-35.017 22.568 48.064-.672 37.364-26.09 18.224 34.95 1.284 47.145 23.835 28.75-27.874 38.488 19.057 10.647 37.578-18.97-13.784-78.166 39.967-44.983-15.39 5.86-27.153-42.766 3.274 23.573 11.913-9.49 22.943 58.037 31.285 20.34 79.423-15.45 34.73 29.397-20.36 66.83-9.438-71.61 65.81zm-158.524-3.538l-53.48-2.296 27.663-64.006 34.38 49.695-8.563 16.607zm-86.78-37.04l-11.08-34.875-35.503-10.204 34.858-11.09 10.212-35.5 11.09 34.855 35.502 10.22-34.857 11.082-10.22 35.51zm252.983-33.208l-21.565-84.228 72.042-38.99 53.683 59.322-18.665 52.23-85.495 11.666zM169.47 280.677l-59.133-15.612-20.298-69.16 66.064-37.45 36.94 84.126-23.573 38.097zm172.106-38.972l-38.385-19.66 1.574-38.86 43.607-9.917 26.753 39.296-33.547 29.14zm58.845-47.23l-14.234-45.425-46.14-13.46 45.41-14.262 13.46-46.132 14.252 45.41 46.14 13.478-45.41 14.235-13.477 46.156zM327.01 124.9l-28.666-56.762-28.972-7.96 22.645-41.718 29.312 14.278 17.84 59.542-12.16 32.62z"/></svg>
\ No newline at end of file diff --git a/content/materials/svg/lorc/originals/svg/000000/transparent/fossil.svg b/content/materials/svg/lorc/originals/svg/000000/transparent/fossil.svg new file mode 100644 index 0000000..c7f87fd --- /dev/null +++ b/content/materials/svg/lorc/originals/svg/000000/transparent/fossil.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M337.268 21.412L97.643 43.66 17.125 159.672l30.592 194.662.25.088L60.9 439.168l166.438 56.05 119.598-10.36 127.832-60.915 5.377-84.605 7.605-85.133-10.02-31.236-35.45-10.642.548-96.982.276-.328-.872-2.717-104.964-90.888zM221.338 58.39c27.232.292 53.762 7.89 75.67 21.313 26.706 16.363 46.742 41.84 51.01 73.23 2.406 17.697-1.08 35.415-9.15 51.063 24.128 7.656 41.976 13.968 55.943 25.027 16.303 12.91 25.883 31.77 34.08 62.31l1.483 5.534-4.256 3.834c-35.05 31.564-81.466 52.728-131.297 58.57-51.316 6.02-103.156-5.577-144.302-30.446-41.147-24.87-71.802-63.446-78.82-110.922C60.755 143.87 116.99 68.67 203.38 59.264c4.17-.454 8.342-.732 12.503-.836 1.82-.046 3.64-.06 5.455-.04zm-.215 18.702c-1.592-.02-3.186-.01-4.78.027-3.648.086-7.298.325-10.94.722-20.212 2.2-38.422 8.412-54.114 17.515 4.263 22.597 19.14 36.716 41.003 46.123 9.088-7.047 20.425-11.79 33.28-12.925h.003c1.504-.133 3.006-.202 4.504-.225-.274-17.968 4.715-33.666 11.166-49.455-6.608-1.082-13.345-1.7-20.123-1.783zm38.535 6.13c-7.05 16.748-11.816 30.916-10.82 47.737 5.064 1.534 9.877 3.708 14.264 6.487 5.04 3.194 9.55 7.294 13.09 12.127l48.736-11.43c-6.917-17.315-20.272-31.837-37.684-42.505-8.4-5.148-17.72-9.33-27.586-12.417zM134.906 106.62c-33.29 26.87-50.667 68.3-44.72 108.548v.002c.183 1.24.39 2.472.61 3.7 28.092 10.36 52.05 12.284 85.534-3.616-3.505-6.465-5.89-13.582-6.828-21.24-1.658-13.547 1.935-27.047 9.443-38.258-20.607-10.497-37.12-26.62-44.04-49.137zm289.108 31.18l-.39 68.927-45.843-13.76 46.234-55.168zm-193.323 9.216c-1.16.003-2.32.054-3.473.156-.523.046-1.033.114-1.547.176l14.02 20.65c8.896-1.71 18.57.49 25.402 6.56.172-1.28.212-2.564.078-3.826-.75-7.038-5.032-13.038-12.072-17.5-5.28-3.346-12.004-5.54-18.932-6.084-1.155-.09-2.315-.135-3.475-.132zm-23.323 6.644c-13.68 8.462-21.077 23.678-19.314 38.082v.002c.393 3.216 1.172 6.306 2.27 9.27l28.066-11.325c.303-4.362 1.994-8.657 5.05-12.356l-16.073-23.674zm122.217 2.588l-46.068 10.805c.085.564.177 1.125.238 1.7.645 6.055-.246 12.067-2.377 17.55l34.928 18.935c10.45-14.344 15.387-31.86 13.28-48.99zm-59.127 45.393c-.254.215-.518.416-.777.624-1.303 2.125-3 4.114-5.096 5.88-2.283 1.923-4.854 3.426-7.588 4.518l-2.793 24.46c1.878-.047 3.758-.13 5.63-.317 17.064-1.695 31.717-8.165 43.165-17.522l-32.54-17.642zm-45.07 5.38l-24.764 9.992c3.253 3.334 7.042 6.348 11.293 8.994 6.95 4.326 15.077 7.51 23.678 9.353l2.45-21.467c-4.424-1.106-8.586-3.194-12.02-6.272-.218-.196-.427-.4-.637-.6zm102.855 13.234c-15.41 18.853-38.614 32.373-66.562 35.148-.73.073-1.46.116-2.192.172 8.186 18.072 10.37 32.67 6.744 46.588-3.447 13.235-11.147 24.704-21.238 38.715 15.69 1.695 31.723 1.702 47.65-.166 43.894-5.146 84.95-23.416 116.46-50.16-7.193-24.805-14.51-37.858-25.895-46.874-11.237-8.897-28.577-15.043-54.968-23.422zm-140.53 10.22c-33.997 16.75-62.925 17.738-90.94 9.962 11.302 29.815 33.998 54.615 63.412 72.392 19.095 11.54 40.97 20 64.074 24.785 12.61-17.636 21.18-29.762 23.888-40.162 2.844-10.915 1.06-22.145-9.806-42.554-13.078-1.858-25.54-6.326-36.3-13.023-5.22-3.25-10.053-7.073-14.327-11.398zm272.32 130.657l-3.22 50.667-97.4 46.414 14.133-62.933 86.488-34.146zm-392.083.352l143.605 50.743 6.398 60.113-140.297-47.246-9.707-63.61zm285.304 38.854l-14.936 66.51-101.224 8.77-6.54-61.454 122.7-13.826z" /></svg>
\ No newline at end of file diff --git a/content/materials/svg/lorc/originals/svg/000000/transparent/rock.svg b/content/materials/svg/lorc/originals/svg/000000/transparent/rock.svg new file mode 100644 index 0000000..4372015 --- /dev/null +++ b/content/materials/svg/lorc/originals/svg/000000/transparent/rock.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M228.813 23L68.75 72.28 39.5 182.095l47.53-21.22 10.44-4.655 2.5 11.155 8.75 39.125 6.405 28.53-21.75-19.53-15.72-14.125-28.218 32.344 140.657 136 9.656-40.69 7.53-31.874 10.407 31.063 54.72 163.592L432.343 465.5l45.75-202.938-84.563-148.718L228.814 23zm-57.688 49.875l-27.813 39.906-3.25 73.44-27.187-88.94 58.25-24.405zm17.844 93.406l113.124 155.25L407 355.407l-107.375-.844-110.656-128v-60.28zM79.312 330.25l140.125 153.125-5.563-65.875-134.563-87.25z" fill-rule="evenodd"/></svg>
\ No newline at end of file diff --git a/content/materials/svg/lorc/originals/svg/000000/transparent/stone-block.svg b/content/materials/svg/lorc/originals/svg/000000/transparent/stone-block.svg new file mode 100644 index 0000000..c1b1736 --- /dev/null +++ b/content/materials/svg/lorc/originals/svg/000000/transparent/stone-block.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M209.875 44.156l-182 106.47 119.625 54.31 148.344 11.72 41.97-24.312 17.342 11.562L309 230.656V379.53l53.563-14.624-64.625 51.97-110.875-59.626-2.157-1.53-71.28 6.56 75.936-31.967 100.75 52.125v-147.5l-145.906-11.5-1.625-.125-1.5-.688-121.093-55V391.47L44 423.186l82 20.97 21.875-21.282 11.156 29.72 131.282 33.592V434l4.25 2.28 5.47 2.94 4.812-3.908L309 431.97v52.155L491.375 377.78v-96.405L466.78 269.47l24.595-38.75V125l-90.25 52.28-1.094 34.095-88-58.688 84.97 5.375L476.5 112 291.562 64.937l1.625.563-64.406 5.78 5.345-20.936-24.25-6.188z" /></svg>
\ No newline at end of file diff --git a/data/artery/global/art_sawhorse/cl_ent_sawhorse.lua b/data/artery/global/art_sawhorse/cl_ent_sawhorse.lua new file mode 100644 index 0000000..2cbe16a --- /dev/null +++ b/data/artery/global/art_sawhorse/cl_ent_sawhorse.lua @@ -0,0 +1,59 @@ +--[[ + Client stuff! +]] +local ENT = nrequire("sh_ent_sawhorse.lua") + +function ENT:Draw() + + self.Entity:DrawModel() + +end + +net.Receive("art_sawhorse_open",function() + local who = net.ReadEntity() + print("Opening sawhorse") + local selectframe = vgui.Create("DFrame") + selectframe:SetSize(ScrW()/2, ScrH()/2) + selectframe:Center() + selectframe:SetTitle("Sawhorse") + + local scroll = vgui.Create( "DScrollPanel",selectframe ) + scroll:Dock(FILL) + + local grid = vgui.Create( "DGrid", scroll ) + grid:SetPos( 10, 30 ) + grid:SetCols( 2 ) + grid:SetColWide( 200 ) + grid:SetRowHeight(100) + grid:Dock(FILL) + + print("s.props is",ENT.props) + PrintTable(ENT.props) + + for k,v in pairs(ENT.props) do + local p = vgui.Create("DPanel") + p:SetSize(200,100) + --p:Dock(FILL) + local but = vgui.Create("DModelPanel",p) + but:SetModel(v.model) + but:SetSize(100,100) + but:Dock(LEFT) + but.DoClick = function(self) + net.Start("art_sawhorse_select") + net.WriteString(k) + net.WriteEntity(who) + net.SendToServer() + print("I want to make a ", k) + end + local label = vgui.Create("DLabel",p) + label:SetSize(100,100) + label:Dock(RIGHT) + label:SetText(string.format("%s\nCost:%d wood",k,v.cost)) + label:SetDark(true) + grid:AddItem(p) + end + + selectframe:MakePopup() +end) + +scripted_ents.Register(ENT,"art_sawhorse") diff --git a/data/artery/global/art_sawhorse/sh_ent_sawhorse.lua b/data/artery/global/art_sawhorse/sh_ent_sawhorse.lua new file mode 100644 index 0000000..bf0e640 --- /dev/null +++ b/data/artery/global/art_sawhorse/sh_ent_sawhorse.lua @@ -0,0 +1,53 @@ + +local ENT = {} + +ENT.Type = "anim" +ENT.Base = "art_chest" +ENT.PrintName = "art_sawhorse" +ENT.Author = "Apickx" + +ENT.Spawnable = false +ENT.AdminSpawnable = false + +local skil = nrequire("sh_skillcommon.lua") +skil.RegisterSkill({"Crafting","Carpentry"}) + +ENT.props = { + ["A short board"] = { + model = "models/props_debris/wood_board06a.mdl", + cost = 1 + }, + ["A longer board"] = { + model = "models/props_debris/wood_board07a.mdl", + cost = 2, + }, + ["A pallet"] = { + model = "models/props_junk/wood_pallet001a.mdl", + cost = 2 + }, + ["A large flat peice of wood"] = { + model = "models/props_wasteland/wood_fence01a.mdl", + cost = 3 + }, + ["A small flat peice of wood"] = { + model = "models/props_wasteland/wood_fence02a.mdl", + cost = 2 + }, + ["A very strong, boyent fence"] = { + model = "models/props_c17/FurnitureShelf001a.mdl", + cost = 2 + }, + ["A round table"] = { + model = "models/props_c17/FurnitureTable001a.mdl", + cost = 1 + }, + ["A rectangle table"] = { + model = "models/props_c17/FurnitureTable002a.mdl", + cost = 1 + }, + ["A tall pole"] = { + model = "models/props_docks/dock01_pole01a_128.mdl", + cost = 2 + } +} +return ENT diff --git a/data/artery/global/art_sawhorse/sv_ent_sawhorse.lua b/data/artery/global/art_sawhorse/sv_ent_sawhorse.lua new file mode 100644 index 0000000..393aaed --- /dev/null +++ b/data/artery/global/art_sawhorse/sv_ent_sawhorse.lua @@ -0,0 +1,86 @@ +--[[ + This entity gives townies things to do +]] + +local ENT = nrequire("sh_ent_sawhorse.lua") + +DEFINE_BASECLASS("art_chest") -- this defined a local variable called BaseClass + +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) + +print("Hello from art_sawhorse init.lua!") + +local s = include("shared.lua") +local inv = nrequire("core/inventory/inventory.lua") +local itm = nrequire("core/inventory/item.lua") + +function ENT:Initialize( ) + self.InvType = "Crafting Inventory" + BaseClass.Initialize(self) + timer.Simple(0.1,function() + self.data.inventories[self:GetCreationID()].accepts = { + ["Wood"] = true, + } + end) + self.Entity:SetModel("models/props/cs_militia/sawhorse.mdl") + self.Entity:PhysicsInit( SOLID_VPHYSICS ) + self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) + self.Entity:SetSolid( SOLID_VPHYSICS ) + self.Entity:Activate() + local phys = self.Entity:GetPhysicsObject() + if (phys:IsValid()) then + phys:Wake() + phys:SetMass(100) + end + self.selfPos = self.Entity + self:SetUseType(SIMPLE_USE) +end + + +util.AddNetworkString("art_sawhorse_open") +util.AddNetworkString("art_sawhorse_select") +util.AddNetworkString("art_sawhorse_puzzle") +util.AddNetworkString("art_sawhorse_put") +util.AddNetworkString("art_sawhorse_close") + +function ENT:Use(a,c,u,v) + net.Start("art_sawhorse_open") + net.WriteEntity(self) + net.Send(c) + BaseClass.Use(self,a,c,u,v) +end + +net.Receive("art_sawhorse_select",function(ln,ply) + local name = net.ReadString() + local who = net.ReadEntity() + print("props are:") + PrintTable(ENT.props) + assert(ENT.props[name],"Player " .. ply:Nick() .. " tried to make a prop we don't have:" .. name) + local cost = ENT.props[name].cost + print("player wanted to make a ",name,cost) + local num = 0 + local myinv = who.data.inventories[who:GetCreationID()] + local cursor = myinv:Has("Wood") + local titm = nil + while cursor ~= nil and num < cost do + titm = myinv:Remove(cursor) + num = num + 1 + cursor = myinv:Has("Wood") + end + if num == cost then + local e = ents.Create("prop_physics") + e:SetPos(who:GetPos() + Vector(0,0,100)) + e:SetModel(ENT.props[name].model) + e:Spawn() + ply:AddSkill("Carpentry",cost) + else + --Put stuff back in if we didn't have enough! + for i = 1,num do + local pos = myinv:FindPlaceFor(titm) + myinv:Put(pos,titm) + end + end +end) + +scripted_ents.Register(ENT,"art_sawhorse") diff --git a/data/artery/global/art_shipyardcontrol/cl_ent_shipyardcontrol.lua b/data/artery/global/art_shipyardcontrol/cl_ent_shipyardcontrol.lua new file mode 100644 index 0000000..c9be7a6 --- /dev/null +++ b/data/artery/global/art_shipyardcontrol/cl_ent_shipyardcontrol.lua @@ -0,0 +1,64 @@ +--[[ + Client stuff! +]] +local ENT = nrequire("sh_ent_shipyardcontrol.lua") + +function ENT:Draw() + self:DrawModel() + +end + +net.Receive("art_shipyard_open",function() + local who = net.ReadEntity() + print("Opening shipyard") + local selectframe = vgui.Create("DFrame") + selectframe:SetSize(ScrW() / 2, ScrH() / 2) + selectframe:Center() + selectframe:SetTitle("Shipyard") + + local scroll = vgui.Create( "DScrollPanel",selectframe ) + scroll:Dock(FILL) + + local labelname = vgui.Create("DLabel",scroll) + labelname:Dock(TOP) + labelname:SetText("Ship name:") + labelname:SetDark(true) + + local textname = vgui.Create("DTextEntry",scroll) + textname:Dock(TOP) + + local buttonfinish = vgui.Create( "DButton", scroll ) + buttonfinish:SetText("Finish") + buttonfinish:Dock(TOP) + buttonfinish.DoClick = function() + net.Start("art_shipyard_finalize") + net.WriteEntity(who) + net.WriteString(textname:GetValue()) + net.SendToServer() + end + + selectframe:MakePopup() +end) + +--[[ + Display the bounds of shipyards +]] + +hook.Add( "PostDrawOpaqueRenderables", "artery_draw_shipyards", function() + local ztd = zones.FindByClass("artery_shipyard") + for k,v in pairs(ztd) do + local bounds = v.bounds + cam.Start3D2D( bounds.mins, Angle(0,0,0), 1 ) + local x,y = bounds.maxs.x - bounds.mins.x, -(bounds.maxs.y - bounds.mins.y) + surface.SetDrawColor( 238, 238, 255, 50 ) + surface.DrawRect( 0, 0, x, y ) + surface.SetDrawColor( 100,100,255,255) + surface.DrawLine(0,0,x,0) + surface.DrawLine(0,0,0,y) + surface.DrawLine(x,y,x,0) + surface.DrawLine(x,y,0,y) + cam.End3D2D() + end +end ) + +scripted_ents.Register(ENT,"art_shipyardcontrol") diff --git a/data/artery/global/art_shipyardcontrol/sh_ent_shipyardcontrol.lua b/data/artery/global/art_shipyardcontrol/sh_ent_shipyardcontrol.lua new file mode 100644 index 0000000..bb0026b --- /dev/null +++ b/data/artery/global/art_shipyardcontrol/sh_ent_shipyardcontrol.lua @@ -0,0 +1,13 @@ + + +local ENT = {} + +ENT.Type = "anim" +ENT.Base = "art_chest" +ENT.PrintName = "art_shipyardcontrol" +ENT.Author = "Apickx" + +ENT.Spawnable = false +ENT.AdminSpawnable = false + +return ENT diff --git a/data/artery/global/art_shipyardcontrol/sv_ent_shipyardcontrol.lua b/data/artery/global/art_shipyardcontrol/sv_ent_shipyardcontrol.lua new file mode 100644 index 0000000..ed1eed0 --- /dev/null +++ b/data/artery/global/art_shipyardcontrol/sv_ent_shipyardcontrol.lua @@ -0,0 +1,55 @@ +--[[ + This entity gives townies things to do +]] +if not nrequire then return end + +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) + +print("Hello from art_shipyardcontrol init.lua!") + +local ENT = nrequire("sh_ent_shipyardcontrol.lua") + +function ENT:Initialize( ) + self.Entity:SetModel("models/props/cs_militia/sawhorse.mdl") + self.Entity:PhysicsInit( SOLID_VPHYSICS ) + self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) + self.Entity:SetSolid( SOLID_VPHYSICS ) + self.Entity:Activate() + local phys = self.Entity:GetPhysicsObject() + if (phys:IsValid()) then + phys:Wake() + phys:SetMass(100) + end + self.selfPos = self.Entity + self:SetUseType(SIMPLE_USE) +end + + +util.AddNetworkString("art_shipyard_open") +util.AddNetworkString("art_shipyard_finalize") +util.AddNetworkString("art_shipyard_close") + +function ENT:Use(a,c,u,v) + net.Start("art_shipyard_open") + net.WriteEntity(self) + net.Send(c) +end + +net.Receive("art_shipyard_finalize",function(ln,ply) + print("Finalizing ship...") + local area = net.ReadEntity() + local name = net.ReadString() + print("Name will be", name) + print(area,area.Zone) + local zone = zones.List[area.Zone] + local bounds = zone.bounds + local allents = ents.FindInBox(bounds.mins,bounds.maxs) + duplicator.SetLocalPos( ply:GetPos()) + local boat = duplicator.Copy(allents[1]) + duplicator.SetLocalPos(Vector(0,0,0)) + print("Got boat") + PrintTable(boat) +end) + +scripted_ents.Register(ENT,"art_shipyardcontrol") diff --git a/data/artery/global/art_workbench/cl_ent_workbench.lua b/data/artery/global/art_workbench/cl_ent_workbench.lua new file mode 100644 index 0000000..8f4b722 --- /dev/null +++ b/data/artery/global/art_workbench/cl_ent_workbench.lua @@ -0,0 +1,63 @@ +--[[ + Client stuff! +]] +local ENT = nrequire("sh_ent_workbench.lua") + +function ENT:Draw() + + self.Entity:DrawModel() + +end + +net.Receive("art_workbench_open",function() + local who = net.ReadEntity() + print("Opening sawhorse") + local selectframe = vgui.Create("DFrame") + selectframe:SetSize(ScrW()/2, ScrH()/2) + selectframe:Center() + selectframe:SetTitle("Sawhorse") + + local scroll = vgui.Create( "DScrollPanel",selectframe ) + scroll:Dock(FILL) + + local grid = vgui.Create( "DGrid", scroll ) + grid:SetPos( 10, 30 ) + grid:SetCols( 2 ) + grid:SetColWide( 200 ) + grid:SetRowHeight(100) + grid:Dock(FILL) + + print("s.props is",ENT.props) + PrintTable(ENT.props) + + for k,v in pairs(ENT.props) do + local p = vgui.Create("DPanel") + p:SetSize(200,100) + --p:Dock(FILL) + local but = vgui.Create("DModelPanel",p) + but:SetModel(v.model) + but:SetSize(100,100) + but:Dock(LEFT) + but.DoClick = function(self) + net.Start("art_workbench_select") + net.WriteString(k) + net.WriteEntity(who) + net.SendToServer() + print("I want to make a ", k) + end + local label = vgui.Create("DLabel",p) + label:SetSize(100,100) + label:Dock(RIGHT) + local costtbl = {} + for k,v in pairs(v.reqs) do + costtbl[#costtbl+1] = string.format("%10s : %5d", k, v) + end + label:SetText(string.format("%s\nCost:\n%s",k,table.concat(costtbl,"\n"))) + label:SetDark(true) + grid:AddItem(p) + end + + selectframe:MakePopup() +end) + +scripted_ents.Register(ENT,"art_workbench") diff --git a/data/artery/global/art_workbench/sh_ent_workbench.lua b/data/artery/global/art_workbench/sh_ent_workbench.lua new file mode 100644 index 0000000..4900d3e --- /dev/null +++ b/data/artery/global/art_workbench/sh_ent_workbench.lua @@ -0,0 +1,37 @@ +if not nrequire then return end + +local ENT = {} + +ENT.Type = "anim" +ENT.Base = "art_chest" +ENT.PrintName = "art_sawhorse" +ENT.Author = "Apickx" + +ENT.Spawnable = false +ENT.AdminSpawnable = false + +local skil = nrequire("sh_skillcommon.lua") +skil.RegisterSkill({"Crafting","Toolbuilding"}) + +ENT.props = { + ["Hammer"] = { + model = "models/weapons/w_hammer.mdl", + reqs = { + ["Wood"] = 2, + ["Iron"] = 1 + } + }, + ["Nail"] = { + model = "models/crossbow_bolt.mdl", + reqs = { + ["Copper"] = 1 + } + }, + ["Paddle"] = { + model = "models/weapons/w_hammer.mdl", + reqs = { + ["Wood"] = 4 + } + } +} +return ENT diff --git a/data/artery/global/art_workbench/sv_ent_workbench.lua b/data/artery/global/art_workbench/sv_ent_workbench.lua new file mode 100644 index 0000000..9ce7e0f --- /dev/null +++ b/data/artery/global/art_workbench/sv_ent_workbench.lua @@ -0,0 +1,111 @@ +--[[ + This entity gives townies things to do +]] +if not nrequire then return end + +DEFINE_BASECLASS("art_chest") -- this defined a local variable called BaseClass + +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) + +print("Hello from art_workbench init.lua!") + +local ENT = nrequire("sh_ent_workbench.lua") +local inv = nrequire("core/inventory/inventory.lua") +local itm = nrequire("core/inventory/item.lua") + +function ENT:Initialize( ) + self.InvType = "Crafting Inventory" + BaseClass.Initialize(self) + timer.Simple(0.1,function() + self.data.inventories[self:GetCreationID()].accepts = { + ["Wood"] = true, + ["Copper"] = true, + ["Iron"] = true + } + end) + self.Entity:SetModel("models/props/cs_militia/sawhorse.mdl") + self.Entity:PhysicsInit( SOLID_VPHYSICS ) + self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) + self.Entity:SetSolid( SOLID_VPHYSICS ) + self.Entity:Activate() + local phys = self.Entity:GetPhysicsObject() + if (phys:IsValid()) then + phys:Wake() + phys:SetMass(100) + end + self.selfPos = self.Entity + self:SetUseType(SIMPLE_USE) +end + + +util.AddNetworkString("art_workbench_open") +util.AddNetworkString("art_workbench_select") +util.AddNetworkString("art_workbench_puzzle") +util.AddNetworkString("art_workbench_put") +util.AddNetworkString("art_workbench_close") + +function ENT:Use(a,c,u,v) + net.Start("art_workbench_open") + net.WriteEntity(self) + net.Send(c) + BaseClass.Use(self,a,c,u,v) +end + +function ENT:NumOf(name) + local myinv = self.data.inventories[self:GetCreationID()] + local cursor = myinv:Has(name) + local titm = nil + local num = 0 + while cursor ~= nil do + titm = myinv:Remove(cursor) + num = num + 1 + cursor = myinv:Has(name) + end + --Put stuff back in + for i = 1,num do + if titm ~= nil then + local pos = myinv:FindPlaceFor(titm) + myinv:Put(pos,titm) + end + end + + return num +end + +net.Receive("art_workbench_select",function(ln,ply) + local name = net.ReadString() + local who = net.ReadEntity() + print("props are:") + PrintTable(s.props) + assert(s.props[name],"Player " .. ply:Nick() .. " tried to make a prop we don't have:" .. name) + local reqs = s.props[name].reqs + print("player wanted to make a ",name,reqs) + PrintTable(reqs) + local canmake = true + for k,v in pairs(reqs) do + if who:NumOf(k) < v then + canmake = false + break + end + end + + local myinv = who.data.inventories[who:GetCreationID()] + if canmake then + print("Player can make, giveing") + xpcall(function() + ply:GiveItem(itm.GetItemByName(name)) + ply:AddSkill("Toolbuilding",#reqs) + for k,v in pairs(reqs) do + for i = 1,v do + local cur = myinv:Has(k) + myinv:Remove(cur) + end + end + end,function(err) + Msg("Failed to insert:" .. err) + end) + end +end) + +scripted_ents.Register(ENT,"art_workbench") diff --git a/data/artery/global/cl_crafting_inv.lua b/data/artery/global/cl_crafting_inv.lua new file mode 100644 index 0000000..ead7c3e --- /dev/null +++ b/data/artery/global/cl_crafting_inv.lua @@ -0,0 +1,3 @@ +--[[ + The client part +]] diff --git a/data/artery/global/cl_stranded_craftpanel.txt b/data/artery/global/cl_stranded_craftpanel.txt new file mode 100644 index 0000000..ee90f57 --- /dev/null +++ b/data/artery/global/cl_stranded_craftpanel.txt @@ -0,0 +1,20 @@ +--Maybe this will get used some day. + +do return end +local i = nrequire("cl_inventory.lua") + +i.ShowInventory() + +local otab = otab or nil +local function addcraftingtab() + if otab then otab:Remove() end + + local cpnl = vgui.Create("DPanel") + + + + otab = i.tabsheet:AddSheet("Crafting",cpnl,"icon16/user.png", false, false, "Craft things!") +end + + +addcraftingtab()
\ No newline at end of file diff --git a/data/artery/global/sh_chopwood.txt b/data/artery/global/sh_chopwood.txt new file mode 100644 index 0000000..46e2c07 --- /dev/null +++ b/data/artery/global/sh_chopwood.txt @@ -0,0 +1,239 @@ +--Wood chopping minigame +if not nrequire then return end +local meta = FindMetaTable("Player") +local itm = nrequire("item.lua") +local skil = nrequire("sh_skillcommon.lua") +skil.RegisterSkill({"Forageing","Woodcutting"}) + +local function isoutside(puzzle,width,height,position) --rewrite this at some point + print("Checking ",width,height,position) + PrintTable(puzzle) + + return position < width or position > ((height-1) * width) or --If we are top or bottom + position % width == 0 or (position + 1) % width == 0 or --If we are on either side + puzzle[position + width] == nil or puzzle[position - width] == nil or + puzzle[position + 1] == nil or puzzle[position - 1] == nil +end + +if SERVER then + util.AddNetworkString("artery_chop_wood_start") + util.AddNetworkString("artery_chop_wood_quit") + util.AddNetworkString("artery_chop_wood_action") + function puzzlefactory(width,height,veriety) + local puzzle = {} + local height,width = 4,4 + local avaliable = {} + for i = 0,width-1 do + table.insert(avaliable,i) --first row + table.insert(avaliable,(height-1) * width + i) --last row + end + for i = 1,height-2 do + table.insert(avaliable,width * i) --first column + end + for i = 2,height-1 do + table.insert(avaliable,(width * i) - 1 ) --last column + end + table.RemoveByValue(avaliable,-1) + for i = 0,((width*height)/2)-1 do + local pairtype = math.random(0,veriety-1) + --Randomly add tiles to the board, marking new places as avaliable as we go + local rs1 = table.remove(avaliable,math.random(1,#avaliable)) + local rs2 = table.remove(avaliable,math.random(1,#avaliable)) + puzzle[rs1] = pairtype + puzzle[rs2] = pairtype + local pot = { --Potential new avaliable spots to put things + rs1+width, + rs1-width, + rs2+width, + rs2-width, + } + --Add things left and right, but not if they jump left-to-right on the board + if rs1 % width ~= 0 then + pot[#pot+1] = rs1-1 + end + if rs1+1 % width ~= 0 then + pot[#pot+1] = rs1+1 + end + if rs2 % width ~= 0 then + pot[#pot+1] = rs2-1 + end + if rs2+1 % width ~= 0 then + pot[#pot+1] = rs2+1 + end + --Remove up-down things that go off the board + local npot = {} + for k,v in ipairs(pot) do + if puzzle[v] == nil and v >= 0 and v < height*width then + npot[#npot+1] = v + end + end + pot = npot + for k,v in ipairs(pot) do + local alreadyin = false + for i,j in ipairs(avaliable) do + if j == v then + alreadyin = true + break + end + end + if not alreadyin then + avaliable[#avaliable+1] = v + end + end + end + return puzzle + end + local playerpuzzles = {} + local playerpuzzledims = {} + function meta:ChopWood() + print("Chopwood called") + playerpuzzles[self] = puzzlefactory(4,4,5) + playerpuzzledims[self] = {4,4} + net.Start("artery_chop_wood_start") + net.WriteTable(playerpuzzles[self]) + net.WriteUInt(4,8) + net.WriteUInt(4,8) + net.Send(self) + end + local function kickcheater(who) + print("I think",who,"was cheating!!!") + end + net.Receive("artery_chop_wood_action",function(ln,ply) + local pos1 = net.ReadUInt(8) + local pos2 = net.ReadUInt(8) + local pz = playerpuzzles[ply] + local dim = playerpuzzledims[ply] + if isoutside(pz,dim[1],dim[2],pos1) and isoutside(pz,dim[1],dim[2],pos2) then + pz[pos1] = nil + pz[pos2] = nil + else + error("Player cheated!") + kickcheater(ply) + end + ply:SetLuaAnimation("stranded_chop_wood") + end) + net.Receive("artery_chop_wood_quit",function(ln,ply) + local pz = playerpuzzles[ply] + if #pz == 0 then + print("Player completed puzzle!") + local item = itm.GetItemByName("Wood") + ply:GiveItem(item) + ply:AddSkill("Woodcutting",1) + else + print("Player did not complete puzzle!") + end + ply:StopLuaAnimation("stranded_chop_wood") + end) +else --client + local svg = nrequire("cl_svg.lua") + local matmap = { + [0] = "materials/svg/delapouite/originals/svg/000000/transparent/log.svg", + "materials/svg/lorc/originals/svg/000000/transparent/root-tip.svg", + "materials/svg/lorc/originals/svg/000000/transparent/oak.svg", + "materials/svg/lorc/originals/svg/000000/transparent/pine-tree.svg", + "materials/svg/lorc/originals/svg/000000/transparent/dead-wood.svg", + + } + local matico = {} + for k,v in pairs(matmap) do + matico[k] = svg.MaterialFromSVG(v,nil,"rgb(0,0,0);") + end + local matico_selected = {} + for k,v in pairs(matmap) do + matico_selected[k] = svg.MaterialFromSVG(v,"rgb(100,100,200);","rgb(255,255,255);") + end + + net.Receive("artery_chop_wood_start",function() + local puzzle = net.ReadTable() + local width = net.ReadUInt(8) + local height = net.ReadUInt(8) + local puzzleview = vgui.Create( "DFrame" ) + puzzleview:SetSize( ScrW()*0.5, ScrH()*0.5 ) + puzzleview:Center() + puzzleview:SetTitle( "Chop wood..." ) + puzzleview:SetDraggable( true ) + puzzleview:MakePopup() + + local puzzlepane = vgui.Create( "DPanel", puzzleview ) + puzzlepane:Dock(FILL) + + local puzzlehelp = vgui.Create( "DLabel",puzzlepane) + puzzlehelp:SetText("To chop wood, match the cells in pairs.\nYou complete the puzzle when all the cells are gone.\nYou may only match cells that are not surrounded\nby other cells.") + puzzlehelp:SizeToContents() + puzzlehelp:SetDark(true) + puzzlehelp:Dock(RIGHT) + + local puzzlegrid = vgui.Create( "DGrid", puzzlepane ) + puzzlegrid:SetCols(width) + puzzlegrid:Dock(FILL) + + local numleft = width*height + local selected + for i = 0, width*height - 1 do + local tile = vgui.Create("DImageButton") + --tile:SetText(puzzle[i]) + local tmat = matico[puzzle[i]] + if tmat.material then + tile:SetMaterial(tmat.material) + end + tile.position = i + tile.number = puzzle[i] + --tile:SizeToContents() + tile:SetWidth(32) + tile:SetHeight(32) + tile:SetStretchToFit( true ) + tile:SetIsToggle(true) + tile.DoClick = function(self) + local tp = self.position + if not isoutside(puzzle,width,height,tp) then + print("Could not press this button!") + return + end + + + if selected == nil then + selected = self + self:SetToggle(true) + self:SetMaterial(matico_selected[self.number].material) + elseif self == selected then + print("Selected is self!") + self:SetToggle(false) + self:SetMaterial(matico[self.number].material) + selected = nil + else + if selected.number == self.number then + net.Start("artery_chop_wood_action") + net.WriteUInt(self.position,8) + net.WriteUInt(selected.position,8) + net.SendToServer() + puzzle[self.position] = nil + puzzle[selected.position] = nil + --puzzlegrid:RemoveItem(self) + --puzzlegrid:RemoveItem(selected) + self:Remove() + selected:Remove() + selected = nil + numleft = numleft - 2 + if numleft == 0 then + timer.Simple(0.5,function() + print("Puzzle is empty! sending quit!") + net.Start("artery_chop_wood_quit") + net.SendToServer() + end) + puzzleview:Remove() + else + print("Puzzle is") + PrintTable(puzzle) + end + end + end + end + puzzlegrid:AddItem(tile) + end + puzzlegrid:Center() + puzzlegrid:InvalidateLayout(true) + function puzzlegrid:PerformLayout(w,h)--Don't re-layout ourselves. + + end + end) +end diff --git a/data/artery/global/sh_crafting_inv.lua b/data/artery/global/sh_crafting_inv.lua new file mode 100644 index 0000000..d720551 --- /dev/null +++ b/data/artery/global/sh_crafting_inv.lua @@ -0,0 +1,193 @@ +--[[ + An inventory that accepts materials and can store 100's of them. +]] +--[[ + Public functions: + RegisterInventory(tbl_inventory) ::nil + Registers a new inventory prototype, see below + CreateInventory(string_name) ::table_inventory + Creates a new inventory be sure to set the .owner and .id fields! + CreateInventoryFromData(string_name,string_data)::table_inventory) + Just deserializes an inventory. You still need to set .owner and .id! + DeriveInventory(string_name) ::table_inventory + Creates a new inventory from an old, allows for heiarchy. + Inventories have the following structure + field returns + inv.Name ::string + The name! + inv:FindPlaceFor(item) ::table_position or nil + Finds a place for the item + inv:CanFitIn(table_position,item) ::boolean + Check if the item can fit in the position + inv:Put(table_position,item) ::nil + Put an item in at the position + inv:Has(string_or_compare_func) ::table_position or nil + find an item in the inventory + inv:Remove(position) ::table_item + Remove an item from the position + inv:Get(position) ::table_item + Get the item at a position + inv:Serialize() ::string + Serialize the item to store it in a db + inv:DeSerialize(str) ::table_inventory + recreate the item from data in serialize + The above fields must be defined for new inventories. + ----------------------------------------------------- + The below are automatically made if they do not exist. + inv:AddObserver(tbl_other) ::number_id Whenever put or remove is called on this inventory, tbl_other's put() and remove() is also called, for easy networking to whoever needs it + inv:RemoveObserver(number_id) ::nil Removes an observer from the inventory + ------------------------------------------------------ + These fields should be defined when an inventory is created, before it can be used + inv.Owner ::entity + inv.id ::number +]] +if not nrequire then return end +local reg = nrequire("core/inventory/inventory.lua") +local itm = nrequire("core/inventory/item.lua") +local i = {} + +i.Name = "Crafting Inventory" +i.materials = {} +i.accepts = {} + +function i:FindPlaceFor(item) + if not self.accepts[item.Name] then return nil end + return {item.Name} +end + +function i:CanFitIn(position,item) + return self.accepts[item.Name] +end + +function i:Put(pos,item) + self.materials[item.Name] = (self.materials[item.Name] or 0) + 1 +end + +function i:Has(str_or_cmp) + if type(str_or_cmp) == "function" then error("Tried to check has of a workbench with function") end + if (self.materials[str_or_cmp] or 0) > 0 then + return {str_or_cmp} + else + return nil + end +end + +function i:Remove(tbl) + local ret = itm.GetItemByName(tbl[1]) + assert(self.materials[ tbl[1] ] > 0, "Tried to remove a resource when we didn't have any!") + self.materials[ tbl[1] ] = self.materials[ tbl[1] ] - 1 + return ret +end + +function i:Get(tbl) + return itm.GetItemByName(tbl[1]) +end + +function i:Serialize() + local s = { + materials = self.materials, + accepts = self.accepts + } + return util.TableToJSON(s) +end + +function i:DeSerialize(data) + local cpy = table.Copy(self) + local d = util.JSONToTable(data) + cpy.materials = d.materials + cpy.accepts = d.accepts + return cpy +end + +if CLIENT then + local svg = nrequire("cl_svg.lua") + local com = nrequire("cl_common.lua") + local col = nrequire("colortheme.lua") + local c = col.ui.border + local inputimg = svg.MaterialFromSVG("materials/svg/delapouite/gui/svg/000000/transparent/plain-arrow.svg", nil, ucol) + + function i.DrawOnDPanel(self,dpanel) + local matpnls = {} + local matscroll = vgui.Create("DScrollPanel",dpanel) + matscroll:Dock(FILL) + + local inputpnl = vgui.Create("DModelPanel",dpanel) + --inputpnl:Dock(TOP) + inputpnl.PaintOver = function(tp,w,h) + if inputimg.material then + surface.SetDrawColor(c.r,c.g,c.b) + surface.DrawOutlinedRect(0, 0, h, h) + surface.SetDrawColor(255,255,255) + surface.SetMaterial( inputimg.material ) + surface.DrawTexturedRect( 0, 0, h, h ) + end + end + inputpnl:Receiver("item",com.generatereceiver()) + inputpnl:SetSize(50,50) + inputpnl.info = { + owner = self.Owner, + id = self.id, + pos = {"*"}, + inv = self + } + inputpnl:Dock(TOP) + + local function create_panel(k,v) + local pnlitem = {} + pnlitem.panel = vgui.Create("DPanel",matscroll) + pnlitem.panel:Dock(TOP) + pnlitem.text = vgui.Create("DLabel",pnlitem.panel) + pnlitem.text:SetText(string.format("%10s : %5d",k,v - 1)) + pnlitem.text:Dock(FILL) + pnlitem.text:SetDark(true) + local ta = vgui.Create("DModelPanel",pnlitem.panel) + ta:Dock(LEFT) + ta:Droppable("item") + ta.info = { + owner = self.Owner, + id = self.id, + pos = {k}, + inv = self + } + matpnls[k] = pnlitem + end + + for k,v in pairs(self.materials) do + if v > 0 then + create_panel(k,v) + end + end + + local function refresh_ammt(name,p) + local pnlitem = matpnls[ name ] + local ammt = self.materials[name] + if ammt == 0 or ammt == nil then + pnlitem.panel:Remove() + else + pnlitem.text:SetText(string.format("%10s : %5d",name,ammt)) --Called before the actual inventorie's put, so +1 + end + end + + local observer = {} + observer.Put = function(obs,position,item) + if self.materials[ item.Name ] == nil or self.materials[ item.Name ] == 0 then --Create a panel for the item + create_panel(item.Name,1) + else + refresh_ammt(item.Name,1) + end + --matslbls[ position[1] ]:SetText(self.materials[ position[1] ]) + --drawitemat(self,position[1],position[2],item) + end + observer.Remove = function(obs,position) + if self.materials[position[1]] == 1 then --Remove at 1 since this is called before inventory's remove() + matpnls[position[1]].panel:Remove() + end + refresh_ammt(position[1],-1) + --matslbls[ position[1] ]:SetText(self.materials[ position[1] ]) + --undrawitemat(self,position[1],position[2]) + end + return observer + end +end + +reg.RegisterInventory(i) diff --git a/data/artery/global/sh_minerock.txt b/data/artery/global/sh_minerock.txt new file mode 100644 index 0000000..0e6bcaf --- /dev/null +++ b/data/artery/global/sh_minerock.txt @@ -0,0 +1,371 @@ +if not nrequire then return end +local meta = FindMetaTable("Player") +local rockdata = { + {nil,0}, + {"Stone" , 15}, + {"Copper" , 30}, + {"Tin" , 60}, + {"Iron" , 120}, + {"Coal" , 180}, +} + +local skil = nrequire("sh_skillcommon.lua") +skil.RegisterSkill({"Forageing","Mineing"}) + +local function printpuzzle(puzzle) + Msg("========================") + for y = 0, puzzle.height-1 do + for x = 0, puzzle.width-1 do + Msg(puzzle.tiles[x][y]) + end + Msg("\n") + end +end + +local function findmatchesfortile(puzzle,x,y) + printpuzzle(puzzle) + local matches = {} + local pt = puzzle.tiles + local t = pt[x][y] + --Find horizontal matches + local matcheshoizontal = 1 + local cursor = x + 1 + local pot = {{x,y}} + while cursor < puzzle.width and pt[cursor][y] == t do + matcheshoizontal = matcheshoizontal + 1 + pot[#pot + 1] = {cursor,y} + cursor = cursor + 1 + end + cursor = x - 1 + while cursor >= 0 and pt[cursor][y] == t do + matcheshoizontal = matcheshoizontal + 1 + pot[#pot + 1] = {cursor,y} + cursor = cursor - 1 + end + if matcheshoizontal > 2 then + for k,v in ipairs(pot) do + matches[#matches+1] = v + end + end + + --Find verticle matches + local matchesverticle = 1 + cursor = y + 1 + pot = {{x,y}} + while cursor < puzzle.height and pt[x][cursor] == t do + matchesverticle = matchesverticle + 1 + pot[#pot + 1] = {x,cursor} + cursor = cursor + 1 + end + cursor = y - 1 + while cursor >= 0 and pt[x][cursor] == t do + matchesverticle = matchesverticle + 1 + pot[#pot + 1] = {x,cursor} + cursor = cursor - 1 + end + if matchesverticle > 2 then + for k,v in ipairs(pot) do + matches[#matches+1] = v + end + end + return matches +end + +local function canswitch(puzzle,x1,y1,x2,y2) + if x1 == x2 and (y1 + 1 == y2 or y1 - 1 == y2) or + y1 == y2 and (x1 + 1 == x2 or x1 - 1 == x2) then + local v1 = puzzle.tiles[x1][y1] + local v2 = puzzle.tiles[x2][y2] + local tcpy = table.Copy(puzzle) + tcpy.tiles[x2][y2] = v1 + tcpy.tiles[x1][y1] = v2 + printpuzzle(tcpy) + local m1 = findmatchesfortile(tcpy,x1,y1) + local m2 = findmatchesfortile(tcpy,x2,y2) + return #m1 > 0 or #m2 > 0 + end + return false +end + +local oremap = { + [0] = "materials/svg/faithtoken/originals/svg/000000/transparent/ore.svg", + "materials/svg/lorc/originals/svg/000000/transparent/rock.svg", + "materials/svg/lorc/originals/svg/000000/transparent/stone-block.svg", + "materials/svg/faithtoken/originals/svg/000000/transparent/minerals.svg", + "materials/svg/delapouite/originals/svg/000000/transparent/stone-pile.svg", + "materials/svg/lorc/originals/svg/000000/transparent/fossil.svg" + +} + +if SERVER then + local itm = nrequire("item.lua") + + for k,v in pairs(oremap) do + resource.AddSingleFile(v) + end + + util.AddNetworkString("artery_mine_rock_start") + util.AddNetworkString("artery_mine_rock_new") + util.AddNetworkString("artery_mine_rock_quit") + util.AddNetworkString("artery_mine_rock_action") + util.AddNetworkString("artery_mine_rocks_update") + + local function genpuzzle(width,height,variety) + local puzzle = {} + puzzle.width = width + puzzle.height = height + puzzle.variety = variety + puzzle.tiles = {} + + for i = 0,puzzle.width do + puzzle.tiles[i] = {} + for j = 0,puzzle.height do + puzzle.tiles[i][j] = math.random(0,puzzle.variety) + end + end + + return puzzle + end + + local function del_and_replace(puzzle,matches) + local tp = puzzle.tiles + local function dropcolumn(x,y,spaces) + print("dropping ", x,y) + for ty = y, 0, -1 do + tp[x][ty] = tp[x][ty - spaces] or math.random(0,puzzle.variety) + end + end + for k,v in pairs(matches) do + dropcolumn(v[1],v[2],1) + end + end + + + + local function findmatchesfor(puzzle) + local duped = {} + for i = 0, puzzle.width-1 do + duped [i] = {} + end + for y = 0,puzzle.height-1 do + for x = 0, puzzle.width-1 do + local matches = findmatchesfortile(puzzle,x,y) + for k,v in pairs(matches) do + duped[v[1]][v[2]] = true + end + end + end + local m = {} + for y = 0,puzzle.height-1 do + for x = 0, puzzle.width-1 do + if duped[x][y] then + m[#m+1] = {x,y} + end + end + end + return m + end + + local puzzles = {} + local scores = {} + function meta:MineRock() + local p = genpuzzle(5,5,4) + local m = findmatchesfor(p) + while #m > 0 do + del_and_replace(p,m) + m = findmatchesfor(p) + end + puzzles[self] = p + scores[self] = 0 + self:StartAnimation("stranded_mine_rocks") + net.Start("artery_mine_rock_start") + net.WriteTable(p) + net.Send(self) + end + + local function kick_cheating_player(who) + error(who:Nick() .. " was cheating!") + end + + net.Receive("artery_mine_rock_action",function(ln,ply) + local p = puzzles[ply] + local x1 = net.ReadUInt(8) + local y1 = net.ReadUInt(8) + local x2 = net.ReadUInt(8) + local y2 = net.ReadUInt(8) + if not canswitch(p,x1,y1,x2,y2) then + kick_cheating_player(ply) + end + local v1,v2 = p.tiles[x1][y1],p.tiles[x2][y2] + p.tiles[x2][y2] = v1 + p.tiles[x1][y1] = v2 + local m = findmatchesfor(p) + while #m > 0 do + scores[ply] = scores[ply] + #m + del_and_replace(p,m) + m = findmatchesfor(p) + end + printpuzzle(p) + net.Start("artery_mine_rocks_update") + net.WriteTable(p) + net.WriteDouble(scores[ply]) + net.Send(ply) + ply:StartAnimation("stranded_mine_rock") + end) + + net.Receive("artery_mine_rock_quit",function(ln,ply) + local s = scores[ply] + local cursor = 1 + while cursor <= #rockdata and s >= rockdata[cursor][2] do + cursor = cursor + 1 + end + local n = rockdata[cursor-1][1] + if n == nil then return end + local togive = itm.GetItemByName(n) + ply:GiveItem(togive) + ply:AddSkill("Mineing",s) + ply:StopAnimation("stranded_mine_rock") + end) +else + local svg = nrequire("cl_svg.lua") + + local mine = {} + local tbl + local puzzleview + local rocks = {} + + local oremats = {} + for k,v in pairs(oremap) do + oremats[k] = svg.MaterialFromSVG(v,nil,"rgb(0,0,0);") + end + local oremats_selected = {} + for k,v in pairs(oremap) do + oremats_selected[k] = svg.MaterialFromSVG(v,"rgb(100,100,200);","rgb(255,255,255);") + end + net.Receive("artery_mine_rock_start",function() + tbl = net.ReadTable() + puzzleview = vgui.Create( "DFrame" ) + puzzleview:SetSize( ScrW()*0.5, ScrH()*0.5 ) + puzzleview:Center() + puzzleview:SetTitle( "Mine Rocks..." ) + puzzleview:SetDraggable( true ) + puzzleview:MakePopup() + puzzleview.OnClose = function(self) + net.Start("artery_mine_rock_quit") + net.SendToServer() + end + + local puzzlepane = vgui.Create( "DPanel", puzzleview ) + puzzlepane:Dock(FILL) + + local help = vgui.Create("DLabel",puzzlepane) + help:SetText("Click two cells to switch them.\nCreate runs of 3 or more to clear them from the board\nNew numbers come in from the top\nQuit at any time to receive the resource you have worked towards.") + help:SetDark(true) + help:SizeToContents() + help:Dock(RIGHT) + + local rocklayout = vgui.Create("DPanel",puzzlepane) + rocklayout:Dock(BOTTOM) + + local rockprogress = vgui.Create( "DProgress",rocklayout ) + rockprogress:Dock(FILL) + + local rocknameleft = vgui.Create("DLabel",rocklayout) + rocknameleft:Dock(LEFT) + rocknameleft:SetDark(true) + rocknameleft:SetText("") + + local rocknameright = vgui.Create("DLabel",rocklayout) + rocknameright:Dock(RIGHT) + rocknameright:SetDark(true) + rocknameright:SetText(rockdata[2][1]) + + rocks = {rockprogress,rocknameleft,rocknameright} + + local puzzlegrid = vgui.Create( "DGrid", puzzlepane ) + puzzlegrid:SetCols(tbl.width) + puzzlegrid:Dock(TOP) + local selected + for y = 0,tbl.height-1 do + for x = 0,tbl.width-1 do + local tile = vgui.Create("DImageButton") + mine[x] = mine[x] or {} + mine[x][y] = tile + local tmat = oremats[tbl.tiles[x][y]] + if tmat.material then + tile:SetMaterial(tmat.material) + end + tile:SetStretchToFit( true ) + tile.position = {x,y} + tile:SetWidth(32) + tile:SetHeight(32) + tile:SetIsToggle(true) + tile.OnToggled = function(self,state) + if state then + self:SetMaterial(oremats_selected[tbl.tiles[x][y]].material) + else + self:SetMaterial(oremats[tbl.tiles[x][y]].material) + end + end + tile.DoClick = function(self) + if selected == nil then + selected = self + self:SetToggle(true) + self:OnToggled(true) + elseif selected ~= self then + --Check if we can switch + local sp = selected.position + local tp = self.position + if canswitch(tbl,sp[1],sp[2],tp[1],tp[2]) then + net.Start("artery_mine_rock_action") + net.WriteUInt(sp[1],8) + net.WriteUInt(sp[2],8) + net.WriteUInt(tp[1],8) + net.WriteUInt(tp[2],8) + net.SendToServer() + local v1,v2 = selected:GetText(),self:GetText() + selected:SetText(v2) + self:SetText(v1) + selected:SetToggle(false) + selected:OnToggled(false) + selected = nil + end + else + selected:SetToggle(false) + selected:OnToggled(false) + selected = nil + end + end + puzzlegrid:AddItem(tile) + end + end + + end) + + net.Receive("artery_mine_rocks_update",function() + tbl = net.ReadTable() + local score = net.ReadDouble() + puzzleview:SetTitle("Mine Rocks... (" .. score .. ")") + printpuzzle(tbl) + for y = 0, tbl.height-1 do + for x = 0, tbl.width-1 do + mine[x][y]:SetMaterial(oremats[(tbl.tiles[x][y])].material) + end + end + if score > rockdata[#rockdata][2] then + puzzleview:Close() + return + end + for k,v in ipairs(rockdata) do + if score >= v[2] then + local l = v[2] + local n = rockdata[k+1][2] + local frac = (score-l) / (n - l) + rocks[1]:SetFraction(frac) + rocks[2]:SetText(v[1] or "") + rocks[3]:SetText(rockdata[k+1][1]) + end + end + end) + +end diff --git a/data/artery/global/sh_shipyard.txt b/data/artery/global/sh_shipyard.txt new file mode 100644 index 0000000..b29c63c --- /dev/null +++ b/data/artery/global/sh_shipyard.txt @@ -0,0 +1,63 @@ +--[[ + A hunting ground zone will occasionally spawn a monster near a player that will go attack the player +]] +zones.RegisterClass("artery_shipyard",Color(238,238,255)) + +--Use this to set default properties. Only called on server. +hook.Add("OnZoneCreated","artery_outpost",function(zone,class,zoneID) + if class == "artery_shipyard" then + zone.datatbl = {} + zone.datatbl.control = ents.Create("art_shipyardcontrol") + zone.datatbl.control:SetPos(Entity(1):GetPos()) + zone.datatbl.control:Spawn() + zone.datatbl.control.Zone = zoneID + end +end) + +-- Use this hook to let a player change a zone after making it or with the edit tool. +-- class is zone.class, zone is the zone's full table, DPanel is a panel to parent your things to, zoneID is the zone's ID, DFrame is the whole frame. +-- Return your preferred width and height for the panel and the frame will size to it. +hook.Add("ShowZoneOptions","artery_shipyard",function(zone,class,DPanel,zoneID,DFrame) + if class == "artery_shipyard" then + local w,h = 500, 400 + + local scroll = vgui.Create( "DScrollPanel",DPanel) + scroll:Dock(FILL) + + function synctbl() + net.Start("artery_shipyard_settbl") + net.WriteFloat(zoneID) + net.WriteTable(zone.datatbl) + net.SendToServer() + end + + print("Displaying table, my table is") + PrintTable(zone.datatbl) + + local shipinstr = vgui.Create("DLabel",DPanel) + shipinstr:Dock(TOP) + shipinstr:SetText("Find the control entity, and palce it somewhere reasonable.") + shipinstr:SetDark(true) + shipinstr:SizeToContents() + + return w, h -- Specify the width and height for the DPanel container. The frame will resize accordingly. + + end +end) + +if SERVER then + util.AddNetworkString("artery_shipyard_settbl") + net.Receive("artery_shipyard_settbl",function(len,ply) + print("Server change received!") + local id, new = net.ReadFloat(), net.ReadTable() + print("New table is:") + PrintTable(new) + if not ply:IsAdmin() then return end + local zone = zones.List[id] + zone.datatbl = new + if new.Name then + zone.Name = new.Name + end + zones.Sync() + end) +end diff --git a/data/artery/global/sh_stranded_items.txt b/data/artery/global/sh_stranded_items.txt new file mode 100644 index 0000000..5551f3b --- /dev/null +++ b/data/artery/global/sh_stranded_items.txt @@ -0,0 +1,61 @@ +--Some items from stranded +if not nrequire then return end +local reg = nrequire("item.lua") + +local items = { + { + Name = "Stone", + Description = "A bit of rock", + pacname = "error.mdl", + }, + { + Name = "Copper", + Description = "A dull orange metal", + pacname = "error.mdl", + }, + { + Name = "Tin", + Description = "A brittle shiny metal", + pacname = "error.mdl", + }, + { + Name = "Iron", + Description = "A strong gray metal", + pacnme = "error.mdl", + }, + { + Name = "Coal", + Description = "Compressed dead stuff", + pacname = "error.mdl" + }, + { + Name = "Wood", + Description = "It probably floats...", + pacname = "error.mdl" + }, + { + Name = "Nail", + Description = "Put things together!", + pacname = "error.mdl" + } +} + +local base = {} + +function base:Serialize() + return "" +end + +function base:DeSerialize(str) + return self +end + +base.Shape = {{true}} + +for k,v in pairs(items) do + local b = table.Copy(base) + for i,j in pairs(v) do + b[i] = j + end + reg.RegisterItem(b) +end diff --git a/data/artery/global/sh_stranded_tools.txt b/data/artery/global/sh_stranded_tools.txt new file mode 100644 index 0000000..c11241c --- /dev/null +++ b/data/artery/global/sh_stranded_tools.txt @@ -0,0 +1,210 @@ +--This is a test file! +if not nrequire then return end +local reg = nrequire("item.lua") +local pac +if SERVER then + pac = nrequire("core/pac/sv_pac.lua") +end + +local skil = nrequire("sh_skillcommon.lua") +skil.RegisterSkill({"Sailing","Paddleing"}) + +local paddleents = {} +hook.Add("Tick","paddleents",function() + for k,v in pairs(paddleents) do + --Make sure the player is still on the boat + --Find the entity below the player + local tr = util.TraceLine({ + start = v:GetPos() + Vector(0,0,20), + endpos = v:GetPos() + Vector(0,0,-20), + filter = v + }) + --And Add some velocity to it + if tr.Entity and IsValid(tr.Entity) then + --Move the boat + local oldvel = tr.Entity:GetVelocity() + local eye = v:EyeAngles():Forward() + eye.z = 0 + local newvel = oldvel + (eye * 5) * tr.Entity:GetPhysicsObject():GetMass() + k:GetPhysicsObject():SetVelocity(newvel) + print("newvel is", newvel) + v:AddSkill("Paddleing",0.1) + end + --Add skill for the player + --Turn the boat + --local angdif = v:EyeAngles().yaw - k:GetAngles().yaw + --k:GetPhysicsObject():SetAngleVelocity(Angle(0,angdif,0)) + end +end) + +local items = { + { + Name = "Axe", + Tooltip = "Usefull for cutting down trees", + Shape = { + {true,true}, + {true}, + {true} + }, + Model = "error.mdl", + pacname = "stranded_axe", + onClick = function(self, ply) --Run server side + print("Trying to chop...") + local tr = ply:GetEyeTrace() + print("Mattype:",tr.MatType,"Needed:",MAT_WOOD) + if tr.MatType == MAT_WOOD then + print("Chopping....") + ply:ChopWood() + end + end + }, + { + Name = "Pickaxe", + Tooltip = "Maybe you can dig up rocks with this", + Shape = { + {true,true,true}, + {false,true}, + {false, true}, + }, + Model = "error.mdl", + pacname = "stranded_pickaxe", + onClick = function(self, ply) --Run server side + print("Trying to pick...") + local tr = ply:GetEyeTrace() + print("Mattype:",tr.MatType,"Needed:",MAT_CONCRETE) + if tr.MatType == MAT_CONCRETE then + print("Chopping....") + ply:MineRock() + end + end + }, + { + Name = "Hammer", + Tooltip = "You should be able to build things with this", + Shape = { + {true,true,true}, + {false,true}, + {false,true}, + }, + Model = "error.mdl", + pacname = "stranded_hammer", + onClick = function(self,ply) + print("trying to hammer") + local tr = ply:GetEyeTrace() + local tents = {} + local cursor = 0 + local firstsucpos = nil + while IsValid(tr.Entity) and tr.Entity != game.GetWorld() and cursor < 4 do + firstsucpos = firstsucpos or tr.HitPos + tents[#tents+1] = tr.Entity + tnents = table.Copy(tents) + tnents[#tnents + 1] = ply + tr = util.TraceLine({ + start = tr.HitPos, + endpos = tr.HitPos + ply:EyeAngles():Forward() * 10, + filter = tnents + }) + cursor = cursor + 1 + end + print("found ents:") + PrintTable(tents) + --See if the player has nails + local nloc = ply:HasItem("Nail") + if nloc then + print("nlock was truthy, hammering...") + ply:RemoveItem(nloc) + local nail = ents.Create("prop_dynamic") + print("Setting pos to:",firstsucpos) + nail:SetPos(firstsucpos) + nail:SetAngles(ply:EyeAngles()) + nail:SetModel("models/crossbow_bolt.mdl") + nail:Spawn() + for k,v in pairs(tents) do + for i,j in pairs(tents) do + if v != j then + print("Welding ",j," to ", v) + constraint.Weld(j,v,0,0,100000,true,false) + end + end + end + nail:SetParent(tents[1]) + end + end + }, + { + Name = "Paddle", + Tooltip = "Row Row Row your boat", + Shape = { + {true}, + {true}, + {true} + }, + Model = "error.mdl", + pacname = "stranded_axe", + onClick = function(self, ply) --Run server side + --If we're current paddleing, stop + if self.paddleing then + print("paddleing ent removed") + paddleents[self.paddleing] = nil + self.paddleing = nil + return + end + + --Find the entity below the player + local tr = util.TraceLine({ + start = ply:GetPos() + Vector(0,0,20), + endpos = ply:GetPos() + Vector(0,0,-20), + filter = ply + }) + --And Add some velocity to it + if tr.Entity and IsValid(tr.Entity) then + print("Paddleing ent added") + self.paddleing = tr.Entity + paddleents[tr.Entity] = ply + end + end + }, +} + +local base = {} + +function base:Serialize() + return "" +end + +function base:DeSerialize() + return self +end + +function base:DoOnPanel(dmodelpanel) + dmodelpanel:SetModel(self.Model) +end + +function base:DoOnEquipPanel(dmodelpanel) + dmodelpanel:SetModel(self.Model) +end + +base.Equipable = "Right Hand" + +function base:onDropped(ent) + if CLIENT then return end + pac.ApplyPac(ent,self.pacname) + ent:SetAngles(Angle(180,0,0)) + ent:SetColor(Color(0,0,0,0)) +end + +function base:onEquip(ent) + if CLIENT then return end + pac.ApplyPac(ent,self.pacname) +end + +function base:onUnEquip(ent) + if CLIENT then return end + pac.RemovePac(ent,self.pacname) +end + +for k,v in pairs(items) do + local tbase = table.Copy(base) + for i,j in pairs(v) do tbase[i] = j end + reg.RegisterItem(tbase) +end diff --git a/data/artery/global/sv_config.txt b/data/artery/global/sv_config.txt new file mode 100644 index 0000000..30efdc3 --- /dev/null +++ b/data/artery/global/sv_config.txt @@ -0,0 +1,10 @@ +do return end +if not nrequire then return end +local n = nrequire("sv_newplayer.lua") + +n.newmeta = function() + return { + lastserver = "67.163.245.187:27015", + lastlocation = "175 325 524" + } +end diff --git a/data/artery/global/sv_dupboat.lua b/data/artery/global/sv_dupboat.lua new file mode 100644 index 0000000..1a32d0c --- /dev/null +++ b/data/artery/global/sv_dupboat.lua @@ -0,0 +1,38 @@ +if not nrequire then return end +duplicator.Allow("prop_physics") + +local dups = {} + +local function copyplayer(ply,cmd,args) + local tr = util.TraceLine({ + start = ply:GetPos(), + endpos = ply:GetPos() + Vector(0,0,-100), + }) + local ent = tr.Entity + print('Ent is', ent) + duplicator.SetLocalPos( ply:GetPos()) + local dup = duplicator.Copy(ent) + duplicator.SetLocalPos(Vector(0,0,0)) + print("After normalizing, dup was") + PrintTable(dup) + dups[args[1]] = dup + print("saved boat as", args[1]) +end + +local function pasteplayer(ply,cmd,args) + print("Pasteing ", args[1]) + local dup = dups[args[1]] + print("Before setting up under player, dup is") + PrintTable(dup) + for k,v in pairs(dup.Entities) do + v.Pos = v.Pos + ply:GetPos() + end + print("After setting up under player, dup is") + PrintTable(dup) + duplicator.SetLocalPos( ply:GetPos()) + duplicator.Paste(ply,dup.Entities, dup.Constraints) + duplicator.SetLocalPos(Vector(0,0,0)) +end + +concommand.Add("artery_copyboat",copyplayer) +concommand.Add("artery_pasteboat",pasteplayer) diff --git a/data/artery/pacs/stranded_axe.txt b/data/artery/pacs/stranded_axe.txt new file mode 100644 index 0000000..24f1ba1 --- /dev/null +++ b/data/artery/pacs/stranded_axe.txt @@ -0,0 +1,169 @@ +[1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/shadertest/shader2", + ["EditorExpand"] = true, + ["UniqueID"] = "3857400208", + ["ClassName"] = "material", + }, + }, + [2] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["ClassName"] = "submaterial", + ["UniqueID"] = "848772817", + ["SubMaterialId"] = 1, + ["Material"] = "models/shiny", + ["EditorExpand"] = true, + }, + }, + [2] = { + ["children"] = { + }, + ["self"] = { + ["Material"] = "models/shadertest/shader2", + ["ClassName"] = "submaterial", + ["UniqueID"] = "743385126", + ["SubMaterialId"] = 2, + }, + }, + [3] = { + ["children"] = { + }, + ["self"] = { + ["Material"] = "models/shadertest/shader2", + ["ClassName"] = "submaterial", + ["UniqueID"] = "759764696", + ["SubMaterialId"] = 3, + }, + }, + }, + ["self"] = { + ["Angles"] = Angle(90, 0, 0), + ["Position"] = Vector(-0.40000000596046, 0.20000000298023, 2.5999999046326), + ["ClassName"] = "model", + ["Size"] = 0.1, + ["EditorExpand"] = true, + ["Model"] = "models/props_phx/construct/metal_angle180.mdl", + ["UniqueID"] = "3004133808", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Angles"] = Angle(90, 0, 0), + ["Position"] = Vector(-1.2000000476837, 0, 1.6000000238419), + ["Size"] = 0.65, + ["EditorExpand"] = true, + ["UniqueID"] = "4219853905", + ["Model"] = "models/hunter/blocks/cube025x05x025.mdl", + ["Scale"] = Vector(0.050000000745058, 0.40000000596046, 0.69999998807907), + }, + }, + [2] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/shadertest/shader2", + ["ClassName"] = "material", + ["UniqueID"] = "3811385586", + }, + }, + }, + ["self"] = { + ["EditorExpand"] = true, + ["UniqueID"] = "2375917376", + ["Position"] = Vector(1.2999999523163, -6.4000000953674, -0.69999998807907), + ["Size"] = 0.3, + ["Model"] = "models/hunter/blocks/cube025x05x025.mdl", + ["ClassName"] = "model", + }, + }, + [2] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props_canal/canal_bridge_railing_01b", + ["ClassName"] = "material", + ["UniqueID"] = "1381006363", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Position"] = Vector(-2, 0, 0), + ["UniqueID"] = "3499724895", + ["Size"] = 0.175, + ["EditorExpand"] = true, + ["Model"] = "models/Mechanics/roboticslarge/a1.mdl", + ["Scale"] = Vector(0.10000000149012, 1, 1), + }, + }, + [2] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props/CS_militia/roofbeams01", + ["ClassName"] = "material", + ["UniqueID"] = "3929484889", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Angles"] = Angle(0, 90, 0), + ["Position"] = Vector(-1.1000000238419, 10.800000190735, 1), + ["Size"] = 0.1, + ["EditorExpand"] = true, + ["UniqueID"] = "3940885241", + ["Model"] = "models/Mechanics/roboticslarge/a1.mdl", + ["Scale"] = Vector(1.7000000476837, 0.80000001192093, 0.80000001192093), + }, + }, + [3] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props/CS_militia/roofbeams01", + ["ClassName"] = "material", + ["UniqueID"] = "3929484889", + }, + }, + }, + ["self"] = { + ["UniqueID"] = "604755923", + ["Scale"] = Vector(1, 0.30000001192093, 1), + ["Angles"] = Angle(0, 0, 90), + ["Size"] = 0.175, + ["ClassName"] = "model", + ["Position"] = Vector(4.3000001907349, -0.30000001192093, -12.199999809265), + ["Bone"] = "right hand", + ["Model"] = "models/hunter/blocks/cube025x8x025.mdl", + ["EditorExpand"] = true, + }, + }, + }, + ["self"] = { + ["EditorExpand"] = true, + ["UniqueID"] = "3044246722", + ["ClassName"] = "group", + ["Name"] = "my outfit", + ["Description"] = "add parts to me!", + }, +}, diff --git a/data/artery/pacs/stranded_hammer.txt b/data/artery/pacs/stranded_hammer.txt new file mode 100644 index 0000000..536a25c --- /dev/null +++ b/data/artery/pacs/stranded_hammer.txt @@ -0,0 +1,132 @@ +[1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/shadertest/shader2", + ["ClassName"] = "material", + ["UniqueID"] = "3811385586", + }, + }, + [2] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["ClassName"] = "clip", + ["UniqueID"] = "3481453502", + ["Position"] = Vector(-2.7000000476837, 0.10000000149012, 0.10000000149012), + }, + }, + [2] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/shadertest/shader2", + ["ClassName"] = "material", + ["UniqueID"] = "1178439151", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Position"] = Vector(1.5, -0.30000001192093, 1.7000000476837), + ["UniqueID"] = "1673240401", + ["Size"] = 0.4, + ["EditorExpand"] = true, + ["Model"] = "models/mechanics/solid_steel/type_b_2_2.mdl", + ["Scale"] = Vector(0.5, 1, 1), + }, + }, + }, + ["self"] = { + ["EditorExpand"] = true, + ["UniqueID"] = "2375917376", + ["Position"] = Vector(1.2999999523163, -6.4000000953674, -0.69999998807907), + ["Size"] = 0.3, + ["Model"] = "models/hunter/blocks/cube025x05x025.mdl", + ["ClassName"] = "model", + }, + }, + [2] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props/CS_militia/roofbeams01", + ["ClassName"] = "material", + ["UniqueID"] = "3916920670", + }, + }, + [2] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props_canal/canal_bridge_railing_01b", + ["ClassName"] = "material", + ["UniqueID"] = "1381006363", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Position"] = Vector(-2, 0, 0), + ["UniqueID"] = "3499724895", + ["Size"] = 0.175, + ["EditorExpand"] = true, + ["Model"] = "models/Mechanics/roboticslarge/a1.mdl", + ["Scale"] = Vector(0.10000000149012, 1, 1), + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Angles"] = Angle(0, 90, 0), + ["Position"] = Vector(-1.1000000238419, 10.800000190735, 1), + ["Size"] = 0.1, + ["EditorExpand"] = true, + ["UniqueID"] = "3940885241", + ["Model"] = "models/Mechanics/roboticslarge/a1.mdl", + ["Scale"] = Vector(1.7000000476837, 0.80000001192093, 0.80000001192093), + }, + }, + [3] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props/CS_militia/roofbeams01", + ["ClassName"] = "material", + ["UniqueID"] = "4154414049", + }, + }, + }, + ["self"] = { + ["UniqueID"] = "604755923", + ["Scale"] = Vector(1, 0.30000001192093, 1), + ["Angles"] = Angle(0, 0, 90), + ["Size"] = 0.175, + ["ClassName"] = "model", + ["Position"] = Vector(4.3000001907349, -0.30000001192093, -12.199999809265), + ["Bone"] = "right hand", + ["Model"] = "models/hunter/blocks/cube025x8x025.mdl", + ["EditorExpand"] = true, + }, + }, + }, + ["self"] = { + ["EditorExpand"] = true, + ["UniqueID"] = "3044246722", + ["ClassName"] = "group", + ["Name"] = "my outfit", + ["Description"] = "add parts to me!", + }, +}, diff --git a/data/artery/pacs/stranded_pickaxe.txt b/data/artery/pacs/stranded_pickaxe.txt new file mode 100644 index 0000000..79afe6c --- /dev/null +++ b/data/artery/pacs/stranded_pickaxe.txt @@ -0,0 +1,146 @@ +[1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/shadertest/shader2", + ["ClassName"] = "material", + ["UniqueID"] = "3811385586", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Angles"] = Angle(-67, -90, 0), + ["Position"] = Vector(-1.6000000238419, -2.7999999523163, 1.5), + ["Size"] = 0.025, + ["EditorExpand"] = true, + ["UniqueID"] = "961675025", + ["Model"] = "models/XQM/CoasterTrack/slope_45_4.mdl", + ["Scale"] = Vector(1.2999999523163, 0.40000000596046, 1), + }, + }, + [2] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/shadertest/shader2", + ["ClassName"] = "material", + ["UniqueID"] = "125059266", + }, + }, + }, + ["self"] = { + ["EditorExpand"] = true, + ["UniqueID"] = "2375917376", + ["Position"] = Vector(0.60000002384186, -8.5, -0.69999998807907), + ["Size"] = 0.3, + ["Model"] = "models/hunter/blocks/cube025x05x025.mdl", + ["ClassName"] = "model", + }, + }, + [2] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props/CS_militia/roofbeams01", + ["ClassName"] = "material", + ["UniqueID"] = "220454820", + }, + }, + [3] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props/CS_militia/roofbeams01", + ["ClassName"] = "material", + ["UniqueID"] = "2042514392", + }, + }, + [2] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props_canal/canal_bridge_railing_01b", + ["ClassName"] = "material", + ["UniqueID"] = "1381006363", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Position"] = Vector(-5.6999998092651, 0.20000000298023, 0), + ["UniqueID"] = "3499724895", + ["Size"] = 0.175, + ["EditorExpand"] = true, + ["Model"] = "models/Mechanics/roboticslarge/a1.mdl", + ["Scale"] = Vector(0.10000000149012, 1, 1), + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Angles"] = Angle(0, 90, 0), + ["Position"] = Vector(-1.1000000238419, 17.89999961853, 1), + ["Size"] = 0.1, + ["EditorExpand"] = true, + ["UniqueID"] = "3940885241", + ["Model"] = "models/Mechanics/roboticslarge/a1.mdl", + ["Scale"] = Vector(2.4000000953674, 0.80000001192093, 0.80000001192093), + }, + }, + [4] = { + ["children"] = { + [1] = { + ["children"] = { + }, + ["self"] = { + ["BaseTexture"] = "models/props_wasteland/wood_fence01a", + ["ClassName"] = "material", + ["UniqueID"] = "1916154362", + }, + }, + }, + ["self"] = { + ["ClassName"] = "model", + ["Position"] = Vector(-1.0499999523163, -13.5, 1), + ["UniqueID"] = "2083901253", + ["Size"] = 0.225, + ["EditorExpand"] = true, + ["Model"] = "models/mechanics/solid_steel/type_b_2_2.mdl", + ["Scale"] = Vector(0.5, 1, 1), + }, + }, + }, + ["self"] = { + ["UniqueID"] = "604755923", + ["Scale"] = Vector(1, 0.40000000596046, 1), + ["Angles"] = Angle(0, 0, 90), + ["Size"] = 0.175, + ["ClassName"] = "model", + ["Position"] = Vector(4.3000001907349, -0.30000001192093, -22.700000762939), + ["Bone"] = "right hand", + ["Model"] = "models/hunter/blocks/cube025x8x025.mdl", + ["EditorExpand"] = true, + }, + }, + }, + ["self"] = { + ["EditorExpand"] = true, + ["UniqueID"] = "3044246722", + ["ClassName"] = "group", + ["Name"] = "my outfit", + ["Description"] = "add parts to me!", + }, +}, diff --git a/lua/autorun/animations.lua b/lua/autorun/animations.lua new file mode 100644 index 0000000..f8aae38 --- /dev/null +++ b/lua/autorun/animations.lua @@ -0,0 +1,353 @@ +hook.Add("OnGamemodeLoaded","artery_stranded_anims",function() +RegisterLuaAnimation('stranded_chop_wood', { + FrameData = { + { + BoneInfo = { + ['ValveBiped.Bip01_R_Calf'] = { + RU = 52.7383 + }, + ['ValveBiped.Bip01_R_Thigh'] = { + RU = -45.5908, + RR = 32.311, + RF = 19.3292 + }, + ['ValveBiped.Bip01_Spine2'] = { + RF = -12.8903 + }, + ['ValveBiped.Bip01_R_UpperArm'] = { + RU = 4.6922, + RR = 28.2239, + RF = 95.649 + }, + ['ValveBiped.Bip01_Spine'] = { + }, + ['ValveBiped.Bip01_R_Forearm'] = { + RU = 6.7985, + RR = -138.8409, + RF = -3.6922 + }, + ['ValveBiped.Bip01_L_UpperArm'] = { + RU = -118.8375, + RR = 1.33, + RF = -18.6262 + }, + ['ValveBiped.Bip01_L_Forearm'] = { + RU = -54.1778, + RR = 49.3891, + RF = -17.4275 + }, + ['ValveBiped.Bip01_Spine1'] = { + }, + ['ValveBiped.Bip01_L_Thigh'] = { + RU = 17.8439, + RR = -27.2881, + RF = -66.1325 + }, + ['ValveBiped.Bip01_Spine4'] = { + RF = -19.375 + }, + ['ValveBiped.Bip01_Pelvis'] = { + MU = -6.2234 + }, + ['ValveBiped.Bip01_L_Calf'] = { + RU = 0.1249, + RR = 23.1365 + }, + ['ValveBiped.Bip01_L_Foot'] = { + RU = 4.2748 + } + }, + FrameRate = 1 + }, + { + BoneInfo = { + ['ValveBiped.Bip01_R_Calf'] = { + RU = 52.7383 + }, + ['ValveBiped.Bip01_R_Thigh'] = { + RU = -45.5908, + RR = 32.311, + RF = 19.3292 + }, + ['ValveBiped.Bip01_L_Foot'] = { + RU = 4.2748 + }, + ['ValveBiped.Bip01_L_Calf'] = { + RU = 0.1249, + RR = 23.1365 + }, + ['ValveBiped.Bip01_Pelvis'] = { + MU = -6.2234 + }, + ['ValveBiped.Bip01_L_Forearm'] = { + RU = 14.726354797221, + RR = 14.372249178086, + RF = 67.254853315307 + }, + ['ValveBiped.Bip01_L_UpperArm'] = { + RU = -118.55072559209, + RR = -18.472382158172, + RF = -25.571552996169 + }, + ['ValveBiped.Bip01_R_Forearm'] = { + RU = 20.84833112133, + RR = -44.285748284171, + RF = 53.271771890186 + }, + ['ValveBiped.Bip01_Spine1'] = { + RU = 7.0719397868016 + }, + ['ValveBiped.Bip01_L_Thigh'] = { + RU = 17.8439, + RR = -27.2881, + RF = -66.1325 + }, + ['ValveBiped.Bip01_Spine4'] = { + RU = 6.7183427974615, + RF = 19.490397940959 + }, + ['ValveBiped.Bip01_Spine'] = { + RU = 11.400272978762 + }, + ['ValveBiped.Bip01_Spine2'] = { + RU = 6.3647458081214, + RF = 11.644257572985 + }, + ['ValveBiped.Bip01_R_UpperArm'] = { + RU = -107.25174221889, + RR = 2.5677191930821, + RF = 62.475625466013 + } + }, + FrameRate = 10 + }, + { + BoneInfo = { + ['ValveBiped.Bip01_R_Calf'] = { + RU = 52.7383 + }, + ['ValveBiped.Bip01_R_Thigh'] = { + RU = -45.5908, + RR = 32.311, + RF = 19.3292 + }, + ['ValveBiped.Bip01_L_Foot'] = { + RU = 4.2748 + }, + ['ValveBiped.Bip01_L_Calf'] = { + RU = 0.1249, + RR = 23.1365 + }, + ['ValveBiped.Bip01_Pelvis'] = { + MU = -6.2234 + }, + ['ValveBiped.Bip01_L_Forearm'] = { + RU = -54.1778, + RR = 49.3891, + RF = -17.4275 + }, + ['ValveBiped.Bip01_L_UpperArm'] = { + RU = -118.8375, + RR = 1.33, + RF = -18.6262 + }, + ['ValveBiped.Bip01_R_Forearm'] = { + RU = 6.7985, + RR = -138.8409, + RF = -3.6922 + }, + ['ValveBiped.Bip01_Spine1'] = { + }, + ['ValveBiped.Bip01_L_Thigh'] = { + RU = 17.8439, + RR = -27.2881, + RF = -66.1325 + }, + ['ValveBiped.Bip01_Spine4'] = { + RF = -19.375 + }, + ['ValveBiped.Bip01_Spine'] = { + }, + ['ValveBiped.Bip01_Spine2'] = { + RF = -12.8903 + }, + ['ValveBiped.Bip01_R_UpperArm'] = { + RU = 4.6922, + RR = 28.2239, + RF = 95.649 + } + }, + FrameRate = 1 + } + }, + RestartFrame = 2, + Type = TYPE_SEQUENCE +}) + +RegisterLuaAnimation('stranded_mine_rocks', { + FrameData = { + { + BoneInfo = { + ['ValveBiped.Bip01_Spine2'] = { + }, + ['ValveBiped.Bip01_L_Thigh'] = { + }, + ['ValveBiped.Bip01_Head1'] = { + RU = 16.3653 + }, + ['ValveBiped.Bip01_R_Clavicle'] = { + }, + ['ValveBiped.Bip01_L_UpperArm'] = { + RU = -169.4528, + RR = -17.0857 + }, + ['ValveBiped.Bip01_Spine4'] = { + }, + ['ValveBiped.Bip01_Pelvis'] = { + }, + ['ValveBiped.Bip01_R_Hand'] = { + }, + ['ValveBiped.Bip01_L_Calf'] = { + }, + ['ValveBiped.Bip01_R_Forearm'] = { + RU = 0.3663, + RR = -23.8679 + }, + ['ValveBiped.Bip01_L_Clavicle'] = { + }, + ['ValveBiped.Bip01_Spine1'] = { + }, + ['ValveBiped.Bip01_Spine'] = { + }, + ['ValveBiped.Bip01_R_Thigh'] = { + }, + ['ValveBiped.Bip01_R_UpperArm'] = { + RU = -160, + RR = 16.6091, + RF = -5.0659 + }, + ['ValveBiped.Bip01_L_Forearm'] = { + RU = 13.9547, + RR = 23.0274 + }, + ['ValveBiped.Bip01_R_Foot'] = { + } + }, + FrameRate = 1 + }, + { + BoneInfo = { + ['ValveBiped.Bip01_Spine2'] = { + RU = 19.5945 + }, + ['ValveBiped.Bip01_L_Thigh'] = { + RU = -25.9972, + RR = -4.3907 + }, + ['ValveBiped.Bip01_Head1'] = { + }, + ['ValveBiped.Bip01_R_Clavicle'] = { + RF = 57.3827 + }, + ['ValveBiped.Bip01_R_UpperArm'] = { + RU = 2.5616, + RR = -11.5777 + }, + ['ValveBiped.Bip01_Spine4'] = { + RU = 9.6885 + }, + ['ValveBiped.Bip01_Pelvis'] = { + MU = -3.3808, + RR = -11.3417 + }, + ['ValveBiped.Bip01_R_Hand'] = { + RU = 26.3055, + RR = -25.3824, + RF = -7.8628 + }, + ['ValveBiped.Bip01_L_Calf'] = { + RU = 25.0442 + }, + ['ValveBiped.Bip01_L_Forearm'] = { + RR = 38.3937 + }, + ['ValveBiped.Bip01_L_Clavicle'] = { + RU = 2.3203, + RF = -38.6058 + }, + ['ValveBiped.Bip01_Spine1'] = { + RU = 0.6215 + }, + ['ValveBiped.Bip01_Spine'] = { + RU = 17.2787 + }, + ['ValveBiped.Bip01_R_Thigh'] = { + RU = 19.0125 + }, + ['ValveBiped.Bip01_L_UpperArm'] = { + RU = -29.9497, + RR = -6.5064 + }, + ['ValveBiped.Bip01_R_Forearm'] = { + RR = -33.6703 + }, + ['ValveBiped.Bip01_R_Foot'] = { + RU = -17.9333 + } + }, + FrameRate = 4 + }, + { + BoneInfo = { + ['ValveBiped.Bip01_Spine2'] = { + }, + ['ValveBiped.Bip01_L_Thigh'] = { + }, + ['ValveBiped.Bip01_Head1'] = { + RU = 16.3653 + }, + ['ValveBiped.Bip01_L_Clavicle'] = { + }, + ['ValveBiped.Bip01_R_UpperArm'] = { + RU = -160, + RR = 16.6091, + RF = -5.0659 + }, + ['ValveBiped.Bip01_Spine4'] = { + }, + ['ValveBiped.Bip01_Pelvis'] = { + }, + ['ValveBiped.Bip01_R_Hand'] = { + }, + ['ValveBiped.Bip01_L_Calf'] = { + }, + ['ValveBiped.Bip01_R_Forearm'] = { + RU = 0.3663, + RR = -23.8679 + }, + ['ValveBiped.Bip01_R_Clavicle'] = { + }, + ['ValveBiped.Bip01_Spine1'] = { + }, + ['ValveBiped.Bip01_Spine'] = { + }, + ['ValveBiped.Bip01_R_Thigh'] = { + }, + ['ValveBiped.Bip01_L_UpperArm'] = { + RU = -169.4528, + RR = -17.0857 + }, + ['ValveBiped.Bip01_L_Forearm'] = { + RU = 13.9547, + RR = 23.0274 + }, + ['ValveBiped.Bip01_R_Foot'] = { + } + }, + FrameRate = 1 + } + }, + RestartFrame = 2, + Type = TYPE_STANCE +}) +end) diff --git a/lua/autorun/items.lua b/lua/autorun/items.lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lua/autorun/items.lua diff --git a/lua/autorun/server/init.lua b/lua/autorun/server/init.lua new file mode 100644 index 0000000..71956ae --- /dev/null +++ b/lua/autorun/server/init.lua @@ -0,0 +1,11 @@ +print("hello from artery_stranded init.lua") +do return end +--for k,v in pairs(ents.FindByClass("trigger_teleport")) do v:Remove() end + +local config = nrequire("sv_newplayer.lua") +config.newmeta = function() + return { + lastserver = "67.163.245.187:27015", + lastlocation = "5699 -5191 131" + } +end |
