Hey guys, being addicted to realism in games has led me on a long quest to find a few functions that I used to use quite often but seem to have forgotten recently.
Keep in mind, that I've looked for these functions in the wiki, the forums' posts, and google to see if someone else had used these before but with no success, I turn to a new thread. I apologize in advance if they are indeed hidden in the wiki and I missed them.
One of them was a single-line function or call that could be made from [i]within CalcView( )[/i] that would mimic a realistic camera movement automatically. Right now, I'm using some pain-in-the-ass math functions and variables to replicate this. Although I'm happy with my results, I remember someone posting the earlier mentioned function and it seemed to do exactly what I want without all the Sine and FrameTime( ) bullshit I'm having to go through now.
The other function was called from within ScalePlayerDamage( ) and/or EntityTakeDamage( ) I believe. And when used in conjunction with the dmginfo:IsFallDamage( ) function it could override the default 10-damage-from-ridiculous-falls feature found in Garry's Mod. Again, this was a single line function that was called on the player (I believe.).
[b]EDIT:[/b]
I found some more info on the fall damage bit:
[code]
#
/*---------------------------------------------------------
#
Name: gamemode:OnPlayerHitGround()
#
Return true to disable default action
#
---------------------------------------------------------*/
#
function GM:OnPlayerHitGround( ply, bInWater, bOnFloater, flFallSpeed )
#
#
// Apply damage and play collision sound here
#
// then return true to disable the default action
#
//MsgN( ply, bInWater, bOnFloater, flFallSpeed )
#
//return true
#
#
end
#
#
/*---------------------------------------------------------
#
Name: gamemode:GetFallDamage()
#
return amount of damage to do due to fall
#
---------------------------------------------------------*/
#
function GM:GetFallDamage( ply, flFallSpeed )
#
#
return 10
#
#
end
[/code]
Source: [url=http://luabin.foszor.com/code/gamemodes/base/gamemode/player.lua#780]code.garrysmod.com[/url]
And lastly, skimping through some articles in the Wiki led me to this find: [url=http://wiki.garrysmod.com/?title=ENT.KeyValue]ENT:KeyValue( )[/url] In and of itself the article isn't interesting, but what caught my eye was the "self:SetPickupType( value )" on line 3. I searched and searched but again, couldn't find any info on this rare function. From a first glance though, it probably works much like "ent:SetUseType( type )"
Any info at all is greatly appreciated. Also, I wish we had a GM:PlayerCanPickupItem( item ) function :P
Sorry, you need to Log In to post a reply to this thread.