lfnetwork.com mark read register faq members calendar

Thread: Script Help
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 03-13-2013, 11:40 PM   #1
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Script Help

Ok probobly a TOTAL n00b question but I want a dialog option only available if a certian item is equiped to the pc. The current script i am using won't work? Here is my current script:
int StartingConditional()
{
object oPC = GetPCSpeaker();

if (GetItemPossessedBy(oPC, "unibelt") == OBJECT_INVALID) return FALSE;

return TRUE;
}


By the way thanks in advance everyone is so helpfull around here.
Edit: ps. This script is for kotor 1 don't really know if that matters

Last edited by supreme kotor; 03-13-2013 at 11:46 PM.
supreme kotor is offline   you may: quote & reply,
Old 03-14-2013, 12:02 AM   #2
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! 
If you want the conversation option available once the "unibelt" is equipped, you wouldn't want to check it against OBJECT_INVALID and return the script as false, because then the thing will never come up. Also, the item can be possessed but not equipped, so the PC could still get your node even if they didn't have the thing equipped. This script should be more of what you are looking for:

Code:
int StartingConditional() 
{

object oUniBelt = GetObjectByTag("unibelt");

object oItem = GetItemInSlot(INVENTORY_SLOT_BELT, GetFirstPC());

if ( oItem == oUniBelt)
    {
        return TRUE;
    }
return FALSE;
}
This compiles fine, I just don't know if it will work in-game (I've never done a script like this before). However, it should work... if it doesn't, feel free to come back and tell us what problems you're having.


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 03-14-2013, 04:17 PM   #3
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Sorry but that script want work either. (It compiled fine as you said but in game didnt work. Here is as much info as i could think of: the script is for kotor 1. I made sure I deleated all saves so it wasnt loading a save. I am including both the .nss and the .ncs files when I build the mod. Other script within the module work fine.
Here are two pics one of the actual script maybe i am doing somethin wrong with it? And this one is of the dialouge the script is called from.

script:http://s1324.beta.photobucket.com/us...99366370750661

Dialouge:http://s1324.beta.photobucket.com/us...tml?sort=3&o=0
supreme kotor is offline   you may: quote & reply,
Old 03-15-2013, 07:09 AM   #4
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 565
Didn't do any KOTOR1 modding but try to add "break;" under return TRUE... as it now even when true still goes towards the return FALSE, the break should cut the script off right there, not overwriting the TRUE with the FALSE.

Think it should work fine then...
Hassat Hunter is offline   you may: quote & reply,
Old 03-15-2013, 12:49 PM   #5
Fair Strides 2
Witty Programmer
 
Fair Strides 2's Avatar
 
Join Date: Jan 2012
Location: Oregon, United States
Posts: 613
Current Game: Master of Orion 2
Helpful! 
Quote:
Originally Posted by Hassat Hunter View Post
Didn't do any KOTOR1 modding but try to add "break;" under return TRUE... as it now even when true still goes towards the return FALSE, the break should cut the script off right there, not overwriting the TRUE with the FALSE.

Think it should work fine then...
You know, I stared at the script for a good ten minutes last night, knew there was something missing, and couldn't name what. This is embarrassing since I'm a scripter.


All of my mods are available on Deadlystream.

Always remember modders: "Quality= Effort*Time"

KSE 3.3.4 is LIVE!!! Check it out here.

Check out WalkSwitch, the Walkmesh-changing tool!
Fair Strides 2 is offline   you may: quote & reply,
Old 03-15-2013, 03:53 PM   #6
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Well maybe it's just bad luck or my inability to script but now when i het compile I get this: Error: "break" statment only allowed in "switch", "do", "while", and "for" statments Complation aborted with errors

ps. thanks for all the help and if this script wont work just let me know I will just change the dialog and use a difrent script.

EDIT: Got the script to compile but it still just wont work script now looks like this:

int StartingConditional()
{

object oUniBelt = GetObjectByTag("unibelt");

object oItem = GetItemInSlot(INVENTORY_SLOT_BELT, GetFirstPC());

if ( oItem == oUniBelt)
{
return TRUE;
("break");
}
return FALSE;
}

Last edited by supreme kotor; 03-15-2013 at 04:58 PM.
supreme kotor is offline   you may: quote & reply,
Old 03-15-2013, 05:09 PM   #7
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! 
Quote:
Originally Posted by supreme kotor View Post
EDIT: Got the script to compile but it still just wont work script now looks like this:

int StartingConditional()
{

object oUniBelt = GetObjectByTag("unibelt");

object oItem = GetItemInSlot(INVENTORY_SLOT_BELT, GetFirstPC());

if ( oItem == oUniBelt)
{
return TRUE;
("break");
}
return FALSE;
}
You want the break command to look as it does below, with no quotes or parentheses.

Code:
int StartingConditional() 
{ 
object oUniBelt = GetObjectByTag("unibelt");
 
object oItem = GetItemInSlot(INVENTORY_SLOT_BELT, GetFirstPC());
 
  if ( oItem == oUniBelt) 
     { 
      return TRUE; 
      break;
      } 

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 03-16-2013, 11:42 AM   #8
supreme kotor
Junior Member
 
supreme kotor's Avatar
 
Join Date: Mar 2013
Location: I'm lost.
Posts: 326
Current Game: Modding.. Wait is that a game?
Well bad news I am now getting the same error as beafore I think I should just switch to a diffrent type of script but just in case you want to see what im talking about here ya go:

http://s1324.beta.photobucket.com/us...20292841498466



Great but pathetic news after you guys fixed the script (Thank you) I found out it was a dialog issue not a script issue but thanks it works now

Last edited by supreme kotor; 03-16-2013 at 12:47 PM.
supreme kotor 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 Help

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 02:42 AM.

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