Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memorial upgrades #6327

Closed
wants to merge 20 commits into from

Conversation

Projects
None yet
5 participants
@Soyweiser
Copy link
Contributor

commented Feb 26, 2014

Done so far:

  • Memorial file displays type of ammo and amount of ammo remaining/clip size of carried weapons.
  • Added mod and world options info. Displayed world name.
  • Changed starting memorial message.
  • Cash display
  • Kill list not shown when empty.
  • Added martial art styles
  • Traits only show up when there are traits.
  • Starting traits listed
  • Added starting stats, these are only set on character creation.
  • Starting values (not skills yet) are listed in the memorial file.

https://www.dropbox.com/s/93503kdjepajaus/Nathan%20Cann-Sat%20Mar%2022%2001-50-30%202014.txt (example: could not find a way to get better mod file names).

Other stuff:
Also wanted to make it more clear what your starting chosen options were. (started with traits xyz, stats etc. If we also allow uploading of these files that could provide some interesting data). Calculate cash on hand + cash on debit cards.

And try to fix any other bugs. Like death damage not calculated in the damage taken value.

Any requests for changes to the memorial file?
Edit: #2860 this seems to be broken currently. Edit guess not. Could not reproduce it.
Edit: https://www.dropbox.com/s/edf3k33afxvoat3/Delila_London-Mon%20Dec%2022%2018-40-41%202014.txt?dl=0 updated newest version. (from 22-12-2014).

@Zireael07

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2014

Black road/classic mode should be marked.

And definitely, uploading them in the future is a brilliant idea!

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Feb 26, 2014

Game versions... those should also be added to the files. Edit: im an idiot. Already in. The first line... duh.

Soyweiser added some commits Feb 27, 2014

Working on memorial file. Tried to add ammo listing to inventory, not…
… working. Changed bionic power not to show if zero.
- kill list not displayed on death when the kill list is empty.
- Ammo types of weapons wielded and carried correctly shown now.
@KA101

This comment has been minimized.

Copy link
Contributor

commented Mar 7, 2014

Hey, let us know when this gets out of WIP? (Should be an "Edit" button next to "New Issue" to modify the title.)

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2014

Been busy irl. Have not had time to work on it. Will post updates when i implement them

Soyweiser added some commits Mar 13, 2014

Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
…into memorial

Conflicts:
	src/game.cpp
	src/player.cpp
- Changed start memorial message, made it gendered.
- Added world options and mod list to memorial file.
- Added martial art styles
- Added indents
- Traits only show up when there are traits.
Added starting stats, these are only set on character creation.
Starting values (not skills yet) are listed in the memorial file.
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
…into memorial

Conflicts:
	src/creature.cpp
	src/creature.h
	src/game.cpp
	src/game.h
	src/player.cpp
	src/savegame_json.cpp
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
…into memorial

Conflicts:
	src/player.cpp
@KA101

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2014

Hey, should this be considered for merge? Haven't heard from it in a While and I'd like to get it updated and in, or closed.

@KA101 KA101 force-pushed the CleverRaven:master branch from a342a64 to 0da0595 Oct 30, 2014

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Dec 16, 2014

Have not looked at it in while. I ran into some problems defining new Json objects for the players. (I need to store some of the character creation values). I asked on irc but there was no reply. I'll see if I can discover what the problem was.

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Dec 20, 2014

Well this is my problem. I'm using parts of this code:
<addr>
if (data.has_object("skills")) {
JsonObject pmap = data.get_object("skills");
for( std::vector<Skill *>::iterator aSkill = Skill::skills.begin();
aSkill != Skill::skills.end(); ++aSkill ) {
if ( pmap.has_object( (*aSkill)->ident() ) ) {
pmap.read( (*aSkill)->ident(), skillLevel(*aSkill) );
} else {
debugmsg("Load (%s) Missing skill %s", "", (*aSkill)->ident().c_str() );
}
}
} else {
debugmsg("Skills[] data object not loaded in savegame_json.cpp::player::json_load_common_variables");
}
To load a different jsonObject called "startingSkills". For some reason that object overwrites the skills object, not the startingSkills object.

