• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

WIP Periods, royalty names & wars

I'm inclined to try to put them into "StartStoryline.c", if it will work that way. This is preferable because then all the relation stuff is in one place and anyone who wants to add another war or treaty later can see right away how to announce it in a journal entry.

Meanwhile, I'm working my way through the royalty section at the moment, for no reason other than it's before the relation section in "StartStoryline.c" and I'm just going down the list. Portugal had an interesting problem in 1580. King Sebastian died in 1578 without any heir. Cardinal Henry took over the job for a couple of years but the question of who was to be a proper successor wasn't settled, so the various claimants then resorted to the traditional way of resolving such things - war. The two main contenders were Antonio and Philip II of Spain, and as Philip had Spain's might behind him, the fight didn't last long. But Antonio had quite a bit of support throughout the Portuguese Empire - which for us means their bit of the Caribbean. So if you start your game in exactly 1580, Antonio is going to be the one giving you land, probably trying to hand it out as fast as possible before Philip takes it off him anyway. xD
 
I'm inclined to try to put them into "StartStoryline.c", if it will work that way. This is preferable because then all the relation stuff is in one place and anyone who wants to add another war or treaty later can see right away how to announce it in a journal entry.

Meanwhile, I'm working my way through the royalty section at the moment, for no reason other than it's before the relation section in "StartStoryline.c" and I'm just going down the list. Portugal had an interesting problem in 1580. King Sebastian died in 1578 without any heir. Cardinal Henry took over the job for a couple of years but the question of who was to be a proper successor wasn't settled, so the various claimants then resorted to the traditional way of resolving such things - war. The two main contenders were Antonio and Philip II of Spain, and as Philip had Spain's might behind him, the fight didn't last long. But Antonio had quite a bit of support throughout the Portuguese Empire - which for us means their bit of the Caribbean. So if you start your game in exactly 1580, Antonio is going to be the one giving you land, probably trying to hand it out as fast as possible before Philip takes it off him anyway. xD
cool find xD I skipped some regents with very short reigns since I reasoned that the player was likely to play for longer and that could be weird, but otoh, with random relations and what not, its pretty much alternate history anyway so it isnt the end of the world :onya

I tried it out and you can indeed add journal entries in StartStoryline.c! :treasure:

I had an idea about the realistic relation changes too that maybe isnt very hard; would it work if you have a function that runs like every other week/month/something and checks the date against a list of wars and peace? how hard/messy would that be? :type1
 
Several of Portugal's entries are only a couple of years, and the only reason Sebastian gets two years is that I fiddled it a bit to let him have both 1557 and 1558. But I'm drawing the line at including England's Lady Jane Grey, alias the Nine Day Queen. xD

When I get to the end of the kings and start on relations, I'll have to see about writing up some short journal entries about the various wars. Probably all looted from Wikipedia but reworded a bit so it isn't obvious that they're looted from Wikipedia. :rpirate

The only snag with having realistic relations based on a list in another file is that anyone wanting to add another war or treaty needs to remember to add it to that file as well...
 
How do you add something to tavern news?
Look at the "random relation change" code. I think it is in nations.c .

Especially if it can be limited to a specific tavern - an event which is significant in Port Royale might not be of so much interest to the people of Cartagena, for example.
I don't think that exists yet as a feature for the Tavern News, but it does exist for the rumours.

cant hurt to have a piece of tavern news there from the start ;) aint improbable ppl would be talking about the war. Im always a bit disappointed when its wholly empty when I ask the tavern keeper in the start :p but def lower prio than the journal to be sure
Fair point.
If the text is written, it should be easy enough to make it show there too.

anyway, where would be best to put the journal entries? can they go right into the startstoryline? or is it better in that place with the player type logs?
I'd suggest to group it together with where the actual relations are set too.
Since you do that in StartStoryline, it should be fine to have the log entries there too.

I had an idea about the realistic relation changes too that maybe isnt very hard; would it work if you have a function that runs like every other week/month/something and checks the date against a list of wars and peace? how hard/messy would that be?
Definitely possible. Could make for a relatively clean solution too.

