Jump to content

Home

How do I make level.time accessible from bg_sabers.c?


Vruki Salet

Recommended Posts

I want to access level.time from bg_saber.c and it needs to be declared first. I'm having trouble. I tried to #include g_local.h but as expected it wouldn't compile. Then I tried to just define the level_locals_t strut at the top of bg_saber.c, and then just declare it. Those just make errors (syntax errors about a ';' -???).

 

So how do I do this? How can I get level.time accessible from there? Am I just calling it the wrong thing?

Link to comment
Share on other sites

because bg files are accessed by cgame and game u cannot use stuff like that in cgame. i noticed g_local.h is already included in mine.

 

you do know that most of the saber stuff isnt actually done in there? thats mostly functions for use in the other files.

 

this is already in bg_sabers.c:

 

#ifdef QAGAME //including game headers on cgame is FORBIDDEN ^_^

#include "g_local.h"
extern void NPC_SetAnim(gentity_t *ent, int setAnimParts, int anim, int setAnimFlags);
extern gentity_t g_entities[];

#elif defined CGAME

#include "..\cgame\cg_local.h" //ahahahahhahahaha@$!$!

#endif

Link to comment
Share on other sites

Weird I didn't see that, them sneaking that include in so low down in the file. No wonder it barfed when I tried to include it too.

 

So I guess I better define QAGAME to get level.time since that's what they do in some other bg files. I'm going to try it and if I never show here again you'll know it's because QAGAME made my JKA SDK explode. :p

Link to comment
Share on other sites

OK so I got it to include g_local.h instead of cg_local.h, by defining QAGAME. It wouldn't compile. So then I scrapped the ifdefs there and made it include those. Naturally that didn't work. So it only works as is with cg_local.h included and not g_local.h. So I guess I'll go do it in w_saber instead. That'll only take an extra step I think. Thanks for the info ensiform.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...