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

POTC! Character Creation!!!

Estharos

Landlubber
Storm Modder
I build a script to create an officer to a designated place, the character is spawning at the right place, he got the equipment I give him and can talk to him np, the problem is that I want the character to be a certain rank and not a random. Everytime I recruit him he is never at the same rank and on top of that I can't change is skills or ability. I'm gonna put the script here so if you guys can help, I will really appreciated.


<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void ProcessDialogEvent()
{
    ref NPChar, PChar, d;
    PChar = GetMainCharacter();
    aref Link, Diag;
    string NPC_Meeting;
        
    DeleteAttribute(&Dialog,"Links");

    makeref(NPChar,CharacterRef);
    makearef(Link, Dialog.Links);
    makeref(d, Dialog);
    makearef(Diag, NPChar.Dialog);

    string iDay, iMonth;
    iDay = environment.date.day;
    iMonth = environment.date.month;
    string lastspeak_date = iday + " " + iMonth;

    switch(Dialog.CurrentNode)
    {
        case "First time":
            Dialog.defAni = "dialog_stay1";
            Dialog.defCam = "1";
            Dialog.defSnd = "dialogs\0\017";
            Dialog.defLinkAni = "dialog_1";
            Dialog.defLinkCam = "1";
            Dialog.defLinkSnd = "dialogs\woman\024";
            Dialog.ani = "dialog_stay2";
            Dialog.cam = "1";
            Dialog.snd = "dialogs\0\009";
            
            d.Text = DLG_TEXT[0] + PChar.name;
            Link.l1 = DLG_TEXT[1]
            Link.l1.go = "continue";
        break;
            
        case "continue":
            d.Text = DLG_TEXT[2];
            Link.l1 = DLG_TEXT[3];
            Link.l1.go = "continue2";
        break;
        
        case "continue2":
            d.Text = DLG_TEXT[4];
            Link.l1 = DLG_TEXT[5];
            Link.l1.go = "ShowSkills";
        break;
        
        case "ShowSkills":
            PChar.CharacterInterface_ViewEncOfficer = true;            
            Diag.CurrentNode = "ReturnfromSkillview";
            NPChar.quest.meeting = NPC_Meeting;
            Pchar.Quest.Last_Enc_Officer = NPChar.Index;

            if (NPChar.chr_ai.type == "sit")    
            {
                DumpAttributes(NPChar);
                DeleteAttribute(NPChar, "chr_ai.type");        
                NPChar.chr_ai.type = "sit";                    
            }
  
            DialogExit();            
                
            LaunchOfficer(NPChar);
        break;

        case "ReturnfromSkillview":
            d.Text = DLG_Text[6];
            Link.l1 = DLG_TEXT[7];
            Link.l1.go = "price";
        break;
            
        case "price":
            d.Text = DLG_TEXT[8];
            Link.l1 = DLG_TEXT[9];
            Link.l1.go = "hire";
        break;
        
        case "hire":
            d.Text = DLG_TEXT[10]
            Link.l1 = DLG_TEXT[11];
            DialogExit();
            NPChar.offgen = true;
            NPChar.officer = true;
            LAi_Create_Officer(rand(0), &NPChar);
            LAi_SetPlayerType(Pchar);
            SetOfficersIndex(Pchar, 3, GetCharacterIndex("Horatio Hornblower"));    
            LAi_SetOfficerType(characterFromID("Horatio Hornblower"));
            characters[GetCharacterIndex("Horatio Hornblower")].Dialog.Filename = "Enc_Officer_dialog.c";
            characters[GetCharacterIndex("Horatio Hornblower")].Dialog.CurrentNode = "Hired";     
            
        break;
        
        case "exit":
            Diag.CurrentNode = Diag.TempNode;
            NPChar.quest.meeting = NPC_Meeting;
            DialogExit();
        break;
        
    }
}<!--c2--></div><!--ec2-->

One other thing to is that sometime when I enter the tavern the character will disappear if I exit without recruiting him is it possible to tell him to stay still until he get recruited??
 
Alright I think I see what is my problem, when I talk to him and he show me his skills he is at rank 1, so np there but when the recruit is finish, they give him another rank at random. So the script tell the game to recreate the stats of the character so what I need to do is to tell the game to keep the character as it is after the recruitment. Is there a character in the game that work that way, he keeps always is rank. I could use him as a blueprint.
 
Artois Voysey? Fred Bob? There should be plenty. Check the Officer.c init file.
The character should remain in the tavern unless there is some code somewhere to remove him afterward.
 
<!--quoteo(post=234652:date=Jan 31 2008, 03:57 AM:name=Estharos)--><div class='quotetop'>QUOTE (Estharos @ Jan 31 2008, 03:57 AM) <a href="index.php?act=findpost&pid=234652"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I build a script to create an officer to a designated place, the character is spawning at the right place, he got the equipment I give him and can talk to him np, the problem is that I want the character to be a certain rank and not a random. Everytime I recruit him he is never at the same rank and on top of that I can't change is skills or ability....<!--QuoteEnd--></div><!--QuoteEEnd-->

It is really impressive, considering the short periode of time, that your progress has already brought you to "tunning" now.

Since everything you expect from your character is pretty well formulated, I can only side with Pieter in pointing out that you have to make a decision regarding the choice of coding pattern, by studying the different cases in the game like Artois Voisey, Fred Bob, etc.

You do actually have several options, if you look at the differences between the cases you encounter.

If I understand your requirements correctly, you want your character to maintain the design assigned to him.

Then I would suggest you look into two matters:
A. What makes an officer, a certain type?
B. Recruiting by story

A. An officer of a certain type has developed the speciffic abilities in a certain cathegory.

These abilities are coded as "perks"
Search and See the list of perks that can be atributed to a speciffic character.

The same way you have defined your characters inventory you will then define that abilities which qualify your charcter as a certain officer type:
Examples:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->ch.skill.Defence = "1"; // This is a quote from the obvious skill list attached to any character "1->10"
ch.perks.list.ShipDefenseProfessional = true; // This is the necessary addition  if you also want to assign him the ability
  
ch.skill.Sailing = "8"; // This would be a good skill level for a navigator
ch.perks.list.ShipSpeedUp = true; // But this is how you assign Ship speed increase ability
ch.perks.list.StormProfessional = true; // and this is how you assign the Storm Helmsman ability<!--c2--></div><!--ec2-->

Your character will be then defined by you from the very start and you will not have to leave anything to the random assignment, which is intended to add variation to the encounters, but is obviously not suitable to meeting your demands for Horatio.

So build up you character accordingly:

Example:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    ch.rank = 5;
    ch.reputation = "60";
    TakeNItems(ch,"potion1", Rand(4)+1); // and a so on
    ch.experience = CalculateExperienceFromRank(5)+ (CalculateExperienceFromRank(5)/10 + rand(5000));
    ch.skill.Leadership = "3";
    ch.skill.Fencing = "9";
    ch.skill.Sailing = "10";
    ch.skill.Accuracy = "1";
    ch.skill.Cannons = "1";
    ch.skill.Grappling = "6";
    ch.skill.Repair = "6";
    ch.skill.Defence = "6";
    ch.skill.Commerce = "3";
    ch.skill.Sneak = "5";
    ch.money = "500";
    ch.perks.list.BasicDefense = true;
    ch.perks.list.AdvancedDefense = true;
    ch.perks.list.SwordplayProfessional = true;
    ch.perks.list.CriticalHit = true;
    ch.perks.list.Gunman = true;
    ch.perks.list.ShipSpeedUp = true;
    ch.perks.list.StormProfessional = true;
                // and so on<!--c2--></div><!--ec2-->

When you are done with the definition of the character entirely to your liking, then I would suggest you look into:
B. Recruiting by story

Pieter has already provided with the most meanigfull examples where you can learn most in terms of coding.
These are elaborate stories of the most simple case in the game which is "Rys Bloom". (so simple that this character went through the moding process without even the adjustments that obviously are necessary - when skill start is "0" you can not improve on that skill as the character is getting more experience, and this should have been corrected).

You will find Rys in PROGRAM\Characters\init\Officers.c

You can see it hired through one single case on PROGRAM\QUESTS\quests_reaction.c
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "rys_becomes_officer":
            AddMoneyToCharacter(pchar, -500);
            AddPassenger(Pchar, characterFromID("Rys Bloom"), 0);
            LAi_SetOfficerType(characterFromID("Rys Bloom"));
            characters[getCharacterIndex("Rys bloom")].location = "none";
            characters[GetCharacterIndex("Rys Bloom")].Dialog.Filename = "Enc_Officer_dialog.c"; // KK
            characters[GetCharacterIndex("Rys Bloom")].Dialog.CurrentNode = "Hired"; // KK
break;<!--c2--></div><!--ec2-->

He has a very simple story dialogue, which can easily be re-wrotten to suit your purposes, if you chose this pattern for adding your character to the game.

Your decision, Sir!
 
Good thought on Rys Bloom! That one's a really good and simple example. Much more so than Artois Voysey.

<!--quoteo(post=234894:date=Feb 1 2008, 01:46 PM:name=Julian)--><div class='quotetop'>QUOTE (Julian @ Feb 1 2008, 01:46 PM) <a href="index.php?act=findpost&pid=234894"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->A. What makes an officer, a certain type?<!--QuoteEnd--></div><!--QuoteEEnd-->Officer type consists of two things:
1) The actual skills and abilities he has (explained by Julian above)
2) The officer type name showing up in the interfaces. Characters without type show up as "Comrade-in-Arms". To set something else, you must do this with a line like <i>ch.quest.officertype = OFFIC_TYPE_BOATSWAIN;</i>. Also you can set a salary for him with <i>ch.quest.officerprice = "500";</i>.

<!--quoteo(post=234894:date=Feb 1 2008, 01:46 PM:name=Julian)--><div class='quotetop'>QUOTE (Julian @ Feb 1 2008, 01:46 PM) <a href="index.php?act=findpost&pid=234894"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->so simple that this character went through the moding process without even the adjustments that obviously are necessary - when skill start is "0" you can not improve on that skill as the character is getting more experience, and this should have been corrected<!--QuoteEnd--></div><!--QuoteEEnd-->From PROGRAM\InternalSettings.h:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#define ENABLE_SKILLUP_IFZERO            0         // BOOL - If a character has 0 for a skill, you can increase it anyway, 1=allow, 0=not<!--c2--></div><!--ec2-->
 
By the way!

Am I mistaking or do I remember somebody - in another forum thread a while ago - mentioning that Rys was supposed to undergo some re-freshening under any circumstance... skin being too common, addition to the player in terms of abilities being too weak, utilization being restricted because of the initial "0" skills and so on?
 
i think he's allright as he is. though i'm pretty bothered about the 0 skills. those could do with some improving. the skin's okay. he's an ordinary sailor, after all. there aren't much of those that join your crew.
 
Sure Rys is all right... as well as Mark Blaque on the other side of the gate using the same skin and so on, but considering the addition of options in the time between the stock game and now, a bit of polish could hardly be regarded as a set-back.
I am just thinking by comparison to Fred Bob, who comes with a very similar encounter only the city being different... leave the letter quest aside.
 
i forgot about marc. maybe i different version of the sailor's outfit is required.

i HAD noticed the fred bob thing. in fact, a lot of dialogue is exactly the same, with the only difference of his accent being added.
 
Allthough I wouldn't mind meeting Estharos' Horatio ... banned because of that duel, in which the very agreement to participate was an enterprise forbidden by the standing orders ...

For the sake of the realism in the game however, I agree with you Morgan!
Rys should be kept simple.
Maybe a little less common, weak and uninteresting though.

... I still don't remember where I had been reading that topic about it. Could have been some build 14 brainstorming or WIP. I don't recall the exact issue either.
 
I think we need to pretty much redo all character model assignments. Quest characters should be given more interesting character models, because most of them still use the uninteresting stock game ones, which the interesting new models just walk around at random. Also I HATE - HATE - HATE some of the characters who are supposed to be captains of randomly generated ships. Some of them look like ordinary sailors, for Christ's sake!
 
<!--quoteo(post=234958:date=Feb 1 2008, 09:52 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Feb 1 2008, 09:52 AM) <a href="index.php?act=findpost&pid=234958"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think we need to pretty much redo all character model assignments. Quest characters should be given more interesting character models, because most of them still use the uninteresting stock game ones, which the interesting new models just walk around at random. Also I HATE - HATE - HATE some of the characters who are supposed to be captains of randomly generated ships. Some of them look like ordinary sailors, for Christ's sake!<!--QuoteEnd--></div><!--QuoteEEnd-->

How about the guys who look like Governors but who turn out to be beggars.

As for special characters, remember Cat and I were about changing main story characters with our own unique versions.
We managed to change Raoul Rheims, Nigel Blythe, Artois Voysey, Isenbrandt Jurcksen, Jordano, and Claire Larrouse who even got a sex change!
 
<!--quoteo(post=235021:date=Feb 1 2008, 06:18 PM:name=Petros)--><div class='quotetop'>QUOTE (Petros @ Feb 1 2008, 06:18 PM) <a href="index.php?act=findpost&pid=235021"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->How about the guys who look like Governors but who turn out to be beggars.<!--QuoteEnd--></div><!--QuoteEEnd-->Yeah, that's really annoying as well. I know why that happens: The model assignment is random and so is the dialog text. All random citizens are generated with the Enc_Walker dialog file. There is no model check at all. So we'd have to add something for that. Either add a model check for certain dialog cases in the dialog or give different model groups a different dialog file. Should be possible, but does require some work.

<!--quoteo(post=235021:date=Feb 1 2008, 06:18 PM:name=Petros)--><div class='quotetop'>QUOTE (Petros @ Feb 1 2008, 06:18 PM) <a href="index.php?act=findpost&pid=235021"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->As for special characters, remember Cat and I were about changing main story characters with out own unique versions.
We managed to change Raoul Rheims, Nigel Blythe, Artois Voysey, Isenbrandt Jurcksen, Jordano, and Claire Larrouse who even got a sex change!<!--QuoteEnd--></div><!--QuoteEEnd-->That's exactly what I like. We should continue replacing characters though. We have got a bunch of really cool unused character skins that we could use, so let's use them. Also I would be inclined to replaced almost ALL quest character models to custom ones made by forum members and have the stock game generic characters used for random characters instead.
 
i'd be for that. who would be the most important quest characters that need changing first and foremost? maybe i'll come up with some ideas.
 
Now I remember that to differentiate, between Rys Bloom and Mark Blaque, we gave Mark Blaque Cat's sailor7 skin.

Then it turned out that it made him look too French to blend in at Redmond, so we went back to the original skin.
 
well, it would be far easier to spot him. i only knew where he was because i met him in the stock game once.
 
Yep, he was changed back to "Chameleon" and so now again looks just like Rys Bloom.
 
What if we just did some MINOR changes to the chameleon? So that he IS different from Rys Bloom, but not that much that you can take him out of the crowd that easily. And secondly, I like the idea of one of the members here to replace Rys with Horatio Hornblower.
 
Back
Top