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


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tony "omega"
Sergi
Sent: October 21, 2003 5:38 PM
To: [EMAIL PROTECTED]
Subject: RE: [hlcoders] SV_ReadClientMessage: unknown command char (255)

I *THINK* I've got that stuff sorted (I made a function to parse the
string that's read from the script to make sure only alphanumeric and /
and _ are usable, but knowing my luck that had nothing to do with it and
it would ocme back, since it did stop at one time, and ended up changing
to sound/d and then finally sound/i after I had put the validation func
in)
But now I have another problem.

I can't seem to precache any of these sounds, well rather, only one will
precache.

It seems that if I loop through all of them and call precache_sound on
each one, it ends up giving them all the same index!

Ie: right now, I load up a map, first thing that happens once the world
has been spawned is it parses all my scripts, calls precache on all the
sounds individually, then goes into w_precache, etc.

But, _all_ of those sounds are taking index 1, which is bad.

Anyone know of a way to dynamically precache stuff in this manner? I'm
going to continue at it till I figure it out, but I thought I'd ask
anyway, just incase I get stumped again.

-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

Reply via email to