Recommended Posts

Greetings, fellow Jedi! Hope you all doing fine.

We know there's a thing like <FullName> in the K1's TLK, which makes a conversation/DLG checks the [custom] name of our main character and I wonder; is there a similar function which checks our PC's gender preference? Let's say, if I play as a male character and make a string in the TLK that reads -

I am no longer <XYZ> now.

it would shown as -

I am no longer him now.

in-game. Is it possible to do that in K1? Many thanks for considering this, and may the Force be with you. :cheers:

Edited by ebmar

Share this post


Link to post
Share on other sites

Not by default in K1 I don't believe. However, you could script it using a custom token

	object oPC = GetFirstPC();
	int nSex = GetGender(oPC);
	
	if (nSex == GENDER_FEMALE)
		{
			SetCustomToken(666, "her");
		}
		else
			{
				SetCustomToken(666, "him");
			}

Then your TLK line would be something like

I am no longer <CUSTOM666> now.

I'm not sure what the upper bound of custom tokens is though. You can check k_con_tokens for vanilla ones. Look like they go up to at least 45, so you'd need to be above that.

  • Thanks 1

Share this post


Link to post
Share on other sites
11 minutes ago, DarthParametric said:

Not by default in K1 I don't believe. ...you could script it using a custom token.. Then your TLK line would be something like... You can check k_con_tokens for vanilla ones. Look like they go up to at least 45, so you'd need to be above that.

Thank you for the insight! Much appreciated. It is nice to know that there is a workaround for that, and looked to be very helpful in the long run. :cheers:

And a question follows; where the script should fires? Is it on the relevant node where the <customtoken> takes place?

Share this post


Link to post
Share on other sites

In the same DLG. I'd run it on a prior node though so it is already set beforehand. The logical choice would be whatever the starting node is, or one directly afterwards. Although maybe the tokens are set in the save? The ones in k_con_tokens don't appear to be set every time after all.

  • Like 1

Share this post


Link to post
Share on other sites

Ah! You're right. My logic was broken I thought the Script in the DLG fires soon as it was shown on screen, hahah. Again, thanks - as things are clear now. Much appreciated. :cheers:

Update: Eureka! @DarthParametric. The script works! I set the custom token value to 434, and do a search-and-find to the TLK for same instance. There are none apparently, though I hope there's no undetected LocalString 1 on my end that sneakily uses it, hahah.

Edited by ebmar
The awesome script does working

Share this post


Link to post
Share on other sites
4 hours ago, Salk said:

...the custom token was not necessary. If you look at stringtokens2da there is already him/her as possible option (token 22).

Thank you for the heads-up! Nice and useful information to have there. :cheers:

I will surely take a considerate look on that, and see if I can make it works.

Update: yup! Using local token #22 from stringtokens.2da proven to be working, @Salk.

Therefore, I have this on the TLK string -

I am no longer <him/her> now.

Nice catch on that, and thanks again.

4 hours ago, DarthParametric said:

...the proposed approach may still prove useful for other use cases.

It certainly does. It will prove useful in the long run [of modding journey]. :cheers:

Edited by ebmar
Using a local token from stringtokens.2da proven to be working
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.