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

"Tool" to check Character attributes

CouchcaptainCharles

COO (Chief Oddity Officer)
Storm Modder
Pirate Legend
Lately several people have reported following dialogproblem with Build12: they try to open a dialog but nothing happens (well, not quite nothing: there should be a very short blinking of the charactericon in the lower left corner)

I had that problem recently with one of my own new dialogs, and the cause was a wrong "current dialog node". I assume that the reported problems have a similar cause because if there were a error in filename or codesyntax you would get the "Can't open..." errordialog.

A little bit technical background: dialogfiles are subdivided in "nodes", i.e. a text that the NPC says. These are followed by "links", i.e. the answers that the player can choose, which in turn lead to the next node.

If you leave a dialog the "current node", i.e. the text that the dialog shall start with the next time you talk to this NPC, is being stored as attribute " .dialog.CurrentNode " of this NPC.
(Example: ALL ordinary citizens of Oxbay share one common dialogfile: Oxbay citizen_dialog.c . If you talk to one of them for the first time he uses the node called "First time" to introduce himself. After that the node "meeting" is being stored as .dialog.CurrentNode of this person, so that the next time you talk you wont go through the inroductions in the node "First time" again but start with the questions of the "meeting" node right away)

Now we come to the reported problem: if a FALSE .dialog.CurrentNode has been assigned to a character, one that doesn't match the dialogfile, the program scans the dialogfile in vain for a .dialog.CurrentNode that does not exist. In that case no dialog and no errorreport appears.

The cause for this false nodeassignment can lie either in the dialogfile itself, OR in some questcode that assigned a dialogchange according to some questaction. This may be difficult to find, and it would be very helpful to know which -possibly false- .dialog.CurrentNode attribute a character has. A simple "tool" will tell you that:

If you press "T" in the game a screenmessage will tell you name and stats of the person in front of you. The code for that is in the file programseadogs.c in this line (open the file with notepad and search for the text with F3) :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Log_SetStringToLog("You see " + findCh.name + " " + findCh.lastname + " Fencing " + findCh.skill.Fencing + " HP "+res);<!--c2--></div><!--ec2-->

To get also information about the current node simply insert
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->" node: "+ findCh.dialog.CurrentNode<!--c2--></div><!--ec2-->

BEFORE the last bracket, like this: (or cut and paste the whole line)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Log_SetStringToLog("You see " + findCh.name + " " + findCh.lastname + " Fencing " + findCh.skill.Fencing + " HP "+res + " node: "+ findCh.dialog.CurrentNode);<!--c2--></div><!--ec2-->

Now reload your game, look at the character that won't talk to you and press "T". The displayed nodename will make it much easier for anyone familiar with the quests to find the cause of your problem.

HTH <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" /> Ah, that's great, CCC, THANK YOU! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> (WB, hope you had a nice Christmas!) <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
AND U TELL US THAT NOW!?!?!?!? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mad.gif" style="vertical-align:middle" emoid=":c" border="0" alt="mad.gif" />

ahh serious m8 - great work, think I'll bookmark this thread(DONT REMOVE!)
but if u install build 12 OVER build 11
the problem should be solved aswell... I think...
 
In the latest compilation by Pieter some kind of "attributechecker" is included: this section in programseadogs.c :

// ccc infos
//float mcx,mcy,mcz;
//GetCharacterPos(GetMainCharacter(), &mcx, &mcy, &mcz);
//Log_SetStringToLog("Mypos: " + mcx+" "+mcy+" "+mcz );

int res = LAi_FindNearestVisCharacter(PChar, 20);
ref findCh;
if(res != -1)
{
findCh = GetCharacter(res);
res = findCh.chr_ai.hp;
Log_SetStringToLog("You see " + findCh.name + " " + findCh.lastname + " Fencing " + findCh.skill.Fencing + " HP "+res );
// ccc infos
// Log_SetStringToLog(findCh.equip.blade + " equiped");
//Log_SetStringToLog("res " + pchar.trlocation + "findCh " + pchar.trlocator);
// if(!LAi_group_IsEnemy(Pchar, findCh) ) Log_SetStringToLog("Friend ");

If you uncomment one of the lines below "ccc infos" the mentioned attribute of the NPC in front of you will be displayed if you press "T". To check other attributes just overwrite or copy one of those lines, e.g. if someone doesn't speak to you add

Log_SetStringToLog("node: " + findCh.dialog.CurrentNode);

to check the current dialognode. Very helpful for debugging.
 
Uh? I wasn't even aware of that. I'm sure <b>I</b> didn't add that. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" />
 
Back
Top