I basically copied the code and changed these lines:
if (data.has_object("startingSkills")) {
JsonObject pmap = data.get_object("startingSkills");
But then, the startingSkills are read from the save file, but they get written to the skills object.

I cannot find where the read json object is put into the std::map<Skill *, SkillLevel> _skills; object.

(I made a std::map<Skill *, SkillLevel> _startSkills; object, but it gets written to the _skills object).

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Dec 20, 2014

I cannot find where the read json object is put into the std::map _skills; object.

There: pmap.read( (*aSkill)->ident(), skillLevel(*aSkill) );

JsonObject::read reads the given member (if it exists) and puts it into the variable (provided as reference to the function). And player::skillLevel returns a reference to the players skill (not the starting skill).

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Dec 21, 2014

Thanks. That would indeed be the cause of the problem. Will fix it now.

Added StartingSkills, correct saving and loading of startingSkills ob…
…ject, increased the version number of the save file. It has legacy support. If you load an old save file, the startingSkills are set to zero.

Memorial file now also lists startingSkills if the dead character had some starting skills.
@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Dec 22, 2014

There, this one works. Now, I just need to update my master. And resolve any merge conflicts. (I already noticed the save version was bumped up a bit).

Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
…into memorial

Conflicts:
	src/creature.cpp
	src/game.cpp
	src/newcharacter.cpp
	src/player.cpp
	src/savegame.cpp
	src/savegame_json.cpp

@Soyweiser Soyweiser changed the title [WIP] Memorial upgrades Memorial upgrades Dec 22, 2014

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Dec 22, 2014

Should all work now. Fixed it. So no longer WIP

@@ -4229,7 +4229,8 @@ void game::death_screen()
{
gamemode->game_over();
Messages::display_messages();
disp_kills();
if( kills.size() > 0) //Only list the kills when there are kills.

This comment has been minimized.

Copy link
@BevapDin

BevapDin Dec 22, 2014

Contributor

Please, please add {} here and below where the skills get iterated.

This comment has been minimized.

Copy link
@KA101

KA101 Dec 22, 2014

Contributor

Not a "please" situation, project style requires bracing on new if-statements. We don't want the code collapsing in an earthquake.

if(has_trait(iter->first)) {
memorial_file << indent << traits[iter->first].name;
if(has_base_trait(iter->first)) {
memorial_file << " (Starting Trait)";

This comment has been minimized.

Copy link
@BevapDin

BevapDin Dec 22, 2014

Contributor

Translation is missing.

{
return _skills[_skill];
}
*/

This comment has been minimized.

Copy link
@BevapDin

BevapDin Dec 22, 2014

Contributor

If it's not needed - throw it away. It can always be restored/viewed through git. Why is it here anyway?

}
//Starting Skills (check if there are starting skills first.
bool had_starting_skill = false;
for (std::vector<Skill*>::iterator aSkill = Skill::skills.begin();

This comment has been minimized.

Copy link
@BevapDin

BevapDin Dec 22, 2014

Contributor

That will conflict with the const Skill* PR. I recommend using auto.

Edit: and of course using ranged based loops - we don't need no iterator.

memorial_file << _("Active Mods:") << "\n";
std::vector<std::string> mods = world->active_mod_order;
for(size_t i = 0; i < mods.size(); ++i ) {
memorial_file << indent << mods[i] << "\n";

This comment has been minimized.

Copy link
@BevapDin

BevapDin Dec 22, 2014

Contributor

That will only give you the mods ident, not the displayed name. You need to look that up in mod_manager::mod_map, which is private, so you need to add a function to that class that does the lookup.


//Load the starting skills.
if( savegame_loading_version <= 23 ) { //No startingSkills object.
debugmsg("Save version < 24, no starting skills object");

This comment has been minimized.

Copy link
@BevapDin

BevapDin Dec 22, 2014

Contributor

Don't show message, this is an expected situation, no need to warn / inform the player, everything is fine as it is.

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Dec 22, 2014

Will process your comments tomorrow. Thanks for reading it over.

@OzoneH3

This comment has been minimized.

Copy link
Member

commented Dec 3, 2015

No progress for a year, closing.

@OzoneH3 OzoneH3 closed this Dec 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.