lfnetwork.com mark read register faq members calendar

Thread: scripting help w/inventory - TSL
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 08-04-2011, 12:11 AM   #1
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 703
Veteran Modder 
scripting help w/inventory - TSL

Hey scripting gurus out there, I have a question. I have this script

Code:
void main () {



if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "xxxxxxxx"))) {
if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "yyyyyyyy"))) {
if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "zzzzzzzz"))) {

AddJournalQuestEntry("XYZ",30); }}}


}
This script is on some placeables that is checked when inventory is disturbed, and when I have all three items journal entry 30 is triggered. Which I want to keep.

My question, how do I alter this script so that if I don't have all three items when the placeable is disturbed journal entry 20 is triggered instead?

Thanks.


Who's more foolish, the fool or the fool that follows?

Just exactly what is a head-piece to the Staff of Ra?

http://www.lucasforums.com/showthread.php?t=206819

http://www.lucasforums.com/showthread.php?t=206541

http://www.lucasforums.com/showthrea...t=newbiemodder
newbiemodder is offline   you may: quote & reply,
Old 08-04-2011, 12:23 AM   #2
Canaan Sadow
Junior Member
 
Canaan Sadow's Avatar
 
Join Date: Jul 2010
Location: Endor
Posts: 366
Current Game: Pokemon & K2
Quote:
Originally Posted by newbiemodder View Post
Hey scripting gurus out there, I have a question. I have this script

Code:
void main () {



if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "xxxxxxxx"))) {
if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "yyyyyyyy"))) {
if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "zzzzzzzz"))) {

AddJournalQuestEntry("XYZ",30); }}}


}
This script is on some placeables that is checked when inventory is disturbed, and when I have all three items journal entry 30 is triggered. Which I want to keep.

My question, how do I alter this script so that if I don't have all three items when the placeable is disturbed journal entry 20 is triggered instead?

Thanks.
Well you could do the simple thing... make it to where you need only one...

so...


Code:
void main () {



if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "xxxxxxxx"))) {


AddJournalQuestEntry("XYZ",20); }


}
Btw I just copied and pasted your script, it may be wrong, I didn't actually search it lol
Canaan Sadow is offline   you may: quote & reply,
Old 08-04-2011, 11:33 AM   #3
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
Hi,

I don't know if it works, but you might want to try that:

Code:
void main () {



if (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "xxxxxxxx")) && (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "yyyyyyyy")) && (GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "zzzzzzzz"))))) 
{

AddJournalQuestEntry("XYZ",30); }

else {

AddJournalQuestEntry("XYZ",20); }


}
Fastmaniac is offline   you may: quote & reply,
Old 08-04-2011, 12:28 PM   #4
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 703
Veteran Modder 
I'll give it a whirl Fastmaniac, thanks


Who's more foolish, the fool or the fool that follows?

Just exactly what is a head-piece to the Staff of Ra?

http://www.lucasforums.com/showthread.php?t=206819

http://www.lucasforums.com/showthread.php?t=206541

http://www.lucasforums.com/showthrea...t=newbiemodder
newbiemodder is offline   you may: quote & reply,
Old 08-05-2011, 10:06 AM   #5
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
fastmaniacs got it i think.
Qui-Don Jorn is offline   you may: quote & reply,
Old 08-06-2011, 09:34 PM   #6
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by Kuai-Donn Jorn View Post
fastmaniacs got it i think.
I think so too... you just needed to add an exception rule to your conditional.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 08-07-2011, 12:47 PM   #7
newbiemodder
Gentleman Modder
 
newbiemodder's Avatar
 
Join Date: Feb 2009
Location: Chicago
Posts: 703
Veteran Modder 
We're good...thx to all


Who's more foolish, the fool or the fool that follows?

Just exactly what is a head-piece to the Staff of Ra?

http://www.lucasforums.com/showthread.php?t=206819

http://www.lucasforums.com/showthread.php?t=206541

http://www.lucasforums.com/showthrea...t=newbiemodder
newbiemodder 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 > scripting help w/inventory - TSL

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 11:45 AM.

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