• Niggles V3 - Fix Linux already...
    57 replies, posted
  • Avatar of PortalGod
  • Could we get a GetSelectedText() function added to DTextEntry? there's only CopySelected and CutSelected, I think the only way to do it now would be :SaveUndoState(), :CutSelected(), :Paste(), then get the change in :OnTextChanged(), then call :Undo(), and that's just stupid
  • Avatar of lorde banana
  • [QUOTE=Banana Lord.;34504569]Oh my next niggle (probably easier), actually verify information from the client with stools (ie. materials) to help stop them from exploiting them. It's fairly simple to fix but should really be included by default.[/QUOTE] bump also, please this garry
  • Avatar of Nerdeboy
  • [QUOTE=CapsAdmin;34535575]I just compared two bsps where one of them was compiled with just an added targetname to the light_environment and you're right, it bumps the size up a little over 100kb[/QUOTE] That won't change anything though. Dynamic lights (those with a targetname) are inherently larger in file size, but naming a light_environment won't change much other than allowing you to turn the global lighting on and off (which might not even be a thing.) What's been suggested would require a complete rebuild of the lighting engine, dynamically baking light (which would take about 1-60 minutes depending on the map each time the lights change), or computing every possible situation for the light_environment.
  • Avatar of Tobba.
  • I remember the black magic fix for Linux vehicles was to just copy TF2's vphysics.so over and everything would magically work properly
  • Avatar of lorde banana
  • [QUOTE=Tobba.;34681468]I remember the black magic fix for Linux vehicles was to just copy TF2's vphysics.so over and everything would magically work properly[/QUOTE] it's the same engine...
  • Avatar of Gran PC
  • No, use AzuiSleet's vphysics_october.zip library. It has the weld fix and the vehicle fix.
  • Avatar of lorde banana
  • yeah but seagulls crash :/ [editline]14th February 2012[/editline] and we can't depend on the fix forever, it will break again, as the past 2 have
  • Avatar of TGiFallen
  • [QUOTE=GranPC;34694534]No, use AzuiSleet's vphysics_october.zip library. It has the weld fix and the vehicle fix.[/QUOTE] Can someone link to this please?
  • Avatar of Drakehawke
  • Can we get a way of accessing the contents of entity.dt properly? Currently you can't loop through it (Kogitsune said it was because it's a metatable not a normal table or something). I'm trying to save information about different entities with different DTVars, and it would be a lot easier just to be able to get the contents of entity.dt rather than having to check the class of each entity and save the correct DTVars for each one in a massive if statement.
  • Avatar of lexic
  • [lua]function meta:InstallDataTable() self.dt = {} local datatable = {} local meta = {} meta.__index = function ( ent, key ) local dt = datatable[ key ] if ( dt == nil ) then return end return dt.GetFunc( self, dt.index, key ) end meta.__newindex = function( ent, key, value ) local dt = datatable[ key ] if ( dt == nil ) then return end dt.SetFunc( self, dt.index, value ) end self.DTVar = function( ent, typename, index, name ) local SetFunc = ent[ "SetDT"..typename ] local GetFunc = ent[ "GetDT"..typename ] if ( !SetFunc || !GetFunc ) then MsgN( "Couldn't addvar " , name, " - type ", typename," is invalid!" ) return end datatable[ name ] = { index = index, SetFunc = SetFunc, GetFunc = GetFunc, } end setmetatable( self.dt, meta ) end[/lua] Have fun reverse engineering it! [editline]21st February 2012[/editline] I can't remember if Garry removed the debug library or if we got him not to in the end, but if it's still there, you'll need [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4aab.html?title=Debug.getupvalue]debug.getupvalue() [img]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/favicon.ico[/img][/url][/b]. If not you'll probably need to replace InstallDataTable before any entities are created.
  • Avatar of Drakehawke
  • [lua] local ent = LocalPlayer():GetEyeTrace().Entity local _, table = debug.getupvalue( ent.DTVar, 1 ) PrintTable( table ) [/lua] [code] temperature: GetFunc = function: 027BC3D8 index = 2 SetFunc = function: 027BC360 nextprint: GetFunc = function: 027BC3D8 index = 1 SetFunc = function: 027BC360 owning_ent: GetFunc = function: 027BBCB8 index = 1 SetFunc = function: 027BBCA0 [/code] Worked, thanks a lot man.
  • Avatar of _nonSENSE
  • Not sure if this has been reported before but I doubt it. This might be an error on my part or something that is considered general knowledge but it has been bugging me for months. Some TF2 particle effects do not appear when they are attached to a ClientsideModel and parented to a player. At first I thought it was related to my CalcView hook but I found out that they would draw just fine if they weren't parented. Here is a small script I used to test: [lua] tbl = {} concommand.Add("_spawnSomething", function(ply, cmd, args) tbl[1] = ClientsideModel("models/Combine_Helicopter/helicopter_bomb01.mdl", RENDERGROUP_OPAQUE) tbl[1]:SetColor(0,0,0,60) tbl[1]:SetPos(ply:GetPos() + ply:GetAngles():Up() * 64 + ply:GetAngles():Forward() * 64) tbl[1]:SetParent(ply) ParticleEffectAttach("superrare_burning1", PATTACH_ABSORIGIN_FOLLOW, tbl[1], 0) tbl[2] = ClientsideModel("models/Combine_Helicopter/helicopter_bomb01.mdl", RENDERGROUP_OPAQUE) tbl[2]:SetColor(0,0,0,60) tbl[2]:SetPos(ply:GetPos() + ply:GetAngles():Up() * -64 + ply:GetAngles():Forward() * 64) tbl[2]:SetParent(ply) ParticleEffectAttach("superrare_burning2", PATTACH_ABSORIGIN_FOLLOW, tbl[2], 0) tbl[3] = ClientsideModel("models/Combine_Helicopter/helicopter_bomb01.mdl", RENDERGROUP_OPAQUE) tbl[3]:SetColor(0,0,0,60) tbl[3]:SetPos(ply:GetPos() + ply:GetAngles():Right() * 64 + ply:GetAngles():Forward() * 64) tbl[3]:SetParent(ply) ParticleEffectAttach("superrare_circling_tf", PATTACH_ABSORIGIN_FOLLOW, tbl[3], 0) end) [/lua] And on the server: [lua] PrecacheParticleSystem("superrare_burning1") PrecacheParticleSystem("superrare_burning2") PrecacheParticleSystem("superrare_circling_tf") [/lua] ClientsideModels tbl[1] and tbl[2] do not appear at all when parented to the player. tbl[3] works just fine. When commenting out the tbl[1]:SetParent(ply) part, they all work. Any ideas?
  • Avatar of ralle105
  • It would be nice to have this utility function [lua] function epairs(class) return pairs(ents.FindByClass(class)) end [/lua]
  • Avatar of JustSoFaded
  • In the ILuaInterface class could we get a IsMenu? So we can check if the lua state is the menu state? Currently we only have ->IsClient() ->IsDedicatedServer() and ->IsServer() (which I assume returns true for dedicated servers and listen servers?)
  • Avatar of Chessnut
  • [QUOTE=ralle105;34863045]It would be nice to have this utility function [lua] function epairs(class) return pairs(ents.FindByClass(class)) end [/lua][/QUOTE] Could also do the same with player.GetAll() as well. Edit: My bad if anyone misunderstood, a utility function like that but for player.GetAll().
  • Avatar of Wizard of Ass
  • [QUOTE=JustSoFaded;34953823]In the ILuaInterface class could we get a IsMenu? So we can check if the lua state is the menu state? Currently we only have ->IsClient() ->IsDedicatedServer() and ->IsServer() (which I assume returns true for dedicated servers and listen servers?)[/QUOTE] You are not going to get access to the menu anyway, since garry doesn't want it. And you can just check if render is nil.
  • [QUOTE=Chessnut;34954656]Could also do the same with player.GetAll() as well. Edit: My bad if anyone misunderstood, a utility function like that but for player.GetAll().[/QUOTE] You could do epairs("player").
  • Avatar of JustSoFaded
  • [QUOTE=Wizard of Ass;34957953]You are not going to get access to the menu anyway, since garry doesn't want it. And you can just check if render is nil.[/QUOTE] I end up doing: [cpp] if( Menu_Interface->IsClient() ) { //initiate client lua interface functions } else if(!Menu_Interface->IsClient() && !Menu_Interface->IsDedicatedServer() && !Menu_Interface->IsServer()) { Menu_Interface->Msg("show no love to homo thugs <3"); } [/cpp] Although I haven't tested it yet, so I'm not sure if it will work.
  • Avatar of _nonSENSE
  • [QUOTE=_nonSENSE;34832884]Not sure if this has been reported before but I doubt it. This might be an error on my part or something that is considered general knowledge but it has been bugging me for months. Some TF2 particle effects do not appear when they are attached to a ClientsideModel and parented to a player. At first I thought it was related to my CalcView hook but I found out that they would draw just fine if they weren't parented. -- code ClientsideModels tbl[1] and tbl[2] do not appear at all when parented to the player. tbl[3] works just fine. When commenting out the tbl[1]:SetParent(ply) part, they all work. Any ideas?[/QUOTE] I fixed this today; I was going through the different particle systems and found that some effects have the attribute "control point to disable rendering if it is the camera" set to 0 and some had it set to -1. When parented to the player, the effects with the attribute set to 0 would stop rendering altogether. Setting the attribute to -1 on all effects fixed it. I used a separate entity as a "camera" before to simulate thirdperson, so I kind of side-stepped the issue. Recently, I was forced to use a CalcView hook for the thirdperson code so I thought I should try to fix this once and for all.
  • Avatar of CmdrMatthew
  • [QUOTE=ralle105;34863045]It would be nice to have this utility function [lua] function epairs(class) return pairs(ents.FindByClass(class)) end [/lua][/QUOTE]If we are asking for utility functions from Garry, they should atleast be something we can't simply write with less than 2 lines of non-hacky Lua.
  • Avatar of ralle105
  • [QUOTE=CmdrMatthew;35056390]If we are asking for utility functions from Garry, they should atleast be something we can't simply write with less than 2 lines of non-hacky Lua.[/QUOTE] Why is that?
  • Avatar of ralle105
  • [QUOTE=CmdrMatthew;35057518]We need to challenge him.[/QUOTE] [QUOTE=garry;24104945]By niggles I mean tiny things that I can fix easily[/QUOTE]