• 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!

[REQ] Updated Log Book

paddymcphee

Powder Monkey
Im looking and wondering if its possible to update the logbook

with the names of ships sunk and possibly the number of crew that goes down with it and the country its loyal too
plus anything else ye thinks that might be good or better my idea
 
I like this idea, I think it would be really cool.

I feel I can do this but the only thing I am unsure of is saving this data along with the savegame so it keeps a record throughout your entire campaign.

I'll start looking into it but in the meantime has anyone done anything that saves additional data to the savegame and if so what did you need to do to include new data and have it loaded again?
 
I like this idea, I think it would be really cool.

I feel I can do this but the only thing I am unsure of is saving this data along with the savegame so it keeps a record throughout your entire campaign.

I'll start looking into it but in the meantime has anyone done anything that saves additional data to the savegame and if so what did you need to do to include new data and have it loaded again?

Hi Vorius,

I'm pretty sure the system will save any variable it finds, so you can either add an attribute to an existing object (like pchar), or define a new object in the script files, though defining a new object can break save game compatibility.
 
Hi Vorius,

I'm pretty sure the system will save any variable it finds, so you can either add an attribute to an existing object (like pchar), or define a new object in the script files, though defining a new object can break save game compatibility.

Awesome, that would be great. Thanks for the info! I will test it out tonight.
 
Actually, that's another point. It'll only save variables with global scope, that is, defined outside the functions.
 
Actually, that's another point. It'll only save variables with global scope, that is, defined outside the functions.

Ok, yeah that would make sense.

So it will save non-primitive attributes made to existing objects or new objects if you don't care to maintain savegame compatibility.

Technically it sounds like they use reflection to get all the properties of the objects so it does not have to worry about specifying getting/setting every single property when saving/loading

That's a really nice way to do it. I like that a lot. Thanks Akella for making it this way!
 
More info:

If you add an attribute to something (like pchar) it get's stored as a string,

so if you store an integer or float:
pchar.mynum = iNum
pchar.myfloat = fNum
Then you have to convert it back on reading:
iNum2 = sti(pchar.mynum)
fNum2 = stf(pchar.myfloat)

Also, I think you can save globaly defined primatives. For example:
int MOD_SKILL_ENEMY_RATE (the difficulty setting) is stored on save, as well as some bools and floats...

Oh, and something that really annoys me. I'm pretty sure you can't do boolean logic. So no:
Code:
if ((a || b) && (c || d)) {...}
You have to do it with multiple if statements :ng
 
HMMM you lost me at the second post
but if theres anything you guys need me to do to make this idea happen let me know

although i admit im a NOOB when it comes to modding

also thinking of adding

NAME OF SHIP
CREW DEATHS
COUNTRY LOYALTY
WEIGHT IN TONNAGE

and anything else
 
I wish you could do if ((a && b) || (c && d))

I did a course in programming and being able to do it like that was AWESOME!

But for saving the number having this should work.

Code:
int shipnum = 0;

if (shipsunk)
{
shipnum = sti(pchar.shipsunk);
shipnum ++
pchar.shipssunk = shipnum;
}

NOTE: That code would be used to determine how many ships you have sunk
 
Back
Top