Well to start with, I'm back. I doubt anyone remembers me that well, I've been hear a few times, but never for that long.
Great news on the source code, I wish more game developers gave their source code away when the get out of the business. I'm a believer that it is a great shame when the source code to any game is lost, due to all the time and effort that programmers have but into it.
Onto the subject of this thread. A couple of years ago now, I wrote a section of code I called "Changing face of the Caribbean". And released it onto this forum as an add on to the build.
I was never quite happy with it, and coded a new version about a year later, when I went on a canal boat holiday (It got me in a nautical mood). Unfortunately the holiday was a disaster and I forgot all about it, so I don't know if I ever released version 2.0 (it was a complete rewrite from scratch).
Last week (funnily enough while on holiday), I rediscoved my code on an old laptop, and It got me itching to play, (and therefore mod, I've never quite managed to do one without the other).
Once I got home I installed Build 14 Beta 1 Patch 3.1 on my main PC, and was surprised to find my code still stitched into DaliyCrewUpdate.c, as I was expecting it to have caused problems with Storylines.
Anyway, I'm back working on my new version, key features include, different customised able diplomatic leanings, corruption, different settings per storyline, basic modelling of alliances and customisation of the rate of change
The things that I intend to complete before release:
1. Overhaul Shifting framework - 100%
2. Perform Example Integration into standard storyline - 85% - Need to track down all governors, basic code all written, just need substituting into the 4 places per governor dialogue.
3. Localise Governor Dialogues - 0% - yea I'm gonna need help with this one
4. Fully Document Functions and integration - 100%
Overall Progress until release - 100%
The first thing I am working on is getting the localisation off the ground. Generation of governor dialogues for my mod is currently done by the function GetNationRelationWithMe() (its one of mine)
This uses iteration to work out every ally and every enemy, and string them together to make A dialogue in the form of "NATION currently considers Nation, Nation and Nation as its allies. In addition we are at war with Nation, and of course pirates are to be sunk on sight". The problem is I original coded this for myself, so its hard-coded in English. Please could someone lend a mind to the problem, Do I have to make my function take language as in input and write multiple versions in a switch statement, or is there a pre-establised was of localising text outside of the dialogue files. If it helps here is the function in question
Fudge Dragon
EDIT: Of course. thinking about it, It was written to be grammatically correct in English, It'll probably make for a horrid translation.
EDIT: Updated Progress
Great news on the source code, I wish more game developers gave their source code away when the get out of the business. I'm a believer that it is a great shame when the source code to any game is lost, due to all the time and effort that programmers have but into it.
Onto the subject of this thread. A couple of years ago now, I wrote a section of code I called "Changing face of the Caribbean". And released it onto this forum as an add on to the build.
I was never quite happy with it, and coded a new version about a year later, when I went on a canal boat holiday (It got me in a nautical mood). Unfortunately the holiday was a disaster and I forgot all about it, so I don't know if I ever released version 2.0 (it was a complete rewrite from scratch).
Last week (funnily enough while on holiday), I rediscoved my code on an old laptop, and It got me itching to play, (and therefore mod, I've never quite managed to do one without the other).
Once I got home I installed Build 14 Beta 1 Patch 3.1 on my main PC, and was surprised to find my code still stitched into DaliyCrewUpdate.c, as I was expecting it to have caused problems with Storylines.
Anyway, I'm back working on my new version, key features include, different customised able diplomatic leanings, corruption, different settings per storyline, basic modelling of alliances and customisation of the rate of change
The things that I intend to complete before release:
1. Overhaul Shifting framework - 100%
2. Perform Example Integration into standard storyline - 85% - Need to track down all governors, basic code all written, just need substituting into the 4 places per governor dialogue.
4. Fully Document Functions and integration - 100%
Overall Progress until release - 100%
The first thing I am working on is getting the localisation off the ground. Generation of governor dialogues for my mod is currently done by the function GetNationRelationWithMe() (its one of mine)
This uses iteration to work out every ally and every enemy, and string them together to make A dialogue in the form of "NATION currently considers Nation, Nation and Nation as its allies. In addition we are at war with Nation, and of course pirates are to be sunk on sight". The problem is I original coded this for myself, so its hard-coded in English. Please could someone lend a mind to the problem, Do I have to make my function take language as in input and write multiple versions in a switch statement, or is there a pre-establised was of localising text outside of the dialogue files. If it helps here is the function in question
Code:
String GetNationRelationWithMe(int iTrueNationNumber)
{
String Temp = ""
String ReturnString = ReturnNationName(ReturnFudgeNationNumber(iTrueNationNumber)) + " currently considers "
int Count
int NationsAdded= 0
for (Count = 1; Count <= 5; Count++)
{
if (Count == ReturnFudgeNationNumber(iTrueNationNumber))
{
if (Count == 5)
{
break;
}
else
{
Count += 1;
}
}
if (GetNationRelation(iTrueNationNumber, ReturnTrueNationNumber(Count)) == RELATION_FRIEND)
{
if (NationsAdded < 2)
{
ReturnString = ReturnString + Temp
}
else
{
ReturnString = Returnstring + ", " + Temp
}
Temp = ReturnNationName(Count)
NationsAdded += 1
}
}
if (NationsAdded > 0)
{
if (NationsAdded > 1)
{
ReturnString = ReturnString + " and " + Temp + " as its allies. In addition we are at war with "
}
else
{
ReturnString = ReturnString + Temp + " as its sole ally. In addition we are at war with "
}
}
else
{
ReturnString = ReturnString + "no great power as its ally. In addition we are at war with "
}
NationsAdded = 0
Temp = ""
for (Count = 1; Count <= 5; Count++)
{
if (Count == ReturnFudgeNationNumber(iTrueNationNumber))
{
if (Count == 5)
{
break;
}
else
{
Count += 1;
}
}
if (GetNationRelation(iTrueNationNumber, ReturnTrueNationNumber(Count)) == RELATION_ENEMY)
{
if (NationsAdded < 2)
{
ReturnString = ReturnString + Temp
}
else
{
ReturnString = Returnstring + ", " + Temp
}
Temp = ReturnNationName(Count)
NationsAdded += 1
}
}
if (NationsAdded > 0)
{
if (NationsAdded > 1)
{
ReturnString = ReturnString + " and " + Temp
}
else
{
ReturnString = ReturnString + Temp
}
}
else
{
ReturnString = ReturnString + "no great power"
}
if (GetNationRelation(iTrueNationNumber, PIRATE) == RELATION_ENEMY)
{
if (NationsAdded == 0)
{
ReturnString = Returnstring + ", but of course pirates are always to be sunk on sight."
}
else
{
ReturnString = Returnstring + ", and of course pirates are always to be sunk on sight."
}
}
else
{
ReturnString = Returnstring + ". In addition captain, It would be in " + ReturnNationName(ReturnFudgeNationNumber(iTrueNationNumber)) + "'s best interest if you did not bother pirates while in our service. We have come to an arrangement."
}
return (ReturnString)
}
Fudge Dragon
EDIT: Of course. thinking about it, It was written to be grammatically correct in English, It'll probably make for a horrid translation.
EDIT: Updated Progress