Vruki Salet Posted January 3, 2006 Share Posted January 3, 2006 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 More sharing options...
ensiform Posted January 4, 2006 Share Posted January 4, 2006 what exactly do you need level.time for? i don't think you really want to add that to bg_sabers since its a bg_file because its not used in the cg or ui. Link to comment Share on other sites More sharing options...
Vruki Salet Posted January 4, 2006 Author Share Posted January 4, 2006 I don't? I want to determine whether a player presses a button within X milliseconds after his saber hits another saber. I thought I had it worked out fine until the thing would allow access to level.time. What's up with bg files? Link to comment Share on other sites More sharing options...
ensiform Posted January 4, 2006 Share Posted January 4, 2006 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 More sharing options...
Vruki Salet Posted January 4, 2006 Author Share Posted January 4, 2006 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. Link to comment Share on other sites More sharing options...
Vruki Salet Posted January 4, 2006 Author Share Posted January 4, 2006 BTW yes I know about the saber stuff done in other files but there's some good stuff to work with in there too. At least it works for me. Link to comment Share on other sites More sharing options...
Vruki Salet Posted January 4, 2006 Author Share Posted January 4, 2006 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 More sharing options...
razorace Posted January 10, 2006 Share Posted January 10, 2006 Mind posting the code of what you're trying? Link to comment Share on other sites More sharing options...
Vruki Salet Posted January 10, 2006 Author Share Posted January 10, 2006 I've gone in another direction atm but as soon as I get back to that I'll post. (That version is now in my garbage dump of a tried-and-failed archive and I don't want to dig for it, but give me a day or two.) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.