lfnetwork.com mark read register faq members calendar

Thread: Qui-Gon's Script Shack
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-04-2012, 12:48 PM   #121
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
To do this, you need to set a boolean which will return true when you've talked to the character. Then create a conditional script for the line of dialog you want available after you've talked.

This script will set the boolean,

Code:
void main () {
  SetLocalBoolean(HAS_TALKED,0,TRUE);
}
This script will check to see if you've talked yet,

Code:
int StartingConditional() {
  int nTalked = GetLocalBoolean(HAS_TALKED,0);
  return nTalked;
}
In the dialog file, put the dialog node you want the character to say AFTER you've talked before at the top. Then, in the conditional field, put the name of the second script.

In the node of dialog you want the character to say the first time you talk, you need to put the first script in the script field. You can put it on any line of dialog but you need to decide where it would be best suited.

Depending on the situation, you can make this as complicated or simple as you want, with many different conditional scripts.


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 03-04-2012, 01:04 PM   #122
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
So let me get this straight. The boolean script goes with the node my pc can only say once and the first time they speak. IE. to spawn something
The conditional script goes with 2nd line so i cant spawn it again?


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-04-2012, 01:09 PM   #123
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
What exactly are you trying to do?


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 03-04-2012, 04:44 PM   #124
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Thought I'd add it dosn't compile. It sasis:
Undeclared Indentifier "HAS_TALKED:
And
Required Argument missing in call to "SetLocalBoolean"
Here is the script:
Code:
void main () { 
SetLocalBoolean(HAS_TALKED,0,TRUE); 
}
Same errors with the second script:

Code:
int StartingConditional() {
      int nTalked = GetLocalBoolean(HAS_TALKED,0); return nTalked; 
}


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-04-2012, 05:13 PM   #125
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 to have a check wether the person has been talked to just use in-game resources.

k_con_talkedto checks if you've talked to a person, and k_act_talktrue makes it so that the game recognizes that you've talked to the person, basically this:

Code:
void main () { 
SetLocalBoolean(HAS_TALKED,0,TRUE); 
}

Anyway, I use that a lot in KotOR 1, I don't know if it works in KotOR 2.


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-05-2012, 03:37 AM   #126
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
Oh ok then, try using that DJW, I don't play around with dialog and stuff too much so I'm not an expert

Thanks for the future reference Fallen


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 03-05-2012, 12:44 PM   #127
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Quote:
Originally Posted by Fallen Guardian View Post
If you want to have a check wether the person has been talked to just use in-game resources.

k_con_talkedto checks if you've talked to a person, and k_act_talktrue makes it so that the game recognizes that you've talked to the person, basically this:

Code:
void main () { 
SetLocalBoolean(HAS_TALKED,0,TRUE); 
}

Anyway, I use that a lot in KotOR 1, I don't know if it works in KotOR 2.
Its for kotor 1 anyway, thanks guys
if theres k_act_talktrue, is there k_act_talkfalse?


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-05-2012, 01:44 PM   #128
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! 
I don't believe so. This is the source code for k_act_talktrue:


Code:
//:: k_act_talktrue
/*
    Sets the NPC talk to state to
    true.
*/
//:: Created By: Preston Watamaniuk
//:: Copyright (c) 2002 Bioware Corp.

#include "k_inc_debug"
#include "k_inc_utility"

void main()
{
    UT_SetTalkedToBooleanFlag(OBJECT_SELF);
}
I wouldn't really know how to get this thing set to false again, but maybe a more experience scripter knows.


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-05-2012, 04:44 PM   #129
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
That's not the source code. Well, it is. Well, it isn't. Anyway, here's the exact source code:
Code:
SetLocalBoolean(oTarget, SW_PLOT_HAS_TALKED_TO, nState)
Just set nState as FALSE and I believe that should do the trick.


JCarter426 is offline   you may: quote & reply,
Old 03-06-2012, 01:38 PM   #130
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Quote:
Originally Posted by Fallen Guardian View Post
If you want to have a check wether the person has been talked to just use in-game resources.

k_con_talkedto checks if you've talked to a person, and k_act_talktrue makes it so that the game recognizes that you've talked to the person, basically this:

Code:
void main () { 
SetLocalBoolean(HAS_TALKED,0,TRUE); 
}

Anyway, I use that a lot in KotOR 1, I don't know if it works in KotOR 2.
Would this work.
First time the npc sais a node. Run k_act_talktrue.
Second Time, run k_con_talkedto, which will open a different node.