The only snag with having realistic relations based on a list in another file is that anyone wanting to add another war or treaty needs to remember to add it to that file as well...
If the dates, relations, monarchs and log entries are all added to the same list (think ships_init.c), then everything could be grouped together.
Then if anyone wants to change it, only that list needs updating and nothing else.
 
Several of Portugal's entries are only a couple of years, and the only reason Sebastian gets two years is that I fiddled it a bit to let him have both 1557 and 1558. But I'm drawing the line at including England's Lady Jane Grey, alias the Nine Day Queen. xD
:rofl
When I get to the end of the kings and start on relations, I'll have to see about writing up some short journal entries about the various wars. Probably all looted from Wikipedia but reworded a bit so it isn't obvious that they're looted from Wikipedia. :rpirate

The only snag with having realistic relations based on a list in another file is that anyone wanting to add another war or treaty needs to remember to add it to that file as well...
nice xD

hm, true. maybe writing a comment with a reminder above the war part of the file could help with that a bit. I have no idea how to write a recursive(is that the right word?) function tho, least of all making it run at a set in-game date interval.. any good places to start looking to see how it could be done?
 
hm, true. maybe writing a comment with a reminder above the war part of the file could help with that a bit. I have no idea how to write a recursive(is that the right word?) function tho, least of all making it run at a set in-game date interval.. any good places to start looking to see how it could be done?
Maybe @Levis could help? The most recent similar addition were the "officer types", which was his work.
 
Maybe @Levis could help? The most recent similar addition were the "officer types", which was his work.
If someone makes sure there is an Object which looks something like this:
Code:
RelationChanges
  Change1
     date = 18.02.1800 (preferbly stored in a way I can easily read it)
     nation1 = England (preferbly the ID of england)
     nation2 = France (preferbly the ID of france)
     state = "War" (also provide a list of the different states)
     description = "The french people stick so the english want to erridicate them"
  Change2
     date = 18.06.1800 (preferbly stored in a way I can easily read it)
     nation1 = England (preferbly the ID of england)
     nation2 = Holland (preferbly the ID of holland)
     state = "War" (also provide a list of the different states)
     description = "The dutch agree with the english in their conquest to erridicate the french"

etc
you can name Change1 and Change2 whatever you want etc.
Then I could make a function very easily I think which would set the relations to the right spot.
Having some kind of message at the start or somewhere is possible but you would first need to think about your start and end range etc. I can help you with writing functions like that.
 
If someone makes sure there is an Object which looks something like this:
Code:
RelationChanges
  Change1
     date = 18.02.1800 (preferbly stored in a way I can easily read it)
     nation1 = England (preferbly the ID of england)
     nation2 = France (preferbly the ID of france)
     state = "War" (also provide a list of the different states)
     description = "The french people stick so the english want to erridicate them"
  Change2
     date = 18.06.1800 (preferbly stored in a way I can easily read it)
     nation1 = England (preferbly the ID of england)
     nation2 = Holland (preferbly the ID of holland)
     state = "War" (also provide a list of the different states)
     description = "The dutch agree with the english in their conquest to erridicate the french"

etc
you can name Change1 and Change2 whatever you want etc.
Then I could make a function very easily I think which would set the relations to the right spot.
Having some kind of message at the start or somewhere is possible but you would first need to think about your start and end range etc. I can help you with writing functions like that.
that sounds great xD its still a bit above my head rn tho :p

I have found object vars in the files, and the LayerAddObject and other things that seem relevant, but trying to figure out how they work together is making my head spin :eek: what does an object store?
 
that sounds great xD its still a bit above my head rn tho :p

I have found object vars in the files, and the LayerAddObject and other things that seem relevant, but trying to figure out how they work together is making my head spin :eek: what does an object store?

You can declare objects globally.
you can do it like this:
Code:
object RelationChanges;

