[QUOTE=ms333;49739389]My server doesn't seem to create any crash dumps. Do I need to add a start-up parameter? I'm on ubuntu[/QUOTE]
IIRC, -debug makes crash dumps as it told me before January's update whenever my server crashed
does anyone know why buoyancy resets after the buoyant entity gets touched by the physics gun? (physobj:SetBuoyancyRatio()) and is there a fix?
How do I compare a string to a table in string.find?
[QUOTE=keeperman;49741019]How do I compare a string to a table in string.find?[/QUOTE]
strings are not tables
what you're trying to do is check the similarity between an apple and a crate of fruits; it's not gonna work
tell us what you're trying to accomplish and we'll tell you how you should/can be doing it
I can't seem to locate where the whole "Player xxx changed name to xxx" is, if it's even Lua based. Anyone got any suggestions?
[QUOTE=Teddi Orange;49741610]I can't seem to locate where the whole "Player xxx changed name to xxx" is, if it's even Lua based. Anyone got any suggestions?[/QUOTE]
Someone already talked about this.
iirc robotboy said you cant remove it idk
Would anyone know how to remove the DNA off of a corpse in TTT using Lua?
How do I get strings like #npc_crow to appear as Crow
edit:
language.GetPhrase( string phrase )
[QUOTE=Kevlon;49741920]Someone already talked about this.
iirc robotboy said you cant remove it idk[/QUOTE]
Well that's annoying. Muted players end up just being obnoxious by changing their names now.
-snip-
Is there a thing where I can make it so that I force a value between 0 and 100 but if the value goes over it will go all the way around? ie 101 would equal 1 and 201 would equal 1, 250 would equal 50.
[QUOTE=ROFLBURGER;49742802]Is there a thing where I can make it so that I force a value between 0 and 100 but if the value goes over it will go all the way around? ie 101 would equal 1 and 201 would equal 1, 250 would equal 50.[/QUOTE]
No default functions, but wouldn't be hard to make one...
[editline]asdsad[/editline]
Try this:
[lua]
function roundclamp( i, max )
if i%max == 0 and i ~= 0 then
return max
else
return i % max
end
end
[/lua]
[QUOTE=ROFLBURGER;49742802]Is there a thing where I can make it so that I force a value between 0 and 100 but if the value goes over it will go all the way around? ie 101 would equal 1 and 201 would equal 1, 250 would equal 50.[/QUOTE]
If you can live with 0-99 instead of 0-100, you can just use modulo.
[code]val % max[/code]
Gives 0-99.
Modulo returns the remainder - 5 % 2 would be 1 since 2 goes into 5 twice, with 1 left over. If we abuse that to have a divisor larger than the numerator, it will cause the value to always be between 0 and the denominator.
I had a stroke while writing it and gave bad info, so I corrected this.
[QUOTE=Kogitsune;49742902]If you can live with 1-100 instead of 0-100, you can just use modulo.
[code]val % ( max + 1 )
--or
1 + ( val % max )[/code]
Gives 1-100.
Modulo returns the remainder - 5 % 2 would be 1 since 2 goes into 5 twice, with 1 left over. If we abuse that to have a divisor larger than the numerator, it will cause the value to always be between 0 and the denominator.[/QUOTE]
That doesn't works as expected, since ( 201 % 100 ) + 1 returns 2 instead of the expected 1.
And 201 % (100 + 1) returns 100.
[QUOTE=GbrosMC;49740951]does anyone know why buoyancy resets after the buoyant entity gets touched by the physics gun? (physobj:SetBuoyancyRatio()) and is there a fix?[/QUOTE]
noone?
[QUOTE=LUModder;49740418]IIRC, -debug makes crash dumps as it told me before January's update whenever my server crashed[/QUOTE]
That seems to only add a few lines about the crash to a debug.log file.
[QUOTE=Teddi Orange;49741610]I can't seem to locate where the whole "Player xxx changed name to xxx" is, if it's even Lua based. Anyone got any suggestions?[/QUOTE]
I'm not sure if you can return anything for a gameevent, but try listening for the event "player_changename" and hook into it and return.
[QUOTE=GGG KILLER;49742814]No default functions, but wouldn't be hard to make one...
[editline]asdsad[/editline]
Try this:
CODE
[/QUOTE]
Your function never hits 100, it'll stay between 0 and 99. If you're just going to do that you might as well do
[CODE]
function roundclamp(i, max)
return i % max
end
[/CODE]
roundclamp(0, 100) --> 0
roundclamp(100, 100) --> 0
roundclamp(150, 100) --> 50
roundclamp(201, 100) --> 1
-ninja'd-
[QUOTE=GbrosMC;49742965]noone?[/QUOTE]
I have no idea, though if it is an issue you could add all the entities to a lookup table and then if they're dropped you reset their buoyancy on PhysgunDrop
[QUOTE=bigdogmat;49743220]Your function never hits 100, it'll stay between 0 and 99. If you're just going to do that you might as well do
[CODE]
function roundclamp(i, max)
return i % max
end
[/CODE]
roundclamp(0, 100) --> 0
roundclamp(100, 100) --> 0
roundclamp(150, 100) --> 50
roundclamp(201, 100) --> 1
-ninja'd-[/QUOTE]
"Fixed" my solution.
How can I make triggers out of props? I tried to get friends to help me but it didn't work.
[QUOTE=ms333;49743150]That seems to only add a few lines about the crash to a debug.log file.[/QUOTE]
-condebug will write every line of the console to a file, if the game is crashing before you can read any errors.
[QUOTE=LUModder;49743677]How can I make triggers out of props? I tried to get friends to help me but it didn't work.[/QUOTE]
Use collision hooks
Unless that's not what you mean idk
[QUOTE=ms333;49743150]That seems to only add a few lines about the crash to a debug.log file.[/QUOTE]
What lines?
[QUOTE=ms333;49745629][code]
----------------------------------------------
CRASH: Mon Feb 15 02:49:34 CET 2016
Start Line: ./srcds_linux -game garrysmod -debug -console +maxplayers 40 -port 27016 +serverid 1 +lua_log_sv 1 +port 27016 +r_hunkalloclightmaps 0 -disableluarefresh +exec server.cfg +gamemode darkrp -tickrate 24 +map rp_evocity_v33x
End of Source crash report
----------------------------------------------
[/code][/QUOTE]
Are there any core files created? The files will be called "core", "core.x" (where x is a number) or "srcds_linux.core".
[QUOTE=Willox;49745638]Are there any core files created? The files will be called "core", "core.x" (where x is a number) or "srcds_linux.core".[/QUOTE]
Not as far as I'm aware. Unless I'm looking in the wrong place?
[t]http://i.imgur.com/CNri95V.png[/t]
[QUOTE=ms333;49745665]Not as far as I'm aware. Unless I'm looking in the wrong place?
[t]http://i.imgur.com/CNri95V.png[/t][/QUOTE]
What are the contents of /proc/sys/kernel/core_pattern on the server?
How would I go by networking weapons which have been created "run-time"? The client doesn't know which weapons to create until the server tells it to weapons.Register them, but this only provides a partial solution. The weapons to register simply aren't networked fast enough to the client (InitPostEntity), so any players holding these weapons when the client connects will have issues on the newly connected client until these players swap away and back to the weapon.
[QUOTE=Willox;49745726]What are the contents of /proc/sys/kernel/core_pattern on the server?[/QUOTE]
[t]http://i.imgur.com/J2eYnkp.png[/t]
[QUOTE=Unib5;49745759]How would I go by networking weapons which have been created "run-time"? The client doesn't know which weapons to create until the server tells it to weapons.Register them, but this only provides a partial solution. The weapons to register simply aren't networked fast enough to the client (InitPostEntity), so any players holding these weapons when the client connects will have issues on the newly connected client until these players swap away and back to the weapon.[/QUOTE]
I made a script for this on PENISCorp a long time ago and it still works, I use it for both entities and weapons, but mostly weapons like in your case.
[lua]
--[[
lua_run_cl print(Entity(229):SetTable(weapons.Get("weapon_grapplehook")))
Entity(229):InstallDataTable()
Entity(229):SetupDataTables()
Entity(229):Initialize()
]]
function FixEntity(ent)
local enttab=ent:GetTable()
if enttab.__FixedAlready then return end
if not enttab.Weapon and not enttab.Entity then
--wait a minute, this isn't a scripted entity, or it doesn't needs our treatment
return
end
if enttab.BaseClass then
return
end
if ent:IsWeapon() then
enttab=weapons.Get(ent:GetClass())
else
enttab=scripted_ents.Get(ent:GetClass())
end
if not enttab then
--make it return an error or something idk
return
end
if not ent.InstallDataTable then return end
ent:SetTable(enttab)
ent:InstallDataTable()
if ent.SetupDataTables then
ent:SetupDataTables()
end
print("Fixing ",ent)
if ent.Initialize then
ent:Initialize()
end
ent.__FixedAlready=true
end
hook.Add("NetworkEntityCreated","fixents",function( ent )
if IsValid(ent) and not ent.__FixedAlready then
FixEntity(ent)
end
end)
hook.Add( "NotifyShouldTransmit" , "fixents" , function( ent , shouldtransmit )
if IsValid(ent) and shouldtransmit and not ent.__FixedAlready then
FixEntity(ent)
end
end)
[/lua]
Not the prettiest code in the world nor it needs to be this verbose, but it works fine, even though I'm most likely using SetTable wrong here.
You can run FixEntity( ent ) to fix the weapon as soon as you receive the code for it.
[QUOTE=ms333;49745761][t]http://i.imgur.com/J2eYnkp.png[/t][/QUOTE]
the "-debug" parameter expects the generated core dumps to be saved with srcds_linux as the filenames I specified. I don't know anything about apport, but if you can find where it stores the core dumps you'll be able to run GDB yourself to analyse them.
Usually the following would be executed in GDB automatically:
[code]bt
info locals
info registers
info sharedlibrary
disassemble
info frame[/code]
[editline]15th February 2016[/editline]
Could you echo $RLIMIT_CORE and $RLIMIT_FSIZE? Apparently apport is supposed to stick to the normal core dump behaviour, so I think you might have these values set to 0.
Sorry, you need to Log In to post a reply to this thread.