Is there something I'm missing?

Thanks

-DJW


-JC-
It sais syntax error at SetLocalBoolean
SetLocalBoolean(oTarget, SW_PLOT_HAS_TALKED_TO, FALSE)

It sais

Syntax error at GiveXPToCreature
GiveXPToCreature(GetFirstPC(),500);
What do I do?

Same old error, it sais syntax error on CreateItemOnObject
CreateItemOnObject("g_a_jediscout", oPC);
CreateItemOnObject("g_w_lghtsbr10", oPC);


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY

Last edited by UltimateHK47; 03-06-2012 at 01:57 PM.
UltimateHK47 is offline   you may: quote & reply,
Old 03-06-2012, 05:03 PM   #131
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by DarthJango/Weasley View Post
It sais syntax error at SetLocalBoolean
SetLocalBoolean(oTarget, SW_PLOT_HAS_TALKED_TO, FALSE)
Looks like you forgot a semicolon there. You can probably ignore the messages that come after this; the debugger gets confused sometimes.


JCarter426 is offline   you may: quote & reply,
Old 03-06-2012, 05:27 PM   #132
Sithspecter
Big things are coming...
 
Sithspecter's Avatar
 
Status: Moderator
Join Date: Jan 2008
Location: Ebon Hawk
Posts: 1,787
Current Game: Mechwarrior II: Mercenaries
Contest winner - Modding Forum Veteran Veteran Modder LFN Staff Member 
Decided to sticky this since it has become such a popular resource. Keep up the good work guys!

-SS




Last edited by Sithspecter; 03-06-2012 at 07:34 PM.
Sithspecter is offline   you may: quote & reply,
Old 03-06-2012, 05:30 PM   #133
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Quote:
Originally Posted by JCarter426 View Post
Looks like you forgot a semicolon there. You can probably ignore the messages that come after this; the debugger gets confused sometimes.
Won't let me compile with errors i have no idea how to use the other script compiler)


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-06-2012, 06:45 PM   #134
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
If you're still getting errors, I'll need to see the whole script. Syntax errors are usually typos, and the debugger isn't always accurate about their location.


JCarter426 is offline   you may: quote & reply,
Old 03-07-2012, 02:24 PM   #135
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
xp.nss
GiveXPToCreature(GetFirstPC(),500);
createit.nss
CreateItemOnObject("g_a_jediscout", oPC);
CreateItemOnObject("g_w_lghtsbr10", oPC);
falseboolean.nss
SetLocalBoolean(oTarget, SW_PLOT_HAS_TALKED_TO, FALSE);

All the same sort of errors, the, CreateItemOnObject
Trying one of my ideas, (when it comes to scripting im a duck)
it compiled. This :

void main()
{

GiveXPToCreature(GetFirstPC(),500);

}

Why is this?

This sais undeclared identifyer at oPC
void main ()

{
CreateItemOnObject("g_a_jediscout", oPC);
CreateItemOnObject("g_w_lghtsbr10", oPC);
}

And the same for oTarget
Required argument missing in SetLocalBoolean
Undeclared identifier SW_PLOT_HAS_TALKED_TO

void main()
{

SetLocalBoolean(oTarget, SW_PLOT_HAS_TALKED_TO, FALSE);

}

What eelse do you need to know?

PS: How does the boolean script work. i want it to check if you havn't said something, and if you havn't get the option to the dialouge entry I want said only once. Will it do that?


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY

Last edited by UltimateHK47; 03-07-2012 at 02:38 PM.
UltimateHK47 is offline   you may: quote & reply,
Old 03-07-2012, 03:43 PM   #136
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
You haven't declared your variables.

For example, oPC on it's own doesn't mean anything. If you do this:

Code:
void main()
	{
		object oPC = GetFirstPC();
		
		CreateItemOnObject("g_a_jediscout", oPC);
		CreateItemOnObject("g_w_lghtsbr10", oPC);
	}
It should work fine. Same with oTarget, you haven't said what oTarget is.




Visit the new JediKnight.net!
Marius Fett is offline   you may: quote & reply,
Old 03-07-2012, 07:19 PM   #137
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by DarthJango/Weasley View Post
PS: How does the boolean script work. i want it to check if you havn't said something, and if you havn't get the option to the dialouge entry I want said only once. Will it do that?
No, that would just set it so you haven't talked to the NPC, even when you have (at least, I think it should do that). If you want to check whether you have talked to an NPC yet, you need a conditional script... they work very differently. But fortunately you don't need to write your own, because the game already has one, k_con_talkedto in K1 and c_talkedto in K2. It will return true if you've never talked to the NPC before.

