Jump to content

Home

[KotOR 2] Influence with Custom Party Members


Recommended Posts

Basically, if I were to add a custom companion, how would I go about making it so that every time the PC gained or lost influence with the companion, it would say the companion's name and that influence was gained or lost? As it stands now, if I call the constant of the NPC the companion replaced, it'll show the replaced companion's name (So if my companion replaces GOTO, it will say GOTO lost influence).

Link to comment
Share on other sites

It's in the dialog.tlk I don't know how to make a completly new pop up but you can just find the line the says GOTO lost influence and then replace it with you NPC. Although that dosent do much good unless making a TC. Might I suggest changing all the refrences so they just say something like: "Party member influence lost".

Link to comment
Share on other sites

It's in the dialog.tlk I don't know how to make a completly new pop up but you can just find the line the says GOTO lost influence and then replace it with you NPC. Although that dosent do much good unless making a TC. Might I suggest changing all the refrences so they just say something like: "Party member influence lost".

 

It is in the dialog.tlk, but it uses a token in place of party member names. So it goes like this: Influence Lost: <CUSTOM0>

Link to comment
Share on other sites

It is in the dialog.tlk, but it uses a token in place of party member names. So it goes like this: Influence Lost: <CUSTOM0>

 

In that case, make an armband that activates this script:

Show spoiler
(hidden content - requires Javascript to show)
void main()
{
   string 1 = "<CUSTOM0>";
   string 2 = "<CUSTOM1>";
   string 3 = "<CUSTOM2>";
   string 4 = "<CUSTOM3>";
   string 5 = "<CUSTOM4>";
   string 6 = "<CUSTOM5>";
   string 7 = "<CUSTOM6>";
   string 8 = "<CUSTOM7>";
   string 9 = "<CUSTOM8>";
   string 10 = "<CUSTOM9>";
   string 11 = "<CUSTOM10>";

   SendMessageToPC(GetFirstPC(), "Party Member is: " + 0);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 1);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 2);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 3);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 4);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 5);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 6);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 7);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 8);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 9);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 10);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 11);
}

 

That will tell you what's what and should give you each of the party members. Then, in the recruit script, you can just add a line to the code like this:

 

Show spoiler
(hidden content - requires Javascript to show)
void main()
{
   SetCustomToken(<token of party member being replaced>, "Name of new Party member");

   Rest of recruit script here...
}

 

We could use custom tokens for an influence system in K1, couldn't we?! Just the tokens and a few .tlk entries...

Link to comment
Share on other sites

*Raises Hand*

 

Since I know now that the devs used custom tokens for the system, I can probably tell you how to script the functions for an influence system, without touching the .exe.

 

Cool, but i dont want to jack Fallen Gaurdian's thread so lets move this over to PM's maybe we can get something started.

Link to comment
Share on other sites

In that case, make an armband that activates this script:

Show spoiler
(hidden content - requires Javascript to show)
void main()
{
   string 1 = "<CUSTOM0>";
   string 2 = "<CUSTOM1>";
   string 3 = "<CUSTOM2>";
   string 4 = "<CUSTOM3>";
   string 5 = "<CUSTOM4>";
   string 6 = "<CUSTOM5>";
   string 7 = "<CUSTOM6>";
   string 8 = "<CUSTOM7>";
   string 9 = "<CUSTOM8>";
   string 10 = "<CUSTOM9>";
   string 11 = "<CUSTOM10>";

   SendMessageToPC(GetFirstPC(), "Party Member is: " + 0);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 1);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 2);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 3);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 4);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 5);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 6);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 7);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 8);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 9);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 10);
   SendMessageToPC(GetFirstPC(), "Party Member is: " + 11);
}

 

That will tell you what's what and should give you each of the party members. Then, in the recruit script, you can just add a line to the code like this:

 

Show spoiler
(hidden content - requires Javascript to show)
void main()
{
   SetCustomToken(<token of party member being replaced>, "Name of new Party member");

   Rest of recruit script here...
}

 

We could use custom tokens for an influence system in K1, couldn't we?! Just the tokens and a few .tlk entries...

 

Thanks I'll try this out and get back to you.

 

Cool, but i dont want to jack Fallen Gaurdian's thread so lets move this over to PM's maybe we can get something started.

 

Hey if you guys do figure something out I'm sure we'd all love to know.

 

EDIT: All right, I tried compiling the script and it spat an error out at me for every single custom token. The error was this: "Syntax error at "integer constant."

 

I tried putting it in Atton's dialog file, to see if the custom tokens could be used within a dialogue, and here's what I got:

 

Show spoiler
(hidden content - requires Javascript to show)
9vdvzm.jpg

 

So <CUSTOM0> and <CUSTOM1> are... apparently 0 and 11. Whereas <CUSTOM3> appears to be the date (though it's five days off) and the amount of hours played, or the current time. And then the next few that don't show up as invalid look to be just random numbers again.

Link to comment
Share on other sites

I hate to say it, but I think you're out of luck. <CUSTOM0> is the correct token and it gets set upon an influence increase or decrease. Try calling an influence script, and then call the token again in a new conversation. The problem is this function is appears to be hard coded in the influence script functions.

 

It's possible that it's getting the name from somewhere else, though. But I know it's not from npc.2da or influence.2da. It could be some other TLK entry; I searched for a few party members and I always saw more than one entry with just the name. So uh... try changing them all? That's really all I can think of. :giveup:

 

As far as using tokens for a new influence system... well, that's not what's going on here. The token is used to display the name of the character whose influence has been adjusted, that's all. You could make a new influence system, theoretically, but I don't think you can do it with tokens; I believe they get reset upon loading a module. That's what all the <UNRECOGNIZED TOKEN> business is about. You'd need some new global variables for that sort of thing.

Link to comment
Share on other sites

I hate to say it, but I think you're out of luck. <CUSTOM0> is the correct token and it gets set upon an influence increase or decrease. Try calling an influence script, and then call the token again in a new conversation. The problem is this function is appears to be hard coded in the influence script functions.

 

All right, that changed <CUSTOM0> to Atton. I then tried changing <CUSTOM0> using the SetCustomToken function, and it didn't change. However, I changed <CUSTOM10> and that change was reflected. It seems odd that I can set <CUSTOM10> but not <CUSTOM0>.

 

It's possible that it's getting the name from somewhere else, though. But I know it's not from npc.2da or influence.2da. It could be some other TLK entry; I searched for a few party members and I always saw more than one entry with just the name. So uh... try changing them all? That's really all I can think of. :giveup:

 

Okay, change everything. Oh jeez. :ohdear:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...