Commodus Posted September 30, 2002 Share Posted September 30, 2002 Over at Quake 3 World there is a code documentation project which is striving to document all the trap_ functions in Quake 3 which can more or less be applied to JK2. Check it out if you haven't already done so. Also, does anybody know what exactly does the void va(...) function do? (first argument is a string, all the arguments after are variables of any type) Thanks, Commodus Link to comment Share on other sites More sharing options...
Commodus Posted October 1, 2002 Author Share Posted October 1, 2002 Nobody knows? Link to comment Share on other sites More sharing options...
Jaii der Herr Posted October 1, 2002 Share Posted October 1, 2002 oh, sorry, didn't see that question do you know the printf functions from the basic libraries? It is an sprintf to an static function var. It returns a pointer to that var. It is used for all the G_Printf like functions too. It can only be used twice in capsulated functions. G_Printf("%s",va("%i: %s",i,va("%f: %s",1.0,"HUHU"))); would not have the effect which is wanted ( beside it is silly and useless ). But there could be cases on which the limit of 2 is broken ( only a second call until one call is finished ). Link to comment Share on other sites More sharing options...
razorace Posted October 2, 2002 Share Posted October 2, 2002 Thanks for the link. I know at least some of it doesn't apply to JK2, but the rest is still good. Link to comment Share on other sites More sharing options...
Commodus Posted October 4, 2002 Author Share Posted October 4, 2002 Originally posted by Jaii der Herr oh, sorry, didn't see that question do you know the printf functions from the basic libraries? It is an sprintf to an static function var. It returns a pointer to that var. It is used for all the G_Printf like functions too. It can only be used twice in capsulated functions. G_Printf("%s",va("%i: %s",i,va("%f: %s",1.0,"HUHU"))); would not have the effect which is wanted ( beside it is silly and useless ). But there could be cases on which the limit of 2 is broken ( only a second call until one call is finished ). Ahh, so say weapon = "bleh"; va("models/weapons2/%s/%s.glm", weapon"); Would give you a string with "models/weapons2/bleh/bleh.glm" in it? Sorry if I misunderstood you, I'm not much of a coder, but I'm trying to learn. Link to comment Share on other sites More sharing options...
Jaii der Herr Posted October 4, 2002 Share Posted October 4, 2002 char weapon[256] = "bleh"; va("models/weapons2/%s/%s.glm", weapon,weapon); that would give you "models/weapons2/bleh/bleh.glm" as result for every % you need a var in the parameter list. just have a look at some help about printf functions Link to comment Share on other sites More sharing options...
Commodus Posted October 5, 2002 Author Share Posted October 5, 2002 Ok. Thanks for the help =) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.