Jump to content
Nutscript

rusty

Members
  • Content count

    5
  • Joined

  • Last visited

  • Days Won

    2

rusty last won the day on December 19 2017

rusty had the most liked content!

Community Reputation

2 Neutral

About rusty

  • Rank
    Newbie
  1. In-game Bodygroup/Skin Changer

    it has an example bro -- This will apply body groups. ITEM.bodyGroups = { ["blade"] = 1, ["bladeblur"] = 1 } */
  2. Set a faction's health

    or even better -- [UniqueID] = health SCHEMA.FactionHealth = { [FACTION_CP] = 120, [FACTION_OW] = 500 } function SCHEMA:PlayerSpawn(client) local nFactionHealth = self.FactionHealth[client:Team()]; if( !nFactionHealth ) then return end; client:SetMaxHealth( nFactionHealth ); client:SetHealth( nFactionHealth ); end
  3. In-game Bodygroup/Skin Changer

    https://github.com/rebel1324/NutScript/blob/1.1/gamemode/items/base/sh_outfit.lua its already in the gamemode bro
  4. There is alot of good content out there (Mainly Fallout) but the best of it has been made in such a way where functionality is expanded via bonemerge. While alot of the time it's tricky to perfect a system, it's not impossible. There are a variety of issues that can appear with a variety of different implementation methods. When I was developing Half Logic, a main problem was determining things like dormant states, when the player wasn't drawn, or when server/client would hiccup due to lag or tabbing out or switching resolutions, etc. Now that I've begun my new project that relies heavily on the system I really sat down and thought out a way where there are few to no flaws, atleast ones that I've experienced so far in the development cycle. Half Logic had a problem where observers, people entering and leaving a player's PVS, or a variety of other special circumstances would have their bonemerged models re-spawned or had desync from it's owner. Atlas-5, a new-fangled server created by Extra/Pigly uses the same system, but he has a variety of flaws in his as well. Sometimes parts would not sync correctly and his solution was to force an update on all clients after every x minutes causing quite a bit of lock up on lower end systems. I believe that a majority of problems with these kinds of systems is actually from using the Think hook on the client to detect when things should and shouldn't be happening, or network errors. In my new project, each clientside model has its own think function that would only manage that single entity which made it alot less prone to error. Along with that, if you network data only when required, and the only things you're networking to a client are things like what models are supposed to be drawn you will not only save bandwidth, but also makee the system more robust. Here is a proof of concept: local s_Meta = FindMetaTable( "Player" ); function s_Meta:CreateNewBonemerge( szModel ) b = ClientsideModel( szModel, RENDERGROUP_OPAQUE ); b:SetModel( szModel ); b:InvalidateBoneCache(); b:SetParent( self ); b:AddEffects( EF_BONEMERGE ); b:SetupBones(); function b:Think() local ply = self:GetParent(); if( IsValid( ply ) ) then if( ply:GetNoDraw() and !self.bLastDrawState ) then self:SetNoDraw( true ); elseif( !ply:GetNoDraw() and self.bLastDrawState ) then self:SetNoDraw( false ); end if( !self.LastParent ) then if( !ply:Alive() and ply.bLastAliveState ) then self.LastParent = ply; self:SetParent( ply:GetRagdollEntity() ); self:AddEffects( EF_BONEMERGE ); end if( ply:CharID() != ply.nLastCharID ) then self:Remove(); end else if( self.LastParent:Alive() and !self.LastParent.bLastAliveState ) then self:SetParent( self.LastParent ); self:AddEffects( EF_BONEMERGE ); self.LastParent = nil; end end else self:Remove() end self.bLastDrawState = self:GetNoDraw(); if( !self.LastParent ) then if( IsValid( ply ) ) then ply.bLastAliveState = ply:Alive(); ply.nLastCharID = ply:CharID(); end else self.LastParent.bLastAliveState = self.LastParent:Alive(); self.LastParent.nLastCharID = self.LastParent:CharID(); end end hook.Add( "Think", b, b.Think ); return b; end local function BonemergeThink() for k,v in next, player.GetAll() do if( IsValid( v ) ) then if( v.CharID ) then if( v:CharID() > -1 ) then if( v:Head() != "" ) then if( !IsValid( v.BonemergeHead ) ) then v.BonemergeHead = v:CreateNewBonemerge( v:Head() ); end end end end end end end hook.Add( "Think", "BonemergeThink", BonemergeThink ); Now keep in mind, there are parts in here that are proprietary to my own gamemode, but any aspiring scripter will quickly realize what is happening just by reading the code.
×