Nm, it was a pointer problem.
What I ended up having to do was make a temp array and passing it to
precache_sound_array.
I don't know why, but going through the loop re-creating one string
would nerf it at precache somnewhere, it would SHOW what was being
precached, but the engine was taking in a null string for some reason.
*boggle*.
This also solved the unknown command char error.
inline int PRECACHE_SOUND (char* s)
{
//s would apparently be null inside this engine func
int wee = g_engfuncs.pfnPrecacheSound(s);
if (wee>0)
//but it would print out fine here!
ALERT(at_console, "[debug] Precached: \"%s\" index: %i\n", s, wee);
return wee;
}
However I've discovered something else rather funny, when the client
loads all of the materials (so it can do lookups itself for
effects/predicted footsteps etc) all the vgui takes on names of the
materials ;) I'm betting that has to do with the way all the vgui panels
are initialized. So when my material system goes, it takes up the space
where all the vgui strings were originally initialized to null or
something :/
Is this a compile bug, or is it something that just happens when you
initialize to null? Because I haven't touched the vgui in ages, and
anything that wasn't created in a static array (ie: class names, weapon
names etc) in the vgui is overridden with the most recent material.
Scoreboard, etc.
A screenshot of the scoreboard is here:
http://omega.frontline2.com/scoreboard_goofy.jpg
nifty huh? ;)
every time I change surfaces (while walking), the text changes ;)
-omega
http://www.frontline2.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tony "omega"
Sergi
Sent: October 22, 2003 1:43 AM
To: [EMAIL PROTECTED]
Subject: RE: [hlcoders] precache, arg!
Okay, so, like, PRECACHE_SOUND_ARRAY works.
But, if I do a loop of 4 sounds manually, it doesn't?
Wtf?
What's going on?
Calling precache_sound_array, with an array of names precaches the
sounds correctly and increments the index of the sounds. But if I do a
loop myself, outside of the macro, it gives everything the same index?
How is this so?
Some pseudo code:
for i = 0; i < 6; i++
{
precache_sound(array[i]));
};
the precache will not work properly, but if I make an array of 6 sounds,
and pass it to PRECACHE_SOUND_ARRAY, it does?!
#define PRECACHE_SOUND_ARRAY( a ) \
{ for (int i = 0; i < ARRAYSIZE( a ); i++ ) PRECACHE_SOUND((char
*) a [i]); }
why for? :(
I feel like a 4 year old right now with the way I've written this post
:/
-omega
http://www.frontline2.com
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders