Salk Posted July 24, 2013 Share Posted July 24, 2013 Hello! I would like to create a conditional script to check if the krayt dragon pearl (tat18_dragonprl) is either in the inventory or assembled into a lightsaber. I got the first part working with this: int StartingConditional() { return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "tat18_dragonprl")); } but how do I fix the second half of my problem? The INVENTORY_SLOT does not seem to be of any help because it's not that the pearl is considered an equipped item. Perhaps doing what I want is not possible at all? Link to comment Share on other sites More sharing options...
harIII Posted July 24, 2013 Share Posted July 24, 2013 This is an indirect way of doing it but if I remember correctly you can only get the Dragon Pearl once you have completed the quest for it. I forget the name of the quest but you can look it up in the .jrl file and decipher which one you need. This script checks to see if a particular Journal entry is active. int StartingConditional() { return (GetJournalEntry("name of journal entry reference") == 1); } The 1 is which entry you are checking for. Link to comment Share on other sites More sharing options...
Salk Posted July 24, 2013 Author Share Posted July 24, 2013 Thank you for your help, harIII but that solution won't work. You see, I want to set a dialogue condition to make sure that the pearl has not been sold so just checking for the journal entry won't suffice. Thanks anyway for the suggestion though! Link to comment Share on other sites More sharing options...
Fallen Guardian Posted July 25, 2013 Share Posted July 25, 2013 It should still return as true if the pearl is in your lightsaber. I'd probably check for it being owned by the player with GetItemPossessor, rather than GetItemPossessedBy, like this: int StartingConditional() { object oPC = GetFirstPC(); object oPearl = GetObjectByTag("tat18_dragonprl"); if( (GetItemPossessor(oPearl)) == (oPC) ) { return TRUE; } else return FALSE; } Link to comment Share on other sites More sharing options...
VarsityPuppet Posted July 25, 2013 Share Posted July 25, 2013 Actually, I'm not sure if it does return as true if it's in your lightsaber. I may be thinking of color crystals exclusively, but I'm pretty sure upgrades you put in to weapons don't count as inventory items. They are, after all, not in your inventory anymore... :/ Link to comment Share on other sites More sharing options...
Fallen Guardian Posted July 25, 2013 Share Posted July 25, 2013 Well the description of GetItemPossessor doesn't mention it being in the inventory, but that is my fear is it won't recognize the item as being owned by the player because it's not in the inventory. Link to comment Share on other sites More sharing options...
VarsityPuppet Posted July 25, 2013 Share Posted July 25, 2013 You could try GetItemPossessedBy(oPC, "tag") != OBJECT_INVALID as the conditional. (I think that's it anyways. It's something like that). Should really return the same result, but hey, worth a shot. KOTOR scripting is weird. Link to comment Share on other sites More sharing options...
Salk Posted July 25, 2013 Author Share Posted July 25, 2013 Thanks for the help guys! I'll give it a try and report. Link to comment Share on other sites More sharing options...
Salk Posted July 25, 2013 Author Share Posted July 25, 2013 I tested both and neither worked. Thanks anyway for your help. Link to comment Share on other sites More sharing options...
Hassat Hunter Posted August 5, 2013 Share Posted August 5, 2013 Yeah, don't think it's possible. Obsidian worked around when there was a socketable item it checked the set flag instead (think Onderon Cantina)... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.