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

Need Help how do i edit the way an npc addresses me based on patent rank

begginfokillz

Sailor Apprentice
Storm Modder
hi. this is a question related to a mod im working on. how do i change the way an npc addresses charles, based on current rank of the equipped patent?

my current code is as follows:

case "Shylock_deluxe_officer":
{
if (isMainCharacterPatented() && sti(Items[sti(pchar.EquipedPatentId)].TitulCur) >= 1)
{
dialog.text = "What do you need, "+pchar.EquipedPatentId.TitulCur+" "+pchar.name+"?";
Link.l1 = "Listen to my order!";
Link.l1.go = "stay_follow";
link.l2 = "Tell me about yourself!";
link.l2.go = "Shylock_deluxe";
link.l3 = "Nothing at the moment. At ease!";
link.l3.go = "exit";
NextDiag.TempNode = "Shylock_deluxe_officer";
}
}
else
{
{
dialog.text = "What do you need, Monsieur "+pchar.name+"?";
Link.l1 = "Listen to my order!";
Link.l1.go = "stay_follow";
link.l2 = "Tell me about yourself!";
link.l2.go = "Shylock_deluxe";
link.l3 = "Nothing at the moment. At ease!";
link.l3.go = "exit";
NextDiag.TempNode = "Shylock_deluxe_officer";
}
}
break;

issue is it works to an extent. aka, with no rank, he replies proper, wityh rank, he said error

any help is much appreciated


EDIT: every time i talk with the guy, this happens:
 

Attachments

  • 20210114164103_1.jpg
    20210114164103_1.jpg
    899.6 KB · Views: 183
  • 20210114164117_1.jpg
    20210114164117_1.jpg
    873.6 KB · Views: 180
  • 20210114164115_1.jpg
    20210114164115_1.jpg
    900.6 KB · Views: 173
  • 20210114164035_1.jpg
    20210114164035_1.jpg
    882.7 KB · Views: 163
Last edited:
No clue but mayby something like this may help you come with a solution:
Code:
void Set_inDialog_Attributes()
{
    ref The_Character_is;

    The_Character_is = GetMainCharacter();
    if (!CheckAttribute(The_Character_is, "sex") || The_Character_is.sex == "man")
    {
        Address_Form.Spa = "senor";
        Address_Form.Fra = "monsieur";
        Address_Form.Eng = "sir";
        Address_Form.Hol = "mynheer";
        Address_Form.Pir = "sir";
    }
    else
    {
        Address_Form.Spa = "senorita";
        Address_Form.Fra = "mademoiselle";
        Address_Form.Eng = "miss";
        Address_Form.Hol = "lady";
        Address_Form.Pir = "miss";
    }
    Address_Form.Spa.Title1 = "Corsair";
    Address_Form.Fra.Title1 = "Privateer";
    Address_Form.Eng.Title1 = "Caper";
    Address_Form.Hol.Title1 = "Filibuster";
    Address_Form.Pir.Title1 = "Pirate";

    Address_Form.Spa.Title2 = "Commander";
    Address_Form.Fra.Title2 = "Commander";
    Address_Form.Eng.Title2 = "Commander";
    Address_Form.Hol.Title2 = "Commander";
    Address_Form.Pir.Title2 = "Commander";
  
    Address_Form.Spa.Title3 = "Captain";
    Address_Form.Fra.Title3 = "Captain";
    Address_Form.Eng.Title3 = "Captain";
    Address_Form.Hol.Title3 = "Captain";
    Address_Form.Pir.Title3 = "Captain";

    Address_Form.Spa.Title4 = "Commodore";
    Address_Form.Fra.Title4 = "Commodore";
    Address_Form.Eng.Title4 = "Commodore";
    Address_Form.Hol.Title4 = "Commodore";
    Address_Form.Pir.Title4 = "Commodore";

    Address_Form.Spa.Title5 = "Admiral";
    Address_Form.Fra.Title5 = "Admiral";
    Address_Form.Eng.Title5 = "Admiral";
    Address_Form.Hol.Title5 = "Admiral";
    Address_Form.Pir.Title5 = "Admiral";

    Address_Form.Spa.woman = "senora";
    Address_Form.Fra.woman = "madame";
    Address_Form.Eng.woman = "missis";
    Address_Form.Hol.woman = "lady";
    Address_Form.Pir.woman = "missis";

    Address_Form.Spa.man = "senor";
    Address_Form.Fra.man = "monsieur";
    Address_Form.Eng.man = "sir";
    Address_Form.Hol.man = "mynheer";
    Address_Form.Pir.man = "sir";
}
or perhaps #include "dialog_func.c"
mayby ur line cant just find the titel

EDIT: this line maigh help:
Code:
GetAddress_FormTitle(sti(Items[sti(pchar.EquipedPatentId)].Nation), sti(Items[sti(pchar.EquipedPatentId)].TitulCur));
with this line ur file shuld make the connection on its own, to find the right title instead ERROR
 
Last edited:
wow, many thanks so far for the help. it is very much appreciated. iencoutnered one issue though. how do i integrate that line into a conversation, in this case, to use a part as an example:

Code:
    //------------------------------------- Address by Rank------------------------------------------
        case "Shylock_deluxe_officer":   
            dialog.text = "What do you need, Monsieur "+GetFullName(pchar)+"?";
            Link.l1 = "Listen to my order!";
            Link.l1.go = "stay_follow";
            link.l2 = "Tell me about yourself!";
            link.l2.go = "Shylock_deluxe";
            link.l3 = "Nothing at the moment. At ease!";
            link.l3.go = "exit";
            NextDiag.TempNode = "Shylock_deluxe_officer";
        break;


in summary, how would i 78integratei t into the top ling, dialog.text to be precise
 
nevermind , i figured it out. for anyone who is curious, it should look like the following when integrated in a conversation in game:

Code:
    //------------------------------------- Address by Rank------------------------------------------
        case "Shylock_deluxe_officer":
        {
        if (isMainCharacterPatented() && sti(Items[sti(pchar.EquipedPatentId)].TitulCur) >= 1)
            {     
                dialog.text = "What do you need, "+GetAddress_FormTitle(sti(Items[sti(pchar.EquipedPatentId)].Nation), sti(Items[sti(pchar.EquipedPatentId)].TitulCur))+" "+GetFullName(pchar)+"?";
                Link.l1 = "Listen to my order!";
                Link.l1.go = "stay_follow";
                link.l2 = "Tell me about yourself!";
                link.l2.go = "Shylock_deluxe";
                link.l3 = "Nothing at the moment. At ease!";
                link.l3.go = "exit";
                NextDiag.TempNode = "Shylock_deluxe_officer";
            }
        }
        else
        {
            {     
                dialog.text = "What do you need, Monsieur "+GetFullName(pchar)+"?";
                Link.l1 = "Listen to my order!";
                Link.l1.go = "stay_follow";
                link.l2 = "Tell me about yourself!";
                link.l2.go = "Shylock_deluxe";
                link.l3 = "Nothing at the moment. At ease!";
                link.l3.go = "exit";
                NextDiag.TempNode = "Shylock_deluxe_officer";
            }
        }
        break;

as you can see, it used a plus sign on each side, in quotes, to get it to work
 

Attachments

  • 20210122233739_1.jpg
    20210122233739_1.jpg
    1.1 MB · Views: 176
indeed. thank you so much trigger. it reallly saved a lot of time messing around trying to figure it out. i owe you big.
 
Back
Top