lfnetwork.com mark read register faq members calendar

Thread: Script question
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-24-2013, 09:31 AM   #1
Salk
Rookie
 
Join Date: Apr 2010
Posts: 73
Current Game: Knights of the Old Republic
Script question

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:

Code:
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?
Salk is offline   you may: quote & reply,
Old 07-24-2013, 09:49 AM   #2
harIII
Veteran
 
harIII's Avatar
 
Join Date: Feb 2008
Posts: 983
Helpful! 
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.

Quote:
int StartingConditional() {
return (GetJournalEntry("name of journal entry reference") == 1);
}
The 1 is which entry you are checking for.
harIII is offline   you may: quote & reply,
Old 07-24-2013, 11:41 AM   #3
Salk
Rookie
 
Join Date: Apr 2010
Posts: 73
Current Game: Knights of the Old Republic
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!
Salk is offline   you may: quote & reply,
Old 07-24-2013, 09:15 PM   #4
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
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:

Code:
int StartingConditional()
{

   object oPC = GetFirstPC();
   object oPearl = GetObjectByTag("tat18_dragonprl");

      if( (GetItemPossessor(oPearl)) == (oPC) )
      {

         return TRUE;

      }


      else return FALSE; 


}


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 07-24-2013, 09:45 PM   #5
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,256
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
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... :/

VarsityPuppet is offline   you may: quote & reply,
Old 07-24-2013, 09:51 PM   #6
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,288
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
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.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 07-24-2013, 10:01 PM   #7
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,256
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
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.

VarsityPuppet is offline   you may: quote & reply,
Old 07-25-2013, 01:37 AM   #8
Salk
Rookie
 
Join Date: Apr 2010
Posts: 73
Current Game: Knights of the Old Republic
Thanks for the help guys!

I'll give it a try and report.
Salk is offline   you may: quote & reply,
Old 07-25-2013, 03:09 AM   #9
Salk
Rookie
 
Join Date: Apr 2010
Posts: 73
Current Game: Knights of the Old Republic
I tested both and neither worked.

Thanks anyway for your help.
Salk is offline   you may: quote & reply,
Old 08-05-2013, 05:53 AM   #10
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 572
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)...
Hassat Hunter is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Script question

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:20 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.