You need to put the script as a conditional script in the dialogue ("script that determines availability" or some such in K1, "Conditional #1" or "Conditional #2" in K2). If the script returns true, the node will be used. Make sure this node is the highest node in the dialogue file so that the game knows to check it first. I think there are more in depth tutorials here, too.


JCarter426 is offline   you may: quote & reply,
Old 03-07-2012, 08:25 PM   #138
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 565
Why are we using scripts for this again?

Just using a_local_set and a_local_reset to decide which nodes are (in)available, and use c_local_set or c_local_notset to check for them.
A little harder for KOTOR1 since it only has one conditional field and 1 script field, but unless you want to do other stuff it's the easiest way to do it...
Hassat Hunter is offline   you may: quote & reply,
Old 03-07-2012, 10:54 PM   #139
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Those are scripts too. And they don't exist in K1. And... it's the same thing anyway.

The talked to scripts check a local boolean that is specifically reserved for whether the NPC has been talked to yet. Although that does remind me, at some point in the initial conversation, you'll have to fire a script that sets the boolean. k_act_talktrue in K1 and a_talktrue in K2. Forgot to mention that before.


JCarter426 is offline   you may: quote & reply,
Old 03-08-2012, 06:05 AM   #140
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 565
Except that you don't need to write new scripts, just add/remove and check locals in the dlg-editor.
Seeing how handy it is (and often used in TSL) it's not used in KOTOR1? Ouch.

KOTOR2 is definitely a lot more modder-friendly 0_0
Hassat Hunter is offline   you may: quote & reply,
Old 03-08-2012, 01:06 PM   #141
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Quote:
Originally Posted by Marius Fett View Post
You haven't declared your variables.

For example, oPC on it's own doesn't mean anything. If you do this:

Code:
void main()
	{
		object oPC = GetFirstPC();
		
		CreateItemOnObject("g_a_jediscout", oPC);
		CreateItemOnObject("g_w_lghtsbr10", oPC);
	}
It should work fine. Same with oTarget, you haven't said what oTarget is.
void main()
{

object oTarget = GetFirstNPC();
SetLocalBoolean(oTarget, SW_PLOT_HAS_TALKED_TO, FALSE);

}

This is me taking a stab at it

The erorrs are the same, but replacing oTarget with undeclared identifyer GetFirstNPC same undecalerd with SW_PLOT_HAS_TALKED_TO and the same error with SteLocalBoolean. The other script works fine thanks.


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-08-2012, 07:06 PM   #142
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by Hassat Hunter View Post
Except that you don't need to write new scripts
And... I just said that.
Quote:
just add/remove and check locals in the dlg-editor.
Seeing how handy it is (and often used in TSL) it's not used in KOTOR1? Ouch.
No, it's not. There are no parameters in the dialogue files, so you would need a new script for everything.
Quote:
KOTOR2 is definitely a lot more modder-friendly 0_0
Yes, yes it is.
Quote:
Originally Posted by DarthJango/Weasley View Post
void main()
{

object oTarget = GetFirstNPC();
SetLocalBoolean(oTarget, SW_PLOT_HAS_TALKED_TO, FALSE);

}

This is me taking a stab at it

The erorrs are the same, but replacing oTarget with undeclared identifyer GetFirstNPC same undecalerd with SW_PLOT_HAS_TALKED_TO and the same error with SteLocalBoolean. The other script works fine thanks.
It's GetFirstPC, not GetFirstNPC.

SW_PLOT_HAS_TALKED_TO might be defined in the file I was reading... I thought it was defined in NWScript. I'll have to check that. In any case, you don't need that; just follow my above instructions.



Last edited by JCarter426; 03-08-2012 at 07:11 PM.
JCarter426 is offline   you may: quote & reply,
Old 03-08-2012, 08:37 PM   #143
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 565
Dang.
So, this would work though, right? (KOTOR1 still has locals, multiple of them, right? Which could be used to check?)
Code:
void main()
{
object oTarget = GetObjectByTag( "NPC_Talking" );
SetLocalBoolean(oTarget, 51, TRUE);

}
Code:
void main() {
object oTarget = GetObjectByTag( "NPC_Talking" );

If GettLocalBoolean(oTarget, 51, TRUE) {
       return 1;
}
Else {
     return 0;
}
}
Hassat Hunter is offline   you may: quote & reply,
Old 03-08-2012, 09:02 PM   #144
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Yeah, but there's already a boolean reserved for that, and there's already a script that checks and sets it.


