making player info and items carry over to the next level?
Moderator: InsideQC Admins
4 posts
• Page 1 of 1
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!
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
Searching for "carry over" gives you viewtopic.php?t=80 and viewtopic.php?t=851
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
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!
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.
- Wazat
- Posts: 771
- Joined: Fri Oct 15, 2004 9:50 pm
- Location: Middle 'o the desert, USA
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest