Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- bone meta concept is not written down yet
- there is a new editor being made by Declan. he can take his time and finish it up whenever. If he doesn't I'll (CapsAdmin) carefully make one myself
- ]]
- do -- part creation concept
- do -- pac.pac.Color
- --insert generic color object here
- end
- PAC_RENDER_SCREEN = "RenderScreenspaceEffects" -- for screen effects
- PAC_RENDER_PLAYER = "PostPlayerDraw" -- for models
- PAC_RENDER_3D2D = "PostDrawOpaqueRenderables" -- for things like sprites
- do -- part
- local PART = {}
- PART.Base = "base"
- PART.DrawMode = PAC_RENDER_SCREEN
- function PART:Initialize()
- -- ??
- end
- function PART:Draw(outfit_owner, world_pos, world_angles)
- local vec2 = world_pos:ToScreen()
- DrawSunbeams(
- self:GetDarken(),
- self:GetScale()
- self:GetSize(),
- vec2.x / ScrW(),
- vec2.y / ScrH()
- )
- end
- function PART:Think(outfit_owner)
- -- non draw stuff here
- end
- pac.AccessorFunction(PART, "darken", "Darken", function(var)
- return math.Clamp(var, 0, 1)
- end)
- pac.AccessorFunction(PART, "scale", "Scale", function(var)
- return math.Clamp(var, -1, 1)
- end)
- pac.AccessorFunction(PART, "size", "Size", function(var)
- return math.Clamp(var, 0, 1)
- end)
- function PART:IsVisible()
- return self.darken < 1 and self.size > 0 and self.scale ~? 0
- end
- pac.Register(PART, "sunbeams")
- end
- do -- hooks
- if SERVER then
- hook.Add("PrePACOutfitApply", "", function(ply, outfit)
- if #outfit:GetParts() > 10 and not ply:IsAdmin() then
- return false, "you have too many parts in your outfit"
- end
- end)
- end
- if CLIENT then
- hook.Add("PrePACOutfitApply", "", function(ply, outfit)
- outfit:Save()
- end)
- end
- end
- end
- -- all Set functions should have a Get function
- do -- data (pretty much a neat table)
- local data = pac.NewData("animation")
- data:SetLoop(true)
- data:SetSequence(1 or "crouch")
- data:SetRate(1)
- data:SetOffset(10)
- data:SetStart(0)
- data:SetEnd(1)
- local data = pac.NewData("clipping")
- data:SetName("my clip plane")
- data:SetBone("head")
- data:SetDistance(10)
- data:SetAngle(Angle(0,0))
- local data = pac.NewData("modelbone")
- data:SetName("my bone")
- data:SetBone(1 or "head")
- data:SetRedirectParent(false)
- data:SetScale(1)
- data:SetVectorScale(Vector(1,1,1))
- data:SetLocalPos(Vector(0,0,0))
- data:SetLocalAngles(Angle(0,0,0))
- local data = pac.NewData("modelbones")
- data:Add(data)
- data:Remove("my bone")
- data:GetBone("my bone")
- data:SetBoneMerge(false)
- data:SetFixFingers(false)
- end
- do -- part
- local part = pac.NewPart("my hat", "base")
- part:SetBone(1 or "head")
- part:SetLocalPos(vector_origin)
- part:SetLocalAngles(angle_origin)
- part:SetAngleVelocity(Vector(10,1,1))
- part:SetWeaponClass("physgun")
- part:SetHideOnWeaponClass(false)
- part:SetParent(part)
- part:Follow(part) -- will make the following part use the same same positions as its parent instead of calculating offsets
- part:Remove()
- local part = pac.NewPart("my hat", "model")
- local entity = part:GetEntity()
- part:SetModel("blah/hmm/oh.mdl")
- part:SetCustomOrigin(Vector(0,0,0))
- part:SetVectorScale(Vector(1,1,1))
- part:SetScale(1)
- part:SetMirror(true)
- part:SetColor(pac.Color(255,255,255) or Vector(1,1,1))
- part:SetFullBright(true)
- part:SetMaterial("debug/debugwhite")
- part:SetSkin(0)
- part:SetBodygroup(1, 1)
- part:SetClippingPlane(data)
- part:GetClippingPlane("my clip plane")
- part:SetAnimation(data)
- part:IsVisible() -- checks if alpha is 0 or scale is 0
- local part = pac.NewPart("my hat", "sprite")
- part:SetScale(1)
- part:SetHeight(1)
- part:SetWidth(1)
- part:SetMaterial("sprites/ball")
- part:IsVisible()
- local part = pac.NewPart("my hat", "ob_effect")
- part:SetEffect("flamethrower")
- part:SetLooping(true)
- part:SetRate(1)
- local part = pac.NewPart("my hat", "light")
- part:SetColor(pac.Color(255,255,255))
- part:SetBrightness(1)
- part:SetRadius(100)
- local part = pac.NewPart("my hat", "text") -- dunno if I should bind markup instead (resource heavy)
- part:SetText("my text blah blah")
- part:SetSize(1)
- part:SetColor(pac.Color(255,255,255,255))
- part:IsVisible()
- local part = pac.NewPart("my hat", "trail")
- part:SetLength(1)
- part:SetStartSize(1)
- part:SetEndSize(0)
- part:SetMaterial("trails/laser")
- part:SetColor(pac.Color(255,255,255,255))
- part:IsVisible()
- local part = pac.NewPart("my hat", "sunbeams")
- part:SetDarken(0)
- part:SetScale(1)
- part:SetSize(1)
- part:IsVisible()
- end
- do -- outfit
- local outfit = pac.NewOutfit(outfit_a, outfit_b, outfit_c, ...)
- -- if outfit_* is a string, it will load the outfit from file.
- -- if it's an outfit object it will use that instead
- -- this will mix the outfits giving outfit_a the top priority.
- -- I guess the new editor can have something like "inherit from
- -- parent outfit".
- local outfit = ent:GetPACOutfit()
- outfit:SetTitle("my awesome outfit")
- outfit:SetDescription("the outfit i spent my asdasd")
- outfit:SetEntity(ent)
- outfit:Add(part)
- outfit:Remove("my hat")
- outfit:GetPart("my hat")
- outfit:GetParts()
- outfit:GetBones()
- local str = outfit:Save(title_override, description_override)
- outfit:LoadOutfit("my outfit")
- outfit:SetRender(true)
- outfit:SetHidePlayer(false) -- alpha 0
- outfit:SetHideWeapon(false)
- outfit:SetColor(pac.Color(255,255,255,255))
- outfit:SetMaterial("models/shiny")
- outfit:Scale(1)
- outfit:SetHue(0)
- outfit:SetSaturation(1)
- outfit:SetBrightness(1)
- outfit:SetVectorScale(Vector(1,1,1))
- outfit:SetPlayerModel("female7")
- end
- do -- meta magic
- -- __add should make the parts followed by the first part follow
- outfit:Add(part + part + part)
- end
- do -- pac
- pac.LoadOutfitFromString(str) -- alias of glon.decode?
- local outfit = pac.LoadOutfit(path)
- pac.CombineOutfits(master, slave, slave, slave)
- -- the outfits will inherit from the arg before it
- end
Advertisement
Add Comment
Please, Sign In to add comment