lfnetwork.com mark read register faq members calendar

Thread: Scripting woes...
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 01-27-2009, 11:48 AM   #1
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
Scripting woes...

Ahoy fellow modders!

Being the scripting failure that I am, I have a problem.

I have a dialog, and at the end of the dialog, I use this script to spawn an NPC at a waypoint and the end of the conversation:

Code:
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("nindenstand");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ninden", lTarget);

}
That works fine.

But what I want, is for the NPC to start his own conversation with me after he spawns.

I've tried several ways to do this, and none of them seem to work.

Any of you scripting guru's...

I'd appreciate some help..




Visit the new JediKnight.net!
Marius Fett is offline   you may: quote & reply,
Old 01-27-2009, 12:03 PM   #2
zbyl2
Junior Member
 
zbyl2's Avatar
 
Join Date: May 2008
Location: a galaxy far far away...
Posts: 320
Contest winner - Modding Veteran Modder 
After "object oSpawn = Cre..." add line:
Code:
AssignCommand(oSpawn,ActionStartConversation(GetFirstPC(),"put_dlg_name_here",CONVERSATION_TYPE_CINEMATIC));
I'm always doing it that way and it always works
zbyl2 is offline   you may: quote & reply,
Old 01-27-2009, 12:52 PM   #3
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
Just tried that, and still no luck...




Visit the new JediKnight.net!
Marius Fett is offline   you may: quote & reply,
Old 01-27-2009, 03:01 PM   #4
Stream
Damn...
 
Stream's Avatar
 
Join Date: Nov 2007
Location: On your hard drive.
Posts: 469
Current Game: Fable 3
Helpful! LFN Staff Member 
Try this;
Code:
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("nindenstand");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ninden", lTarget);

object oNinden = GetObjectByTag("ninden", 0);
AssignCommand(oNinden, ActionStartConversation(oPC, "", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));

}
--Stream

Stream is offline   you may: quote & reply,
Old 01-27-2009, 03:22 PM   #5
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
Argh, still nothing...

The guy just spawns and stands there like a fool...




Visit the new JediKnight.net!
Marius Fett is offline   you may: quote & reply,
Old 01-27-2009, 03:42 PM   #6
Stream
Damn...
 
Stream's Avatar
 
Join Date: Nov 2007
Location: On your hard drive.
Posts: 469
Current Game: Fable 3
Helpful! LFN Staff Member 
Sorry my bad;
Code:
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("nindenstand");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ninden", lTarget);

object oNinden = GetObjectByTag("ninden", 0);
ActionStartConversation(oPC, "ninden_dialog_ref", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0);

}
I think that'll work.

--Stream

Stream is offline   you may: quote & reply,
Old 01-27-2009, 03:53 PM   #7
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Marius Fett View Post
But what I want, is for the NPC to start his own conversation with me after he spawns.
Make sure the script is run from the very last node in the conversation so the player isn't in dialog mode any more when the script has been run.
Code:
void main() {
    object oPC = GetFirstPC(); 
    location lTarget = GetLocation(GetWaypointByTag("nindenstand"));
    object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ninden", lTarget);
    NoClicksFor(1.0);
    DelayCommand(1.0, AssignCommand(oSpawn, ClearAllActions()));
    DelayCommand(1.0, AssignCommand(oSpawn, ActionStartConversation(oPC, "", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
(Alternatively you can just use your existing conversation to continue talking with the new NPC instead of starting a new one. Might be easier, depending on the circumstances.)

stoffe is offline   you may: quote & reply,
Old 01-27-2009, 05:02 PM   #8
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
Quote:
Originally Posted by stoffe
Make sure the script is run from the very last node in the conversation so the player isn't in dialog mode any more when the script has been run.
It is. It's on a blank node at the end of the dialog.

I'll try your script now.

EDIT:

Ok, the script works. He starts talking when he spawns.

But he starts on the wrong dialog node!

I't's supposed to be a talk - fight - talk sequence (based on tk's tutorial) but he ALWAYS starts on the "after fighting" node. (Yes i've tried switching the node order around.)

This isnt my lucky day..




Visit the new JediKnight.net!

Last edited by Marius Fett; 01-27-2009 at 05:23 PM.
Marius Fett is offline   you may: quote & reply,
Old 01-27-2009, 06:41 PM   #9
Star Admiral
N7 Commando
 
Star Admiral's Avatar
 
Join Date: Oct 2008
Location: Omega 4 Relay
Posts: 656
Current Game: Mass Effect 2
Folder extraordinaire Helpful! 
Do you have a conditional script on one of the branches? If so, could you post it here so we can give a look at it?

- Star Admiral
Star Admiral is offline   you may: quote & reply,
Old 01-28-2009, 11:01 AM   #10
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
Like I said, I followed tk's tutorial to give me an idea of what I was doing, so I used the one he posted:

Code:
int StartingConditional() {
int nResumeTalk = GetLocalBoolean(OBJECT_SELF,0);
return nResumeTalk;
}




Visit the new JediKnight.net!
Marius Fett is offline   you may: quote & reply,
Old 01-28-2009, 03:17 PM   #11
Exile007
Junior Member
 
Exile007's Avatar
 
Join Date: Dec 2007
Location: Imprisoned by the GenoHaradan
Posts: 499
Current Game: Zelda Majora's Mask
Quote:
Originally Posted by Marius Fett View Post
Like I said, I followed tk's tutorial to give me an idea of what I was doing, so I used the one he posted:

Code:
int StartingConditional() {
int nResumeTalk = GetLocalBoolean(OBJECT_SELF,0);
return nResumeTalk;
}
Did you set the local boolean on the object true in some other script? If yes then that's the problem, trying changing the 0 to a 1 in your conditional script and in the user-define portion of the talk-fight-talk sequence.
Exile007 is offline   you may: quote & reply,
Old 01-28-2009, 04:44 PM   #12
Marius Fett
Frigged if I know!
 
Marius Fett's Avatar
 
Join Date: May 2007
Location: Wales
Posts: 3,379
w00t!

Problem solved.

For now... But I have a feeling something else may go wrong.

So thanks everyone for the help so far.




Visit the new JediKnight.net!
Marius Fett 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 woes...

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

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