JCarter426 is offline   you may: quote & reply,
Old 03-08-2012, 09:14 PM   #145
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 565
Although of course you could replace "51" by "52" or "53" or "54", and have more checks than 1 mere boolean can give you...
Which is the very nice thing about locals in KOTOR2
Hassat Hunter is offline   you may: quote & reply,
Old 03-11-2012, 04:08 PM   #146
Ferc Kast
Modder
 
Ferc Kast's Avatar
 
Join Date: Jan 2007
Location: Tython
Posts: 1,586
Current Game: SWTOR
Helpful! Forum Veteran Contest winner - Fan Fiction Veteran Modder 
Well, while modding in TSL, I found a minor flaw in the following script I made: the party selection screen doesn't show up regardless of how I've changed that part of the script. Any help would be appreciated.

Code:
// recruit.nss
// Created by Ferc Kast

void RecruitA(int iNPC, string sResRef, string sExit, int iForce)
{
	int iNPC;
	string sResRef;
	string sExit;
	int iForce;
	RemoveAvailableNPC(iNPC);
	AddAvailableNPCByTemplate(iNPC, sResRef);
	if ( iForce == TRUE )
	{
		DelayCommand(1.5,ShowPartySelectionGUI(sExit, iNPC));
	}
	else if ( iForce == FALSE )
	{
		DelayCommand(1.5,ShowPartySelectionGUI(sExit));
	}
}

void RecruitB(string sTag)
{
	string sTag;
	object oNPC = GetObjectByTag(sTag);
	ActionPauseConversation();
	SetGlobalFadeOut(1.0, 0.5);    
	DelayCommand(1.0, DestroyObject(oNPC));
	DelayCommand(1.0,SetGlobalFadeIn(0.7,0.0));
	ActionResumeConversation();
}

Ferc Kast is offline   you may: quote & reply,
Old 03-11-2012, 09:53 PM   #147
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
I don't see iForce ever being defined as true or false, and you told it only to fire if iForce is true or false, which I find unnecessary, but that means this looks to be only a partial fragment; I'd need to see the rest to make sure any attempt at a fix wouldn't mess with the rest of it. But for now, I can give one bit of advice. First, get rid of your if trees, just replace it with the following:

Code:
DelayCommand(1.5, ShowPartySelectionGUI(sExit, iNPC1, iNPC2, FALSE);
And when you put in the NPC ID number in the DLG, just put in -1 for when you don't want to force anyone, or change your if trees to set them to -1 for anything other than the valid NPC ID numbers. The point of all this is if trees are finicky, particularly with this engine, so it's better to not have the whole execution of the script depend on one.


JCarter426 is offline   you may: quote & reply,
Old 03-11-2012, 10:20 PM   #148
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! 
Alright, in KotOR 1, I've been attempting to make an NPC walk over to the PC and once the NPC is about 5 meters or so from the PC he initiates a conversation with the PC. This is the script I've been using:

Code:
void main()
{


     object oPC=GetFirstPC();

     object oNPC=GetObjectByTag("dt_comm");

  int nCurrentDistance;

  int nEvent = GetUserDefinedEventNumber();

    nCurrentDistance = GetDistanceBetween(oNPC, oPC);

  if( 
        (nEvent == 1002) &&
        (nCurrentDistance<6) &&
   	GetGlobalBoolean("DT_CHECK1") == FALSE) {

    ActionDoCommand(SetCommandable(TRUE, oNPC));

  AssignCommand (oNPC, ActionMoveToObject(oPC));

  AssignCommand (oNPC, ActionStartConversation(GetFirstPC()));
   
  }
}
I get an error trying to compile it saying that the equal sign between nCurrentDistance and GetDistanceBetween is incorrect. This is most likely due to the fact I tried to copy of a script that would make something occur once an NPC reached a certain HP level. What should I change, or redo entirely, to make this work?

EDIT 1: Alright, while digging through source scripts searching for functions in my other modding projects, I found something that should work:

Code:
#include "k_inc_debug"
void main()
{


     object oPC=GetFirstPC();

     object oNPC=GetObjectByTag("dt_comm");

  int nEvent = GetUserDefinedEventNumber();

  if( 
        (nEvent == 1002) &&
   	GetGlobalBoolean("DT_CHECK1") == FALSE) &&
        GetDistanceBetween(GetPCSpeaker(), GetFirstPC()) <= 6.00)){

    ActionDoCommand(SetCommandable(TRUE, oNPC));

int bRun=TRUE;


  AssignCommand (oNPC, ActionMoveToObject(oPC, bRun, fRange=1.0f));

  AssignCommand (oNPC, ActionStartConversation(GetFirstPC()));
   
  }
}
I'll get back if it works or not.

EDIT 2: Alright, now I get a syntax error at the && after GetGlobalBoolean. How would I fix this?


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

Last edited by Fallen Guardian; 03-13-2012 at 10:58 PM. Reason: Error
Fallen Guardian is offline   you may: quote & reply,
Old 03-14-2012, 08:41 AM   #149
Ferc Kast
Modder
 
Ferc Kast's Avatar
 
Join Date: Jan 2007
Location: Tython
Posts: 1,586
Current Game: SWTOR
Helpful! Forum Veteran Contest winner - Fan Fiction Veteran Modder 
Quote:
Originally Posted by JCarter426 View Post
I don't see iForce ever being defined as true or false, and you told it only to fire if iForce is true or false, which I find unnecessary, but that means this looks to be only a partial fragment; I'd need to see the rest to make sure any attempt at a fix wouldn't mess with the rest of it. But for now, I can give one bit of advice. First, get rid of your if trees, just replace it with the following:

Code:
DelayCommand(1.5, ShowPartySelectionGUI(sExit, iNPC1, iNPC2, FALSE);
And when you put in the NPC ID number in the DLG, just put in -1 for when you don't want to force anyone, or change your if trees to set them to -1 for anything other than the valid NPC ID numbers. The point of all this is if trees are finicky, particularly with this engine, so it's better to not have the whole execution of the script depend on one.
Somehow, the selection GUI still didn't show up, after changing those trees to the simply command. Though, when I checked afterwards, the party member is recruited & able to be chosen for the player's current party.

Ferc Kast is offline   you may: quote & reply,
Old 03-17-2012, 03:34 PM   #150
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! 
Alright, I've managed to get my above script to compile by making it like this:

Code:
void main()
{


     object oPC=GetFirstPC();

     object oNPC=GetObjectByTag("dt_comm");

  int nEvent = GetUserDefinedEventNumber();

int bRun=TRUE;

  if( 
        (nEvent == 1002) &&
        GetGlobalBoolean("DT_CHECK1") == FALSE)
        {

        if(GetDistanceBetween(oNPC, oPC) <= 6.0){

    ActionDoCommand(SetCommandable(TRUE, oNPC));

  AssignCommand (oNPC, ActionMoveToObject(oPC, bRun));

  AssignCommand (oNPC, ActionStartConversation(GetFirstPC()));
  
    } 
  }
}
I'll edit this post to tell if it works in-game or not.


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-20-2012, 09:19 PM   #151
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Hmm. I've found ActionMoveToObject to be unreliable. ActionForceMoveToObject very rarely fails me, however. (Again, that's probably why it exists in the first place.)
Code:
// 383: Force the action subject to move to oMoveTo.
void ActionForceMoveToObject(object oMoveTo, int bRun=FALSE, float fRange=1.0f, float fTimeout=30.0f);
The variables are basically the same except there's a float at the end... I believe that's how long it will try before giving up.
Quote:
Originally Posted by Ferc Kast View Post
Somehow, the selection GUI still didn't show up, after changing those trees to the simply command. Though, when I checked afterwards, the party member is recruited & able to be chosen for the player's current party.
Yeah, as I said I'd need to see the whole thing to be sure. It sounds like some other part of the script is interfering with this particular function.


JCarter426 is offline   you may: quote & reply,
Old 03-20-2012, 09:38 PM   #152
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 565
Force usually teleports though.

