Kexikus 994 Posted April 29, 2017 Or you could use TSLPatcher to apply the changes to the .dlg during the installation, thus not overwriting previous changes to the same file. Quote Share this post Link to post Share on other sites
jonathan7 15 Posted April 30, 2017 Cool, thanks for your help guys, think I'll probably go with Kexikus method, as it seems the easier for me. Good to still see you around JC Quote Share this post Link to post Share on other sites
Whyp 23 Posted May 22, 2017 I'm not good at scripting... But how do I trigger a conversation when the PC approaches a certain area? Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted May 22, 2017 I would need to know the context of this "certain area" to be able to help more. Primarily, you'd set up a Trigger in the area's .git file or hijack one that already exists if it's in the right spot. A Trigger is a .utt file that has several events that fire scripts, one of which is an On-enter event that activates whenever something enters the area. In this case, you'd do something like this (all marks are ignored; you want to pay attention to what's between them): void main() { // Get the object that triggered the event object oTarget = GetEnteringObject(); object oTalker = GetObjectByTag("<tag of the object/person initiating the conversation>"); if(oTarget == GetFirstPC()) // If the triggering object is the current player-controlled character { // Have oTalker start a conversation with the PC. The code looks long because we need the last three pieces to make the // game ignore the distance between oTalker and oTarget. Otherwise, the player would move to oTalker first... AssignCommand(oTalker, ActionStartConversation(oTarget, "<name of .dlg file, minus the extension>", FALSE, CONVERSATION_TYPE_CINEMATIC, FALSE)); } } Quote Share this post Link to post Share on other sites
Whyp 23 Posted May 22, 2017 I would need to know the context of this "certain area" to be able to help more. Primarily, you'd set up a Trigger in the area's .git file or hijack one that already exists if it's in the right spot. A Trigger is a .utt file that has several events that fire scripts, one of which is an On-enter event that activates whenever something enters the area. In this case, you'd do something like this (all < > marks are ignored; you want to pay attention to what's between them): void main() { // Get the object that triggered the event object oTarget = GetEnteringObject(); object oTalker = GetObjectByTag("<tag of the object/person initiating the conversation>"); if(oTarget == GetFirstPC()) // If the triggering object is the current player-controlled character { // Have oTalker start a conversation with the PC. The code looks long because we need the last three pieces to make the // game ignore the distance between oTalker and oTarget. Otherwise, the player would move to oTalker first... AssignCommand(oTalker, ActionStartConversation(oTarget, "<name of .dlg file, minus the extension>", FALSE, CONVERSATION_TYPE_CINEMATIC, FALSE)); } } Near both of the entrances of the Nar Shaddaa Landing Pad restored cantina. And if triggers once, that's it. Quote Share this post Link to post Share on other sites
bead-v 251 Posted May 22, 2017 Near both of the entrances of the Nar Shaddaa Landing Pad restored cantina. And if triggers once, that's it. You could also tie the script to the door opening instead, if it's supposed to fire the first time you go there Quote Share this post Link to post Share on other sites
Whyp 23 Posted May 22, 2017 You could also tie the script to the door opening instead, if it's supposed to fire the first time you go there Thanks! I'll keep that in mind. Quote Share this post Link to post Share on other sites
Effix 532 Posted May 31, 2017 I have an item a_robe_47 and I'm trying to trigger my script to add it to the inventory. I tried with OnOpen and OnClosed on a corpse and a container, no luck. I can add the item with the cheats so that part should be fine. void main() { object oItem = GetItemPossessedBy (GetPartyLeader(),"a_robe_47"); if (GetIsObjectValid(oItem)) { int nStackSize = GetItemStackSize(oItem); if (nStackSize < 1) CreateItemOnObject("a_robe_47", GetFirstPC()); } } It includes a check if the object is already owned, but it also doesn't work without that, what am I doing wrong? Quote Share this post Link to post Share on other sites
Kexikus 994 Posted May 31, 2017 The problem in your script is that GetIsObjectValid(oItem) will return FALSE if the player doesn't have the item, thus the CreateItemOnObject is never called. If the player does have the item, then nStackSize < 1 returns FALSE and once again, the CreateItemOnObject is not called. Basically, all you need is a condition if(!(GetIsObjectValid(oItem))). That will return TRUE only if the player doesn't have the item, so it basically does what your second condition does, only that it works^^ 1 Quote Share this post Link to post Share on other sites
Effix 532 Posted May 31, 2017 Ok, cool, I thought GetIsObjectValid was to test if it was an existing object. That's even shorter than I thought was needed. I'll try that, many thanks!Edit: Worked, thanks again.Here's a cool puppet (like Bao-Dur's remote) script by Hangout Hermit:http://z6.invisionfree.com/Mandalorian16965/ar/t61.htmIt never led to a mod but I played around with similar scripts that were included in Cati by Princess Artemis, I gave T3 a protocol droid that followed him Quote Share this post Link to post Share on other sites
Kexikus 994 Posted May 31, 2017 Ok, cool, I thought GetIsObjectValid was to test if it was an existing object. That's even shorter than I thought was needed. I'll try that, many thanks! It is a way to test for an existing object. But it really only checks that specific object and returns TRUE if it exists and FALSE if it doesn't. So checking if the object is NOT valid asks: "Is this item NOT in the player's inventory." 1 Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted June 1, 2017 Thanks for helping Effix out, Kex. I'm not always around, so it's nice that people don't have to wait too long. Quote Share this post Link to post Share on other sites
Reztea 34 Posted June 11, 2017 Oh wow, I haven't needed help in a whole month, yay me. Okay, so I have currently have two booleans " Recruit_Atris_E " (Recruited Evil Atris) " Recruit_Atris_G " (Recruited Good Atris) Here's the script I used to inject the Booleans: void main() { // Once you have done the script, select the boolean to be true. SetGlobalBoolean("RECRUIT_ATRIS_E",TRUE); } void main() { // Once you have done the script, select the boolean to be true. SetGlobalBoolean("RECRUIT_ATRIS_G",TRUE); } Here's where the issue lies, I am currently in a dialog where the party confronts Kreia. I made a separate version of the dialog that should only come available after recruiting Evil Atris. The conditional script I am using to check if the Boolean returned true so the dialog will be used is: int StartingConditional() { int iResult; iResult = ((GetGlobalBoolean( "Recruit_Atris_E" ) == TRUE) ); return iResult; } The conditional script also is not placed on a dialogue option from the PC, but from an NPC entry. Any suggestions? Thanks. Quote Share this post Link to post Share on other sites
Kexikus 994 Posted June 12, 2017 The scripts are fine so we'll need a description of your actual issue to help you out. Quote Share this post Link to post Share on other sites
bead-v 251 Posted June 12, 2017 Try this instead: int StartingConditional() { return GetGlobalBoolean("Recruit_Atris_E"); } Quote Share this post Link to post Share on other sites
Reztea 34 Posted June 12, 2017 Try this instead: int StartingConditional() { return GetGlobalBoolean("Recruit_Atris_E"); } Didn't work unfortunately. Here's the exact problem, I put the conditional script "SeeRecruitE" on this node. I put the conditional script "SeeRecruitG" for good Atris on this node. And I made a copy of the same node for Good Atris' conditional.. in case you don't have Atris at all.. This whole Boolean situation is so tiring, I feel like ripping my head off. Quote Share this post Link to post Share on other sites
bead-v 251 Posted June 12, 2017 I just checked both your posts, it seems like you never mentioned what actually goes wrong, ie. what actually happens with your current setup Anyway, I think I've had trouble in the past with using replies for directing cutscene flow like that, I don't remember the details, but you could try putting the scripts onto entry nodes instead. Quote Share this post Link to post Share on other sites
Reztea 34 Posted June 12, 2017 I just checked both your posts, it seems like you never mentioned what actually goes wrong, ie. what actually happens with your current setup Anyway, I think I've had trouble in the past with using replies for directing cutscene flow like that, I don't remember the details, but you could try putting the scripts onto entry nodes instead. Oh sorry, Well the game chooses the dialog with no conditional, I don't know why! I put both my booleans in the Globalcat file. Row 999 = Recruit_Atris_E Row 1000 = Recruit_Atris_G. I made sure I used the correct set scripts, and conditions! I'm super confused. I'll attempt using entries, Let's hope it works. EDIT: No dice, seems like me and Booleans just aren't friends. Quote Share this post Link to post Share on other sites
bead-v 251 Posted June 12, 2017 Okay, so then we need to make sure the globals are set correctly in the first place.I'm not sure whether the globals are case-sensitive, but they could be, and you're setting them in all caps, while you're getting them with only the first letter of the word capitalized. Try fixing that. Quote Share this post Link to post Share on other sites
Reztea 34 Posted June 12, 2017 Okay, so then we need to make sure the globals are set correctly in the first place. I'm not sure whether the globals are case-sensitive, but they could be, and you're setting them in all caps, while you're getting them with only the first letter of the word capitalized. Try fixing that. Tried it, didn't work... I'm curious though.... Can I use a_global_set, and c_global_set, and use the string parameter??? Let me try that and I'll be back. Edit: That didn't work either. I'm about to scrap this entire project. Quote Share this post Link to post Share on other sites
bead-v 251 Posted June 12, 2017 I think then you need to use a_glob_bool_set or something like that, check it out in kotor tool. When and how do the scripts to set the booleans fire? Maybe the problem is that those scripts never fire. To diagnose, you could include this in your setting scripts, then check your feedback screen after they're supposed to have run. void main(){ SetGlobalBoolean("Recruit_Atris_E", TRUE); string sMessage = "Recruit_Atris_E setting script fired! Current value: "; if(GetGlobalBoolean("Recruit_Atris_E")) sMessage += "TRUE"; else sMessage += "FALSE"; SendMessageToPC(GetFirstPC(), sMessage); } Quote Share this post Link to post Share on other sites
Reztea 34 Posted June 12, 2017 I think then you need to use a_glob_bool_set or something like that, check it out in kotor tool. When and how do the scripts to set the booleans fire? Maybe the problem is that those scripts never fire. To diagnose, you could include this in your setting scripts, then check your feedback screen after they're supposed to have run. void main(){ SetGlobalBoolean("Recruit_Atris_E", TRUE); string sMessage = "Recruit_Atris_E setting script fired! Current value: "; if(GetGlobalBoolean("Recruit_Atris_E")) sMessage += "TRUE"; else sMessage += "FALSE"; SendMessageToPC(GetFirstPC(), sMessage); } The setting scripts fire just before the dialog that says "Atris has joined your party" dialog. I got a message! It says "Recruit_Atris_E setting script fired! Current Value: FALSE" I guess I need that to be true. It's one thing on top of another Quote Share this post Link to post Share on other sites
bead-v 251 Posted June 12, 2017 Yeah, so then the setting of the global is failing, make sure that the globals are named EXACTLY as in globalcat.2da, and that the global variable type is set to Boolean. Also make sure you don't have another globalcat.2da lying around somewhere in an override subfolder or something. Quote Share this post Link to post Share on other sites
Reztea 34 Posted June 12, 2017 Yeah, so then the setting of the global is failing, make sure that the globals are named EXACTLY as in globalcat.2da, and that the global variable type is set to Boolean. Also make sure you don't have another globalcat.2da lying around somewhere in an override subfolder or something. THAT was the problem! There was a globalcat.2da file in my movies folder O_O, I don't know how that got there! Permission to beat me up is all the way granted! thank you! Quote Share this post Link to post Share on other sites
bead-v 251 Posted June 13, 2017 THAT was the problem! There was a globalcat.2da file in my movies folder O_O, I don't know how that got there! Permission to beat me up is all the way granted! thank you! lol I almost didn't mention that because I was like "what are the odds of that!" Anyway, glad it's working now! Quote Share this post Link to post Share on other sites