function SetRelationChanges()
{
  RelationsChanges.Change1.date = "18.02.1800";
 RelationsChanges.Change1.nation1 = FRANCE;
}
 
You can declare objects globally.
you can do it like this:
Code:
object RelationChanges;

function SetRelationChanges()
{
  RelationsChanges.Change1.date = "18.02.1800";
 RelationsChanges.Change1.nation1 = FRANCE;
}
ooooh :shock thats so useful! maybe a silly question, but better to ask; can you store more than two nations so you can set up entire coalitions etc in a single change?
 
ooooh :shock thats so useful! maybe a silly question, but better to ask; can you store more than two nations so you can set up entire coalitions etc in a single change?
For the sake of programming it would be easiest I think to have only 2 nations per change. But we could do it like this too:

Code:
RelationChange
  Change1
    date = "18.02.1800"
    description = "Everyone hates each other"
    relations
      rel1
        nation1 = FRANCE
        nation2 = ENGLAND
        state = "war"
      rel2
        nation1 = HOLLAND
        nation2 = FRANCE
        state = "war"
That way you could set up different nation relation changes for a single event.
 
For the sake of programming it would be easiest I think to have only 2 nations per change. But we could do it like this too:

Code:
RelationChange
  Change1
    date = "18.02.1800"
    description = "Everyone hates each other"
    relations
      rel1
        nation1 = FRANCE
        nation2 = ENGLAND
        state = "war"
      rel2
        nation1 = HOLLAND
        nation2 = FRANCE
        state = "war"
That way you could set up different nation relation changes for a single event.
Im sorry to ask such probly superbasic questions right now, this is above any other programming Ive done this far. Ill soon get the hang of it! do I declare those attributes with like CreateEntity first, or do I write them like "RelationChanges.SecondAngloDutchWar.relations.rel1.nation1 = " and then they just exist? or am I overcomplicating it?
 
do I write them like "RelationChanges.SecondAngloDutchWar.relations.rel1.nation1 = " and then they just exist?
I do believe so. :yes

do I declare those attributes with like CreateEntity first
I think that is something complicated and engine-related. Still don't quite understand that myself after 10+ years.
Shouldn't be necessary in this case.
 
this is the unholy mess that is the thirty years war:
Code:
// Thirty Years War
    RelationChanges.ThirtyYearsWar.date.start = "23.5.1618";
    RelationChanges.ThirtyYearsWar.date.end = "15.5.1648";
    RelationChanges.ThirtyYearsWar.relations.rel1.nation1 = SPAIN;
    RelationChanges.ThirtyYearsWar.relations.rel1.nation2 = HOLLAND;
    RelationChanges.ThirtyYearsWar.relations.rel1.state = RELATION_ENEMY;
    // England joins in 1625, leaves 1630
    RelationChanges.ThirtyYearsWar2.date.start = "1.1.1625";
    RelationChanges.ThirtyYearsWar2.date.end = "31.10.1630";
    RelationChanges.ThirtyYearsWar2.relations.rel1.nation1 = ENGLAND;
    RelationChanges.ThirtyYearsWar2.relations.rel1.nation2 = HOLLAND;
    RelationChanges.ThirtyYearsWar2.relations.rel1.state = RELATION_FRIEND;
    RelationChanges.ThirtyYearsWar2.relations.rel2.nation1 = ENGLAND;
    RelationChanges.ThirtyYearsWar2.relations.rel2.nation2 = SPAIN;
    RelationChanges.ThirtyYearsWar2.relations.rel2.state = RELATION_ENEMY;
    //France joins
    RelationChanges.ThirtyYearsWar3.date.start = "23.1.1630";
    RelationChanges.ThirtyYearsWar3.date.end = "31.7.1648";
    RelationChanges.ThirtyYearsWar3.relations.rel1.nation1 = FRANCE;
    RelationChanges.ThirtyYearsWar3.relations.rel1.nation2 = SPAIN;
    RelationChanges.ThirtyYearsWar3.relations.rel1.state = RELATION_ENEMY;
    RelationChanges.ThirtyYearsWar3.relations.rel2.nation1 = FRANCE;
    RelationChanges.ThirtyYearsWar3.relations.rel2.nation2 = HOLLAND;
    RelationChanges.ThirtyYearsWar3.relations.rel2.state = RELATION_FRIEND;
    if(SWEDEN_ALLOWED){ // Sweden and France join as allies
        RelationChanges.ThirtyYearsWar4.relations.date.start = "23.1.1630";
        RelationChanges.ThirtyYearsWar4.relations.date.end = "15.5.1648";
        RelationChanges.ThirtyYearsWar4.relations.rel1.nation1 = SWEDEN;
        RelationChanges.ThirtyYearsWar4.relations.rel1.nation2 = SPAIN;
        RelationChanges.ThirtyYearsWar4.relations.rel1.state = RELATION_ENEMY;
        RelationChanges.ThirtyYearsWar4.relations.rel2.nation1 = SWEDEN;
        RelationChanges.ThirtyYearsWar4.relations.rel2.nation2 = FRANCE;
        RelationChanges.ThirtyYearsWar4.relations.rel2.state = RELATION_FRIEND;
        RelationChanges.ThirtyYearsWar4.relations.rel3.nation1 = SWEDEN;
        RelationChanges.ThirtyYearsWar4.relations.rel3.nation2 = HOLLAND;
        RelationChanges.ThirtyYearsWar4.relations.rel3.state = RELATION_FRIEND
    }

