Code Monkey home page Code Monkey logo

hoi4save's People

Contributors

nickbabcock avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lokisharp

hoi4save's Issues

Error deserializing repeated fields

When attempting to deserialize a section of code that contains repeated saved_event_target fields in the given format, the deserialization fails with the error Hoi4Error(Deserialize(Error(Deserialize(DeserializeError { kind: Unsupported("not an object") })))).

Steps to Reproduce

  1. Attempt to deserialize code containing repeated saved_event_target fields.
saved_event_target={
	country="CHI"
	name="WTT_current_china_leader"
}
saved_event_target={
	country="PRC"
	name="WTT_communist_china"
}
saved_event_target={
	country="YUG"
	name="yugoslavia_wedding_partner"
}
saved_event_target={
	state=800
	name="TUR_kurdish_state_event_target"
}
  1. Run the deserialization:
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct SavedEventTarget {
    pub country: Option<String>,
    pub state: Option<i32>,
    pub name: String,
}

// in struct
saved_event_target: Vec<SavedEventTarget>

Saves file assets update needed

When I implemented the model, I found some broken updates in save file.
For example, This definition for party was changed in the newest version.

Avalanche v1.12.10.91f2 (0f26)

parties={
	democratic={
		default=yes
		popularity=13.333
		country_leader={
			{
				ideology="conservatism"
				character={
					id=1178
					type=73
				}
			}
		}
	}
	communism={
		default=yes
		popularity=13.333
		country_leader={
			{
				ideology="stalinism"
				character={
					id=1179
					type=73
				}
			}
		}
	}
	fascism={
		default=yes
		popularity=13.333
		country_leader={
			{
				ideology="nazism"
				character={
					id=1177
					type=73
				}
			}
		}
	}
	neutrality={
		default=yes
		popularity=60.001
		country_leader={
			{
				ideology="oligarchism"
				character={
					id=6758
					type=73
				}
			}
		}
	}
}

1.10-normal-text

parties={
	democratic={
		name="Zentrum"
		long_name="Zentrum"
		popularity=20.000
		country_leader={
			id={ id=2 type=54 }
			name="Konrad Adenauer"
			desc="POLITICS_KONRAD_ADENAUER_DESC"
			picture="Portrait_Germany_Konrad_Adenauer.dds"
			ideology=conservatism
			expire="1965.1.1.1"
			female=no
		}
	}
	communism={
		name="KPD"
		long_name="KPD"
		popularity=20.000
		country_leader={
			id={ id=3 type=54 }
			name="Wilhelm Pieck"
			desc="POLITICS_WILHELM_PIECK_DESC"
			picture="Portrait_Germany_Wilhelm_Pieck.dds"
			ideology=stalinism
			traits={ exiled }
			expire="1965.1.1.1"
			female=no
		}
	}
	fascism={
		name="NSDAP"
		long_name="Nationalsozialistische Deutsche Arbeiterpartei"
		popularity=60.000
		country_leader={
			id={ id=1 type=54 }
			name="Adolf Hitler"
			desc="POLITICS_ADOLF_HITLER_DESC"
			picture="Portrait_Germany_Adolf_Hitler.dds"
			ideology=nazism
			traits={ dictator }
			expire="1965.1.1.1"
			female=no
		}
	}
	neutrality={
		name="Non-Aligned"
		long_name="Non-Aligned"
		popularity=0.000
		country_leader={
			id={ id=834 type=4713 }
			name="Karl Wagner"
			picture="gfx/leaders/Europe/portrait_europe_generic_6.dds"
			ideology=moderatism
			traits={ editor }
			expire="1942.1.1.12"
			female=no
		}
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.