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

Career in Royal Navy

Capt. Daniel Wolf

Freebooter
Storm Modder
<b>Only an idea, but doesnt seems so hard, to implement, only I need time.</b>

Ok, I cant resist to get attached to the royal navy, so I may introduce a way for a regular captain, to "join in"... as a navy officer.
For example, there should be an 'enlisting office' in each english colony.

The 18th century tricorner-hat models seems very accurate to me, and offers wide variety of officers, so ths "option" is going to be placed in the 18'ths.

You can only join, if you are at least a Bloke, and England likes you as a nation. (Its proper % value thinked in the future ^^)
You have to sell your ship, and store your money at the loanshark, so you start without money, only with personal belongings.
(doesnt mutch Royal navy captain owned a civilian ship also..)
As a start, some years going to pass in the story, (after all, you need proper training) and you find yourself as a midshipman.

<b>Midshipman:</b>
You can select from all avaliable english navy midshipman models.

You need to do fencing training, answer a series of Royal Navy trivia, you need to learn the way to talk to the men in the hold, and gundeck, (nice locations we could use) but you dont have your own ship in this short period. If you go to sea, you find yourself in "active duty", and continue your trivia tests, handling crewmembers, fencing lessons on the decks. You cant sail, cant go to sea view. This will be only a short period.

After you passed all the test, (the last one is: you finally going to sea view, and you have give orders to set sails, set full sails, turn, do this, do that, fast travel to the other shore)
You become a lieutenant.

<b>Lieutenant:</b>

