Inside3D!
     

making player info and items carry over to the next level?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Mon Nov 30, 2009 9:47 pm    Post subject: making player info and items carry over to the next level? Reply with quote

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
View user's profile Send private message Yahoo Messenger
Spirit



Joined: 20 Nov 2004
Posts: 476

PostPosted: Mon Nov 30, 2009 9:52 pm    Post subject: Reply with quote

Searching for "carry over" gives you http://forums.inside3d.com/viewtopic.php?t=80 and http://forums.inside3d.com/viewtopic.php?t=851
_________________
Quake Maps
Back to top
View user's profile Send private message Visit poster's website
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Mon Nov 30, 2009 10:06 pm    Post subject: Reply with quote

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. Smile

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
View user's profile Send private message MSN Messenger
ceriux



Joined: 06 Sep 2008
Posts: 969
Location: Florida, USA

PostPosted: Mon Nov 30, 2009 10:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group