PDA

View Full Version : More callbacks than listed?


hlstriker
04-10-2009, 06:57 AM
Are there other callbacks than the ones Mulchman listed in the sticky post?

Edit:
Is there a COMPLETE list of functions too?

This post has some but not all:
http://forums.fortress-forever.com/showpost.php?p=413889&postcount=4

squeek.
04-10-2009, 07:50 AM
Thanks for bringing this up. Searching through the code I've come up with these:


player_onprimegren1( player_entity )
player_onprimegren2( player_entity )
buildable_ondamage( buildable_entity, damage_info )


As an aside, some very strange variables were added to func_button:ondamage() without any documentation.


info_damage (int)
info_attacker (base entity/player)
info_classname (string weapon name)


Here's an example code from a dev map I found:

bob = func_button:new({})
function bob:ondamage()
if IsPlayer( info_attacker ) then
local player = CastToPlayer( info_attacker )
ConsoleToAll(player:GetName().." shot button with a "..info_classname.." for "..info_damage.." damage")
if info_classname == "ff_weapon_spanner" then
PressButton(entname)
end
end
end

As for functions... no, there isn't... yet.

hlstriker
04-10-2009, 05:48 PM
Alright, I was just wondering about the functions too because I remember you posting the SetVelocity() in the feature request forum and didn't see it in the function list.

Also, now I don't have to ask how to concatenate strings (who would have guessed 2 dots)!

squeek.
04-10-2009, 07:57 PM
Alright, I was just wondering about the functions too because I remember you posting the SetVelocity() in the feature request forum and didn't see it in the function list.

Also, now I don't have to ask how to concatenate strings (who would have guessed 2 dots)!

Yeah... I think there are quite a few undocumented functions. I'll try to get a list of them sometime.