I know it isnt truly historically correct, (as Lt.'s dont had their own ships) but you going to get a navy painted Lugger_WML,
and you going to get missions, (like the ones the governors give you as a civilian) to intercept, or simply inspect coastal ships.

Inspect:
new function, I will code it, works like boarding, if you get near enough to a friendly, or neutral ship. The ship may, or may not
accepts your request. If yes, you can walk to that ship. (I will use the surrendered ship feature, but change the dialog) Ad you
may, or may not find that the cargo, or nationality matches what the cap' and its paper says, then, you can decide what to do.
As a thinking man, you go back to your ship, to sea view, then you decide what to do. If the papers are false, and you attack
the ship, no rep change for you. Nor any change in national likings. But you can let him go. (then, if papers were false, a
number is subtracted from a hidden variable: loyality. Discussed next.) If your job was to inspect him, then the quest returns
"done" anyway. (if a ship refused inspecting, but you have orders for it, your quest returns 'done' if you capture, or destroye it.
But only, if you asked it to inspect)

So, you spend your days as a coastal guard, can only fast-sail to ships, and locations at the shore of Port Royal.
you cant go to worldmap, and if you leave the shores of Port Royal, (DirectSail area change) your men will throw you out of the ship, into a life boat, and so long navy career.

After a few missions, if your "fame" is high enough, (second, but visible variable)
You can sign for a promotion as a captain. They may accept, if your fame is high enough.
At the start, you get only that Lugger_WML, that you have as a lieutenant. But if ou spend more time as a lieutenant, you can get
a fast sloop-brig. (they will let you know, what ship they offer, if you run for a captains rank)

<b>Captain:</b>
After you promoted, and have the weary little Lugger_WML, or the brig-rigged-sloop ship, you can finally leave port.
You get missions, if you visit the forts, and they only give you your, and the men's salary, if you finished the firstly given one, and sign for another one, but you can go and prey on enemy shipping freely. Also you can inspect all shipping under english, or neutral nation flags, and if you find that they are lying, they are fre to prey on... And this adds to your loyalty, if you do.

Captain missions tend to be:
1.: find and kill a given name ship, in english, or neutral colonies shores,
2.: the same with inspect order for a named ship
3.: take a highly expected noble, officer, or spy as a passenger to another port, (attacks expected)
4.: take VERY mutch gunpowder, (a % is given, that in a battle, if this roll succeeds, you gou up like the SATURN rockets, and sink immediately) prisoners, or food to another english settlement,
5.: Sink given number of ships from a given nation.

Between these, you can get ANY quests, go ANYwhere, youre a free captain. Time isnt an essence, as this is a free game.

As a captain, if your fame is high enough, you will be presented with a last official Royal Navy class you can get in this mod: the fast frigate.


+ + +


<b>In general:</b>
<i>The navy ranks will have nothing to do with letter of marquee ranks. You have to quit privateering, and give back the letter, if you want to join the navy.</i>
As an lt. at the shores, or as a Cptn. on the sea, you can board, and capture ships. (they immediately going to get the HMS pre-tag in their names, as their not yours..) You can switch to them, but then, if you go ashore, you loose the other one, as its taken by the Royal Navy, as a prize. You will get little prize-money, as lt., but MUTCH more, as captain..
You cant sell ships in english land. But you can purchase better guns, and repair.

As a captain, you can sails to other countries, though..

You can sell any ship you like in foreign countries, but you cant purchase, only take as prize, and switch to it.
If you go to an english colony, they going to taken as prize by the navy... (lots of loyalty, fame, and money you get also)
If you sold prize ships in foreign countries, your hidden 'loyalty' will go down dramatically..

So, you can command any ship, you taken, but the secondly commanded ones will be taken by the navy, if you go to english land, as you are only a captain...

Rank advancement:
The midshipman role is only an rpg, and history learning miniquest, so it will NOT last long, only til you pass all the tests.
As an lt, if you take only a few (5-6) missions at the shoreline, you can advance to captain. (with lugger_WML) or, you can do
more, for the fast-brig.
(you can get that later, as a captain also)
So, fight your way up to be a captain wasnt going to be long at all. If youre good about basics facts of the navy, you can roam
thru the midshipman in 15-20 minutes, a hour or less for a hard-ass player to finish all lt. quests if he aims the lugger, and
BANG, youre captain, and a free man, only with nice uniforms, a HMS ship, with proper painting ^^ and alot of plus missions.

Loyalty:
Interesting thing. You get a number at the start, and if its reach zero, the spyes of the Royal Crown will walk up to you, and
you end up in prison....

+++++++++

<b>Purple steam future plans: </b>
As this list is long enough, to code it,
the rank: commander, and admiral, will be a NEXT idea, I dont even think about it.
Also the possibilities of intrique, and social life with other navy personnel, great quests, sea battles...
lol, they are all purple, yes... <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

It would be a fine idea also, that instead of inspect, you can be a guest in true royal navy ships, and take the two sides of the little desk in "crews cabin" deck, with the ships captain , and play card, (alot more cash, and experience, that cap's have) get information, sell contraband to eachother, (your loyalty will suffer ^^) or make nice comments about weather, so, if he has more fame than you, you will get a little more fame, and loyalty...

huh, this is the least incredible idea, compared to the other future plans.

If you have any questions, please, let me know.
This feature doesnt affect standard gameplay mutch, only it adds an enlisting office, advance the time with 5-6 years at start if you join, and you can walk forts freely, after that, there are you going to get your missions.

++++++++++

<b>Royal Navy Career mod v0.1 plans:</b>
As a test, first im going to leave out the midshipman, and lieutenant ranks, and put the enlisting office there, where you presented with a new ship, able to select from captain models, and you going to have captains rank.
yet all of your officers going to change model to navy lieutenants, midshipman, marine officer, only your doctor isnt.

<b>next goal</b> is to implement the function, where you can select from officers who will want to sign to your ship.
 
<b>Progress:</b>

Managed to implement my plans into a separate c file (my regular DanielWolf.c), as a JoinTheNavy() function.
Now it does little, when executed.

Do a Random, and chooses a name from 10 avaliable names, and put a "HMS" tag before them, and gives a Brig rigged, English navy color painted sloop-of-war to replace the player's ship, with crew, and provisions.
It works yet ^^

Now Im working on the next step, to change the player's officers model to accurate navy-or-marine models.
(tough, and boatswain receives marine, gunner receives a looks-like english NAVY gunner crew model, others receive NAVY LT., or midshipman models, except doctor, who remains the same.)
 
It sounds very difficult but also very interesting. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" /> The only thing I don't like is the fact that the crew will be mutinies upon you if you leave Port Royal, I think it would be to boring if you have to stay at one island.
 
As I wrote, that period, when you are a lieutenant will be 4-5 or if you choose the better ship, 6-7 missions at all.

1 hour gameplay, to promote yourself to a captain. For total freedom.

<b>v0.1 progress:</b>

Now in execution of the function, you get a HMS random name navy ship, a brig rigged sloop.

Also all your passengers change models,
related to their role.
Boatswain are: marine officer, tough: marine soldier,
navigator, first mate: is navy lieutenant,
gunner, and quartermaster is: navy midshipman,
doctor: choose from doctor models,
carpenter: choose from carpenter looking models.
All choose from a variety of random models, and NO same looking officers at the end.

This is only a basic test mode, later you will going to get new officers.-

<b>Whats next:</b>

Yet I need to change the portraits also.. Thats a little problem.
And need to find a way, to add a new house, with a sitting navy lieutenant, and two marine soldiers, who can do the enlisting.

Can someone tell me, that is there a way, to make an unused door in Port Royal to an active one, to transfer into a smaller-type shipyard room? I need that interior for my navy enlister. Also ive appreciate, if someone can tell me, where can I find the LAST dialog number? I cant find which the last one, to name mine to be the next ^^
 
That sounds like a very good idea and certainly something I would like to see in the game. A couple of random comments/suggestions:

- The "Inspect ship" feature sounds very much like the "Call other ship in sailing mode" mod that I have wanted for a long time (<a href="http://forum.piratesahoy.net//index.php?s=&showtopic=12701&view=findpost&p=306088" target="_blank">even since before the release of Build 13</a>). Personally I think it should be an ability though that also non-navy character should be able to get. I always imagined it as an instant-boarding for friendly ships that, through dialog, would allow you to interact with the other ship's captain and, for example, trade cargoes or rumours and you might hear of changing nation relations this way too. Then when you have joined the navy, you will also get the authority to ask the other ship's captain for his papers as you propose.

- I don't much like the idea of losing what you have when you decide to join the navy and then end up way on the bottom again. Of course the idea of starting as midshipman does sound very good, but why not add that part as a storyline instead? So you could script the early part of the storyline and then open things up for free play once you make the captain rank.

- It'd be nice if you could join the navy in any storyline and as any character you could play and would then immediately end up in the free-play captain rank (to prevent you from losing everything you had). It's unfortunate that our game is being so England-centred; I would love to have the same functionalities for the other navies as well. Basically the same idea as the LoM only a <i>lot</i> more elaborate and interesting.

- An idea I had was to have governor sink-the-enemy kind of quests in the navy, but with more kinds of random quests added too for more variation. Also it'd be nice to get a more elaborate scripted quest every now and then too, just to break away from the randomness every now and then. Random quests get boring after a while, because they all start feeling the same. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />

- What if you would make your mod join in with the Hornblower quest? You could take the Hornblower quest opening and expand upon that as per your suggestions. Then once you reach the rank of captain, it'll be free play and you wouldn't need to code the rest of the quest either.

The above are random comments only and feel free to make use of whatever parts of them you like and ignore the rest. <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
Be sure to check up with Short Jack Gold! He also had some ideas on a similar kind of mod.

<!--quoteo(post=306294:date=Mar 12 2009, 04:48 PM:name=Captain 'Dan the Lunatic Wol)--><div class='quotetop'>QUOTE (Captain 'Dan the Lunatic Wol @ Mar 12 2009, 04:48 PM) <a href="index.php?act=findpost&pid=306294"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->And need to find a way, to add a new house, with a sitting navy lieutenant, and two marine soldiers, who can do the enlisting. Can someone tell me, that is there a way, to make an unused door in Port Royal to an active one, to transfer into a smaller-type shipyard room? I need that interior for my navy enlister.<!--QuoteEnd--></div><!--QuoteEEnd-->That's not hard at all. You just need to add a location init entry for that room and use one of the unused locators to point to it. <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />
 
I have only very short time, XD as I need to get a shower, and run for my ..eh... Female voice actor ^^ to the station, but:

Having another ship, as a navy captain, and not just untikl you turn it into a prize, will ruin the navy-like restrictions for my wiev. But then I only publish the mod, when comandeer is avaliable, in what rank you can build your fleet.

Also, maybe a bad idea to force the palyer to store his valuables at loanshark, so, ok, leave him have it ^^

back in a few days, still thinking until that
 
Actually, you can do the get-other-ship thing as far as I'm concerned. We do something similar at points in the Jack Sparrow quest too, where you involuntary get a new ship assigned to you.
But I do think it'd be best to have the earlier ranks you describe as part of a storyline (possibly joined in with the Hornblower one) and not force players to start our straight from scratch but jump in right at captain if they were already playing for quite a while in the same game. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
<!--quoteo(post=306312:date=Mar 12 2009, 11:53 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Mar 12 2009, 11:53 AM) <a href="index.php?act=findpost&pid=306312"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- The "Inspect ship" feature sounds very much like the "Call other ship in sailing mode" mod that I have wanted for a long time (<a href="http://forum.piratesahoy.net//index.php?s=&showtopic=12701&view=findpost&p=306088" target="_blank">even since before the release of Build 13</a>). Personally I think it should be an ability though that also non-navy character should be able to get. <b>I always imagined it as an instant-boarding for friendly ships that, through dialog, would allow you to interact with the other ship's captain and, for example, trade cargoes or rumours and you might hear of changing nation relations this way too</b>. Then when you have joined the navy, you will also get the authority to ask the other ship's captain for his papers as you propose.<!--QuoteEnd--></div><!--QuoteEEnd-->

That ability now exists in CoAS, Pieter. When you 'hail' another ship, instead of just getting the dialogs you see in PotC and AoP, you actually take a cutter to the ship you have hailed and interact with her crew on board her own deck. Its actually pretty damned cool and I'm quite positive it is something that CAN be done since it definitely has been.

<!--quoteo(post=306312:date=Mar 12 2009, 11:53 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Mar 12 2009, 11:53 AM) <a href="index.php?act=findpost&pid=306312"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- I don't much like the idea of losing what you have when you decide to join the navy and then end up way on the bottom again. Of course the idea of starting as midshipman does sound very good, but why not add that part as a storyline instead? So you could script the early part of the storyline and then open things up for free play once you make the captain rank.

- It'd be nice if you could join the navy in any storyline and as any character you could play and would then immediately end up in the free-play captain rank (to prevent you from losing everything you had). It's unfortunate that our game is being so England-centred; I would love to have the same functionalities for the other navies as well. Basically the same idea as the LoM only a <i>lot</i> more elaborate and interesting.

- An idea I had was to have governor sink-the-enemy kind of quests in the navy, but with more kinds of random quests added too for more variation. Also it'd be nice to get a more elaborate scripted quest every now and then too, just to break away from the randomness every now and then. Random quests get boring after a while, because they all start feeling the same. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->

I also agree with you on each of these ideas, Pieter.

<!--quoteo(post=306312:date=Mar 12 2009, 11:53 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Mar 12 2009, 11:53 AM) <a href="index.php?act=findpost&pid=306312"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- What if you would make your mod join in with the Hornblower quest? You could take the Hornblower quest opening and expand upon that as per your suggestions. Then once you reach the rank of captain, it'll be free play and you wouldn't need to code the rest of the quest either.<!--QuoteEnd--></div><!--QuoteEEnd-->

I think there would be room for both Dan's initial idea as well as using a modified version of this for the Hornblower series. Though I think that would throw off Horatio's initial career compared to the canon version of his story.

Overall some wonderful ideas you have there, Dan. I'm really looking forward to you getting this stuff implemented.

Cap'n Drow
 
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->When you 'hail' another ship, instead of just getting the dialogs you see in PotC and AoP, you actually take a cutter to the ship you have hailed and interact with her crew on board her own deck. Its actually pretty damned cool and I'm quite positive it is something that CAN be done since it definitely has been.<!--QuoteEnd--></div><!--QuoteEEnd-->
Oh, man, I'd LOVE the ability to launch a boat. It would make it a lot easier to pick up crew and cargo from ship that's sunk when you're sailing something that's not very nimble. There have been many times when I wish I could launch a boat to take over a surrendered ship, usually when I'm dismasted or nearly so.

Hook
 
Well, sadly you don't actual launch a boat. It should be possible, but would need to be coded as some kind of ship exchange. I'm thinking it would require a set of dialogs attached to one of the cutters located on a ships deck model. The dialog would probably have to choose an officer to captain the Ship first, and then be put out to sea with his new boat. Hardest part I believe would be the switch back to your ship from the boat and removing the boat as a vessel at that point. I think its an interesting idea and with enough thought I'm sure it could be done.

In the example I gave above, the ability to 'boat' over to the other ships is just a fast move command that is available. Basically from your ship, you can choose a command from the menu set that is an image of a ships boat. You then select the ship you will communicate just like the fast command in PotC/AoP to speak with a ship. Only instead of menus, you actually port to that ships deck, where you can speak with the crew and captain as if you were in a town.

Hope that better explains what I am talking about, but I do like your idea of having an actual usable launch.

Cap'n Drow
 
<!--quoteo(post=306409:date=Mar 13 2009, 12:00 AM:name=Cap'n_Drow)--><div class='quotetop'>QUOTE (Cap'n_Drow @ Mar 13 2009, 12:00 AM) <a href="index.php?act=findpost&pid=306409"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That ability now exists in CoAS, Pieter. When you 'hail' another ship, instead of just getting the dialogs you see in PotC and AoP, you actually take a cutter to the ship you have hailed and interact with her crew on board her own deck. Its actually pretty damned cool and I'm quite positive it is something that CAN be done since it definitely has been.<!--QuoteEnd--></div><!--QuoteEEnd-->I am absolutely convinced it can be done in PotC also. All you'd need to do is combine the "Instant Boarding" ability with the "Talk to the captain" mod and you'd already be there. Most of the code is already there; we'd just need to add the link. Only I don't know how that should be done code-wise. But it <i>can</i> be done.

<!--quoteo(post=306409:date=Mar 13 2009, 12:00 AM:name=Cap'n_Drow)--><div class='quotetop'>QUOTE (Cap'n_Drow @ Mar 13 2009, 12:00 AM) <a href="index.php?act=findpost&pid=306409"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think there would be room for both Dan's initial idea as well as using a modified version of this for the Hornblower series. Though I think that would throw off Horatio's initial career compared to the canon version of his story.<!--QuoteEnd--></div><!--QuoteEEnd-->The book versions of the stories differ from the movie versions anyway. And what we currently have as the opening of the Hornblower quest also differs from the books and movie versions quite a bit.

Actually, I think that with those adjustments of Captain 'Dan the Lunatic Wolf's added to the Hornblower quest, it would actually be <i>more</i> true to the books and movie versions than what we have now. After all, in the canon stories, Hornblower also starts out with handling the fellow midshipmen (*ugh*Jack Simpson*ugh*) and crew first, then handling some small ships, sitting the examination for Lieutenant, etc.

<!--quoteo(post=306425:date=Mar 13 2009, 03:11 AM:name=Hook)--><div class='quotetop'>QUOTE (Hook @ Mar 13 2009, 03:11 AM) <a href="index.php?act=findpost&pid=306425"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Oh, man, I'd LOVE the ability to launch a boat. It would make it a lot easier to pick up crew and cargo from ship that's sunk when you're sailing something that's not very nimble. There have been many times when I wish I could launch a boat to take over a surrendered ship, usually when I'm dismasted or nearly so.<!--QuoteEnd--></div><!--QuoteEEnd-->That would be pretty cool too. We could use Petros' "Jolly Mon" dinghy for that. Is it possible to place ships at sea <i>while</i> in 3D sailing mode? Removing again shouldn't be that much of a problem; if actual removing can't be done, just make it a quick <i>sink</i>. Ship transfer is also possible.

I see a problem if you have four ships in your squadron though. Unless when you launch your boat, the whole squadron is temporarily assigned to somebody else and then you can use some "board surrendered ship"-like code to get it back.

Again, I think something should be possible, but I can't code it. <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
 
I would appreciate a little help. I need to create new characters in runtime-
As I need to totally fill the player's officer crew, when he enters the navy, and, as a later step, make aquitances, who stand in the fort for him to change his current officers.

These characters are randomly rolled, by strict roles, and the function which creates them is almost complete.

Though Im lost in the process, to add them into the game...
I tried it like Rys Bloom is: first made an obj, then a ref of it, copied Rys's data, and as the last step,
Ive made run the:

AddGameCharacter(unknownnumber, ch);

function. After that, when I try to reach the new character, Im running into the problem, that the game cannot find the character. Its not a miracle, as I dont know, what number is shall use as the -unknownnumber- ...

As if I use TOTAL_CHARACTERS there, and I add 1 more number, makes a CTD, which reads in the error log as: invalid index 1751 [size:1750]
And I dont know how to reach an avaliable number here.. Please, help if someone can ^^

Edited:

Do I think right, if I put a proper file in character/init folder, like in NK's file, in a SOMENAME.c as a void CreateSOMENAMECharacters(ref n) function, it going to put my "pre-characters" into game, so I can reroll them all the time ingame? (as they going to have their respective ID then)
 
I'm not entirely sure I'm following you. You can add pre-defined characters in the game through the init files.

Possibly the following code might also be useful:
ch = CreateOfficer_Cheat(OFFIC_TYPE_NAVIGATOR, "Dan_TG3", 0, PERSONAL_NATION, false);
SetOfficersIndex(pchar, -1, GetCharacterIndex(ch.id));
Check console.c for more officer "cheats".

You can also add random characters like the Enc_walkers walking around the towns.
You can use the same code for the navy officers and assign them a different dialog file allowing you to hire them, based on the current location.
Search for "navy" in file PROGRAM\LandEncounters\LEnc_monsters.c
 
Thanks! Im looking for a way like the init files, to pre-define 14 dummy characters.
7 that can be added as passengers, (one for each role) and 7, who will always rerolled, and renamed, in each fort visit, til one of them is applied by the player. Of course, if someone got fired, hes reduced into rerollable dummy character again.

Im going to play with that way I think, but the other options also very interesting.
I managed to code a function, which turn your current officers models to match their role in the navy, (they also join ^^) and fill the other "empty" roles with new, navy officers.- (as a man-o-war needs a full officer roster always ^^)

(took a whole day to find out, how to succesfully pass a string array to a function as parameter... <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> )

Just need to make those data into breathing, live, officers <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

Thanks, as always, Pieter! <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I continue coding

<img src="style_emoticons/<#EMO_DIR#>/keith.gif" style="vertical-align:middle" emoid=":keith" border="0" alt="keith.gif" />
 
Still no luck with init file character adding.

Im added my file into the characters/init folder, with the proper name, and function inside,
(DanielWolf.c, function called: void CreateDanielWolfCharacters(ref n) )
and added a line into characters_init.c also,

right after NK's line:
n = CreateGameCharacters(n, "DanielWolf"); ReloadProgressUpdate();

But no luck at all. No error msg, so maybe my chars added into the game, but when my function executed ingame, the getCharacterIndex("wolfchar1") still returns a -1 value... And makes an error log, and locks up the function. (not the game)
So somehow the ID isnt recognised. What could I do?

Everything seems just like in the NK.c file in init folder, but my chars couldnt find by ID at all.

Im sure im missing something. But what?
This is the way I want to add new chars, as it only affects game files by small lines, all other is done inside my own files, and wont interfere with other mods. How can I add my own chaarcter init file? I copied what I can, but yet It seems somehow my chars isnt ingame. But no error msg until I dont find them by ID....
 
Estharos recently added a new character init file for DockyardOwners; it should be in Alpha 9 Light.
All he did was put the shipyard owners in their own file and add the required line to characters_init.c. Seems to work fine.
I don't quite understand why it would work for you. Could you upload both files you modified?
I'll have a look at it and see if I can figure it out. <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
 
<!--quoteo(post=307143:date=Mar 17 2009, 08:51 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Mar 17 2009, 08:51 AM) <a href="index.php?act=findpost&pid=307143"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Estharos recently added a new character init file for DockyardOwners; it should be in Alpha 9 Light.
All he did was put the shipyard owners in their own file and add the required line to characters_init.c. Seems to work fine.
I don't quite understand why it would work for you. Could you upload both files you modified?
I'll have a look at it and see if I can figure it out. <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->

Sure.


View attachment DanielWolf.c for the init folder,
View attachment characters_init.c with the initialising line,

View attachment DanielWolffunctions.c my functions. JoinTheNavy is executed via the console yet.

The problem is here in the functions file: (the JoinTheNavy function executes this also in the last phase)

ref MakeNavyOfficer(int lvl, string role)
{

int i;
string name = "wolfchar1";
string name2;

for(i = 1; i < 14 ; i++)
{
name2 = "wolfchar"+i; //name + i;
if(characters[getCharacterIndex(name2)].name == "reserve")
{ name = name2; break; }


}
Log_SetStringToLog(TranslateString("","Reserve: "+getCharacterIndex(name)));
}

As it cant find the character via ID, it returns -1. So, the getCharacterIndex causes the error, as it wont find at least one of my "free dummy" chars by ID at all.
 
I can't quickly spot a problem, but why don't you add some trace lines in the DanielWolf.c file to check if it's being executed at all?
 
<img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> because I have experience only with C++ and C#, and I dont know what is that <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

But I start to like how POTC works.
Can you tell me about trace?
 
Instruction <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->trace("Some text");<!--c2--></div><!--ec2--> will print text <i>Some text</i> to file compile.log in main PotC folder when log files are enabled. It's very useful for debugging code.

The problem with impossibility of finding characters by ids can be caused because of exceeding amounts of characters allocated by program in <i>characters</i> table. Check also error.log file, if it's produced.

pirate_kk
 
Back
Top