Global vars in QuakeC, not possible right?
Moderator: InsideQC Admins
4 posts
• Page 1 of 1
Global vars in QuakeC, not possible right?
It is my understanding that global variables aren't possible in QuakeC, only global constants.
In particular, when the level changes all information is lost except player info (parm10, etc.)
Am I right about the above?
And if so, I should use extraneous cvars like scratch1, scratch2, saved1, saved2, etc.) to preserve information? (Unless I want to add extra fields to entities and I've read that uses a lot of memory because each edict used has that field?).
[add: btw, I'm not referring to storing player specific information. I just referring to general global variables not related to the player.)
In particular, when the level changes all information is lost except player info (parm10, etc.)
Am I right about the above?
And if so, I should use extraneous cvars like scratch1, scratch2, saved1, saved2, etc.) to preserve information? (Unless I want to add extra fields to entities and I've read that uses a lot of memory because each edict used has that field?).
[add: btw, I'm not referring to storing player specific information. I just referring to general global variables not related to the player.)
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
- Code: Select all
float myglobal;
There you go. Note the lack of assigning a value to it, which would make it a constant.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
if you want persistence across level changes, a standard global won't work, all globals are reset (actually the progs are completely unloaded then reloaded) on level change. The only global variable kept across level changes is serverflags. If you want others, yes, then using cvars is not a bad solution.
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest