[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - carrying variables over from one map to another...

carrying variables over from one map to another...

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

carrying variables over from one map to another...

Postby necros » Thu Dec 16, 2004 11:20 pm

is it possible to, for example, carry the "total monsters" and the "monsters killed" variables from one map so that you can add them to the variables in another map?
i know quake can do that with ammo, but how do you make a 'permanent' variable like that?
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Postby Urre » Fri Dec 17, 2004 12:54 am

Parms are pretty darn permanent...

Then there's always FRIK_FILE, assuming you're using an engine that supports it.
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby necros » Fri Dec 17, 2004 12:55 am

if possible, i'd like to keep everything compatible with original quake... :\
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Postby Wazat » Fri Dec 17, 2004 2:54 am

Parms, then. You'll find them near the top of client.qc.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby Wazat » Fri Dec 17, 2004 2:56 am

...btw, there's also temp1, gamecfg, nomonsters, savedgamecfg, saved1-5, etc. Those cvars can be fairly useful, and they stay the same across maps.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby necros » Fri Dec 17, 2004 4:26 am

thanks! i didn't know there were so many of those.

about parm, there are up to parm16 declared in defs.qc... when (if at all) are parm10-16 used? i only see 1 to 9 used for SP ammo/items.
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Postby Wazat » Fri Dec 17, 2004 5:20 am

You can use any and all of the parms as you please. There's no pre-defined order you have to store things in, and none of the stuff is really required. If your mod gives players 100 health each time they start a level, then you don't need to store health in a parm. If you don't need to store ammo, you can remove those. You might store all that information using FRIK_FILE in your mod, and not need any more than 1 parm (to store client ID to match players to their save files).

Likewise you can use the other, unused parms for whatever purpose you deem necessary.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby necros » Fri Dec 17, 2004 6:02 am

ah, so they are unused, then? thanks! this is great, i didn't know quake had hidden gems like this. ;)
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

sorry to ressurect the thread,

Postby necros » Tue Jan 11, 2005 8:12 am

but i have another question on this topic, specifically, how do you use the variables saved1-4 in qc? it's easy to do it via the console in the game, but how can one access these vars in qc?

i've tried delcaring a float 'saved1' but this is just treated as a normal float and not the actual saved1 i want.

any help?
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm

Re: sorry to ressurect the thread,

Postby Supa » Tue Jan 11, 2005 8:55 am

You'd use savedX like any other cvar in Quake: use stuffcmd/localcmd (Preferrably stuffcmd for SP) to set it and use 'cvar' to read it.:

stuffcmd(player, "cl_foo 3\n");
(later)
self.bar = cvar("cl_foo");
User avatar
Supa
 
Posts: 164
Joined: Tue Oct 26, 2004 8:10 am

Postby FrikaC » Tue Jan 11, 2005 9:29 am

If you need a bit more than 10-16, I should note that parm9's use in Quake is kinda pointless. It stores the "armortype" variable, a variable with only 4 possible values all of which are already flagged in .items.

So all you need to do to free up parm9 is add this to the bottom of DecodeLevelParms:

if (self.items & IT_ARMOR1)
self.armortype = 0.3;
else if (self.items & IT_ARMOR2)
self.armortype = 0.6;
else if (self.items & IT_ARMOR3)
self.armortype = 0.8;
else
self.armortype = 0;
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby FrikaC » Tue Jan 11, 2005 9:33 am

Oh, and you really should use cvar_set for setting cvars, not stuffcmd or localcmd.
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby Wazat » Tue Jan 11, 2005 4:20 pm

Yea, as FrikaC said, use cvar to read and cvar_set to modify.

There's also savedgamecfg, which I think is just like saved1 etc.

There's also gamecfg, temp1, and nomonsters. These aren't saved in the cfg files, which can make them more or less useful. You can change them without worrying about their settings carrying over to the next time the user starts quake. Set them just before the map changes and load them just after the level starts (in worldspawn()). If you store their values as floats during game and only set & load them for map changes, they should be saved in save games, right?

I'm sure there are others. And in DP you can make your own cvars...
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

thanks!

Postby necros » Tue Jan 11, 2005 7:31 pm

wow, thanks for all the help, guys! there's still so much for me to learn about qc. :P
necros
 
Posts: 77
Joined: Thu Dec 16, 2004 10:32 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests