therfiles Posted September 13, 2012 Posted September 13, 2012 Hey there guys, I need some help finding a command for SP. I had a feature planned that I was hoping to implement that used lots of cvars. Now, as you know, save games don't retain cvars, so if you save a game with a cvar set to 1, keeping playing, awhile later set it to 2, then later load the game you saved. The cvar is not 1, it is 2. Now I wanted to fix this, using the writeconfig command along with save. Like so: save game1;writeconfig game 1. But I recently found out that writeconfig only saves binds and other commands, not custom cvars. Is there any commands that dumps all the commands into an .cfg file? Thanks.
eezstreet Posted September 14, 2012 Posted September 14, 2012 Custom cvars do not have the ARCHIVE flag on them, and therefore cannot be written to any sort of config without modifying the SP code
therfiles Posted September 14, 2012 Author Posted September 14, 2012 Hmmmm...thanks for the reply. Bummer. How difficult would that be? I know that SP coding isn't easy and is a relatively new area, but how difficult would it be to add the ARCHIVE flag to cvars?
afi Posted September 14, 2012 Posted September 14, 2012 Aren't there cvars that are quite useless (or not even used) and so could be used (or abused) as a "custom"-cvar?
therfiles Posted September 14, 2012 Author Posted September 14, 2012 Hmmm....that would work...but we would need to find LOTS of them. And most of the cvars stored in .cfgs are display options.
eezstreet Posted September 14, 2012 Posted September 14, 2012 Not totally sure. I think there could be some clues in the game exports: d_JediAI = gi.cvar ( "d_JediAI", "0", CVAR_CHEAT ); <- last arg specifies flags I haven't totally reverse engineered the cvar struct yet, but I do know that the game imports in gi -could- hold some clues as to how to alter the flags of them. I already have the whole of gi worked out. There's no way to modify the flags of a cvar directly through the jagamex86.dll from within Raven's code though. You'd need to do an engine hack (read: jasp.exe) in order to do such a thing. If I'm right though, changing the flags of a cvar would be done exactly the same way as in MP. That's aside from the fact that temporary/custom cvars aren't totally meant to be archived. If you have a specific use for the custom cvar, I might add a sort of plugin to JAMod that would improve custom cvars for you (no guarantees yet though as I haven't even started on that) therfiles likes this
therfiles Posted September 15, 2012 Author Posted September 15, 2012 Using seta adds it to the list? :wacko:
afi Posted September 15, 2012 Posted September 15, 2012 LOL Totally forgot about that... I feel stupid now The quake code says: As Cvar_Set, but also flags it as archived There are also setS and setU which do serverinfo and userinfo
therfiles Posted September 15, 2012 Author Posted September 15, 2012 Just tested it out...it works! Thanks for your work, eezstreet, razor, and afiNity! BTW...what is so special about setS and setU?
eezstreet Posted September 15, 2012 Posted September 15, 2012 sets and setu are not really important unless you're trying to network it. sets makes server data known to the client (such as map, number of players, that kind of thing), setu does the opposite (saber color, hilt, et al) therfiles likes this
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now