ebmar 893 Posted November 13, 2019 (edited) 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. Edited November 14, 2019 by ebmar Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted November 13, 2019 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. 1 Quote Share this post Link to post Share on other sites
ebmar 893 Posted November 13, 2019 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. And a question follows; where the script should fires? Is it on the relevant node where the <customtoken> takes place? Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted November 13, 2019 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. 1 Quote Share this post Link to post Share on other sites
ebmar 893 Posted November 13, 2019 (edited) 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. 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 November 13, 2019 by ebmar The awesome script does working Quote Share this post Link to post Share on other sites
Salk 368 Posted November 14, 2019 I think the custom token was not necessary. If you look at stringtokens2da there is already him/her as possible option (token 22). 1 Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted November 14, 2019 Ah, well there you go. I probably should have dug a bit deeper. But the proposed approach may still prove useful for other use cases. Quote Share this post Link to post Share on other sites
ebmar 893 Posted November 14, 2019 (edited) 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. 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]. Edited November 14, 2019 by ebmar Using a local token from stringtokens.2da proven to be working 1 Quote Share this post Link to post Share on other sites