View previous topic :: View next topic |
Author |
Message |
ceriux

Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA
|
Posted: Mon Nov 30, 2009 9:47 pm Post subject: making player info and items carry over to the next level? |
|
|
Ok guys i know this is possible, but i have no idea where to start im assuming it has to do with setnewparms? but id also like to carry over other things not included in the parms. can anyone help out or point me in the right direction? thanks again! _________________ QuakeDB - Quake ModDB Group |
|
Back to top |
|
 |
Spirit

Joined: 20 Nov 2004 Posts: 476
|
|
Back to top |
|
 |
Wazat
Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA
|
Posted: Mon Nov 30, 2009 10:06 pm Post subject: |
|
|
Basically, items and stats such as health are only carried over if they are set in one of the parm variables. There are only 16 of these, so you're limited in the information you can transfer. SetNewParms wipes the player's stats clean (i.e. just connected/respawned). SetChangeParms copies the player's info into the parmX variables. Finally, DecodeLevelParms copies the player's info back from the parms into the player.
Each parm is a float, so it can hold bitwise information (i.e. self.items) or standard numbers like health. No strings etc can be transferred in this manner, and a vector would require 3 of your 16 parms. Thus, any information that you can avoid transferring this way and simply rebuild from nothing in the next level is best left out of parms.
parm1-16 are actually global variables tied to the engine. I forget how exactly it works though... FrikaC and other gurus could probably fill you in.
If you want to transfer another float, simply change the 3 functions to include it. If you run out of parms or need to transfer significantly higher volumes of information, as Conquest did, you may need access to FRIK_FILE, an engine extension that lets you do file I/O. In Conquest, every weapon and shield has a host of stats, and the player can have up to 5 weapons and 3 shields. There was no way I'd fit all that into the parm# variables.
FRIK_FILE is more complex than the parms, and ties you to the engines that support it. When possible, try to use the parm variables.
I hope that helps! _________________ 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. |
|
Back to top |
|
 |
ceriux

Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA
|
Posted: Mon Nov 30, 2009 10:17 pm Post subject: |
|
|
looks like ill have to stick to FRIK_FILE, is there any documentation on it, or is prydon gate and conquest the only kind ill find on it? _________________ QuakeDB - Quake ModDB Group |
|
Back to top |
|
 |
|