UGX-Mods

Call of Duty 5: World at War => Help Desk => Topic started by: AllMoDs on December 04, 2017, 05:19:02 pm

Title: need help bad
Post by: AllMoDs on December 04, 2017, 05:19:02 pm
does anyone know how to get the save game to work
I got the menu to show up of all your saved games on the main menu to work
I'm trying to save devars that are set to keep track of how many gobblegums you have
I want to do it in the save so if you close the game or play another map and come back you can load your gum and how many liquid divinium you have back up
Title: Re: need help bad
Post by: StupidEdits on December 04, 2017, 05:52:15 pm
Afaik you use player stats to save information from game to game, not dvars. An example I found was from death_reaper's script for weapon lockers, https://ugx-mods.com/forum/index.php?topic=8448.0
Code Snippet
Plaintext
get_stored_gun()
{
wait 1;
self.stored_gun_ammo = self GetStat(3007);
self.stored_ammo_clip = self GetStat(3008);
self.has_stored_weapon = self GetStat(3009);
keys = GetArrayKeys( level.zombie_weapons );
self.stored_weapon = keys[ self GetStat( 3006 ) ];
}
Here he grabbed and set info.

Code Snippet
Plaintext
user SetStat( 3007, user.stored_gun_ammo );
user SetStat( 3008, user.stored_ammo_clip );
user.has_stored_weapon = 1;
user SetStat( 3009, 1 );
And here he set the weapon and ammo count etc. to the same stat.
Not sure how you have your entire GG setup, but hopefully it's helpful
Title: Re: need help bad
Post by: buttkicker845 on December 04, 2017, 06:19:39 pm
to add to StupidEdits statement, DidUknowiPwn listed all of the available stat slots that are free to use. This can be found here: https://ugx-mods.com/forum/index.php/topic,11489.msg127382.html#msg127382