I chose that since its one of the most complicated wars, so most will hopefully not be quite that messy. but have I done that right and would it be functional, wall of code notwithstanding?
 
Conceptual question: what does it mean when a war "ends"?
I can understand when it starts (e.g. relations change to a new situation).
But if it ends, there needs to be a "something" to return to, right?
Would that be a new change instead of the end of a previous one?
 
Conceptual question: what does it mean when a war "ends"?
I can understand when it starts (e.g. relations change to a new situation).
But if it ends, there needs to be a "something" to return to, right?
Would that be a new change instead of the end of a previous one?
oh god I hope not. maybe all nations could be neutral by default if playing with real wars? or it could revert back to the standard relations for the period? but that could very often end up not making sense.. its a very good question tho..

it would make sense to add countries that are allies too when not in active war so they get mad if you attack their friends I guess, just gotta find a list of treatises
 
Conceptual question: what does it mean when a war "ends"?
I can understand when it starts (e.g. relations change to a new situation).
But if it ends, there needs to be a "something" to return to, right?
Would that be a new change instead of the end of a previous one?
if you want it to be realistic you will need to have another instance where all relations are set back to neutral or whatever yes.
But I think with the start and end date it should be possible to do this (so at the end date the relations mentioned will be set to neutral again).
@DeathDaisy could you make sure all dates are in the dd.MM.yyyy format (so 2 numbers for a date, 2 for the month and 4 for the year) that way I can easily get the right data out.
Also you can add a description field or something like that. We could have the message in there go to the tavern news to inform people about it.

The rest looks good. I sugest putting it all in a new file. if you just put it all in a file I can make sure the game will recognise it etc.
 
if you want it to be realistic you will need to have another instance where all relations are set back to neutral or whatever yes.
But I think with the start and end date it should be possible to do this (so at the end date the relations mentioned will be set to neutral again).
@DeathDaisy could you make sure all dates are in the dd.MM.yyyy format (so 2 numbers for a date, 2 for the month and 4 for the year) that way I can easily get the right data out.
Also you can add a description field or something like that. We could have the message in there go to the tavern news to inform people about it.

The rest looks good. I sugest putting it all in a new file. if you just put it all in a file I can make sure the game will recognise it etc.
nice xD yeah Ill use the XX dates no problem! and add a desc line, just wanted to make sure I didnt do a lot of work in vain :p could it be simply a word or so for each war, which could then be expanded on in a text doc, to make it a bit easier to get an overview of the code?

That will probably work when you base the wars and alliances on that assumption. :onya
sweet :beer:
 
Back
Top