Tried to have people leave the Nar Shaddaa cantina through the door, it's impossible.
Regular move just gets them stuck, force move instantly teleported them (since no good path).
Then again might have been the map since trying to make a NPC run to the middle of the cantina gave big problems too...
Hassat Hunter is offline   you may: quote & reply,
Old 03-20-2012, 11:10 PM   #153
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! 
Hmm, well both ActionMoveToObject and ActionForceMoveToObject aren't working. In fact, it appears something's gotten really messed up. The character won't walk his waypoints and the perception event doesn't seem to be firing.


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-22-2012, 11:07 PM   #154
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Quote:
Originally Posted by Hassat Hunter View Post
Force usually teleports though.

Tried to have people leave the Nar Shaddaa cantina through the door, it's impossible.
Regular move just gets them stuck, force move instantly teleported them (since no good path).
Then again might have been the map since trying to make a NPC run to the middle of the cantina gave big problems too...
I've never had anything like this happen.
Quote:
Originally Posted by Fallen Guardian View Post
Hmm, well both ActionMoveToObject and ActionForceMoveToObject aren't working. In fact, it appears something's gotten really messed up. The character won't walk his waypoints and the perception event doesn't seem to be firing.
In that case, I'd say you probably made a typo at some point, and you should either start everything over from scratch or carefully check everything.


JCarter426 is offline   you may: quote & reply,
Old 04-03-2012, 03:50 PM   #155
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! 
Okay, so I've been attempting to get this:

Code:
void main()
{

object oPM1 = GetPartyMemberByIndex(1);

ApplyEffectToObject(1, EffectMovementSpeedDecrease(99, oPM1, 18));

}
To compile for a while now, but I keep on getting two errors. 1: Too many arguments specified for EffectMovementSpeedDecrease 2: Required argument missing in ApplyEffectToObject.

Could someone explain to me what I've done wrong?


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 04-03-2012, 05:49 PM   #156
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Looks like you ended the parenthesis in the wrong place.
Code:
void main()
{

object oPM1 = GetPartyMemberByIndex(1);

ApplyEffectToObject(1, EffectMovementSpeedDecrease(99), oPM1, 18.0);

}
That should do it. Well, maybe.


JCarter426 is offline   you may: quote & reply,
Old 04-03-2012, 06:06 PM   #157
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! 
Alright, it compiles. I'll check back and tell if it works in-game.

EDIT: It works, though a speed decrease of 99 is ridiculous, as they barely move at all. Making it EffectMovementSpeedDecrease(45) makes the usual waddle of the GetPartyMemberByIndexFunction Movement look normal.


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

Last edited by Fallen Guardian; 04-03-2012 at 06:23 PM.
Fallen Guardian is offline   you may: quote & reply,
Old 04-03-2012, 07:12 PM   #158
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
Nice! I've never actually tried that. Good to know it actually works, no more silly speed-walking.


JCarter426 is offline   you may: quote & reply,
Old 04-17-2012, 02:40 AM   #159
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! 
Module Warping

Alright, so I have come here to ask this:

If the PC were to have a conversation with a party member in which that party member were to share his/her past with the PC in flashback form (start a new module and have a fancy cutscene) would there be a way to check what module, and what coordinates in that module that the PC was at, before the flashback took place in order to warp the PC back to the right location after the flashback (cutscene) took place?


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 04-17-2012, 09:48 PM   #160
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
There is - probably - but the question is how much effort you want to spend to do so. It can be done relatively easily in K2, by spawning a waypoint at the characters' positions and then moving them there when the module reloads... but I don't believe you can spawn waypoints in K1, at all. The only instance of something like this happening in K1 that I can remember is the Revan flashback; yes, the beginning is just a Bink video, but Revan taking his mask off is a proper cutscene module (side note: I believe they did this for people who disable Bink videos, so they would know what the hell was going on). But that scene starts as a cutscene, and so naturally the waypoints already exist. But I'm guessing you want something along the lines of Kreia's fall - so the conversation can happen anywhere, and placing waypoints ahead of time would be impossible.

But fear not! I have an alternative solution: invisible placeable. You should be able to spawn it in by normal means. I did something along these lines, though it didn't involve leaving the module - and of course I can't remember why I had to do it this way anymore. I don't have access to my source scripts at the moment, but if memory serves, you need to do something like:
Code:
location L1 = Location(GetPosition(oNPC1), (GetFacing(oNPC1));
...and spawn the invisible object at that location, before you transit away. Then when you load the module again, just teleport the NPC to the placeable. Or for some reason if you have to spawn a new NPC, get the location of the placeable this time and spawning the NPC there.

Repeat as needed.


JCarter426 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 > Qui-Gon's Script Shack

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:40 AM.

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