lfnetwork.com mark read register faq members calendar

Thread: Davik's Introduction script in KOTOR 1
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 04-20-2012, 05:44 PM   #1
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Davik's Introduction script in KOTOR 1

Hi!

I've recently picked up scripting for the first time, since I've been wanting to do a little modding that way. Specifically, I'm trying to alter the scene that introduces Davik Kang. Keep in mind that my goal is to do a video capture of the scene, so it doesn't have to necessarily have to work perfectly in-game, as long as the characters do what I'm trying to get them to. And again, I am a total n00b at scripting, but here goes nothin':

I took the DLG file ("tar08_davik081"), then added three entries above the entry where it normally starts.
The first entry simply runs the script that normally runs in the first entry ("k_ptar_davfadein").
The second entry's script should place Davik and Calo out of view, behind a door.
The third entry's script should open that door, and then have Davik walk through the door and, after a slight pause, have Calo walk through it too. While both walk to the location where they normally are in the scene, the door should close.
When they reach their locations, the scene should continue as normal. ("So, Canderous - I see you have brought someone with you!")

The two scripts I've made for these entries are as follows (these are my first scripts ever, so please don't laugh ):

Code:
void main()

{

	object oDavik = GetObjectByTag("tar08_davik081");
	vector vStartDavik = Vector(70.0, 125.0, 0.0);
	location lStartDavik = Location(vStartDavik, 0.0);

	object oCalo = GetObjectByTag("tar08_calo081");
	vector vStartCalo = Vector(72.0, 127.0, 0.0);
	location lStartCalo = Location(vStartCalo, 0.0);


	AssignCommand(oDavik, JumpToLocation(lStartDavik));
	AssignCommand(oCalo, JumpToLocation(lStartCalo));

}
Code:
void main()

{

	object oDavik = GetObjectByTag("tar08_davik081");
	vector vDestinationDavik = Vector(55.1257476806641, 104.52611541748, 0.0);
	location lDestinationDavik = Location(vDestinationDavik, 0.0);

	object oCalo = GetObjectByTag("tar08_calo081");
	vector vDestinationCalo = Vector(62.3564224243164, 104.714508056641, 0.0);
	location lDestinationCalo = Location(vDestinationCalo, 0.0);

	int bRun=FALSE;


	AssignCommand(oDavik, ActionMoveToLocation(lDestinationDavik, bRun=FALSE));
	DelayCommand(1.0, AssignCommand(oCalo, ActionMoveToLocation(lDestinationCalo, bRun=FALSE)));

}
Both scripts compiled fine, but they didn't do anything in game. The scene did continue as normal.
Note that I gave both scripts the names of two existing scripts from the same module (specifically "k_ptar_opencage" & "k_ptar_openhang", I didn't think it would conflict with the specific dialog I'm trying to modify) and put them in the Override folder, along with the modified "tar08_davik081.dlg".
Also, commands to open and close the door are obviously missing here, but the scripts didn't do anything either when I set all locations within same room, e.g. "vector vStartCalo = Vector(70.0, 119.0, 0.0);" and "vector vDestinationCalo = Vector(60.0, 119.0, 0.0);".
I couldn't find unique tags of doors in the GIT file, so I'm not even sure how to target a specific door. I did look through nwscript.nss and found these:

Code:
void DoDoorAction(object oTargetDoor, int nDoorAction);

int    DOOR_ACTION_OPEN                 = 0;

int ACTION_OPENDOOR           = 5;
int ACTION_CLOSEDOOR          = 6;
…but I don't know how to implement them, if those even are what I'm looking for.
Heh, I'm not even sure what I'm trying to do is possible.

Is it?
Taunger is offline   you may: quote & reply,
Old 04-21-2012, 08:23 AM   #2
Fastmaniac
Rookie
 
Fastmaniac's Avatar
 
Join Date: Aug 2009
Location: Germany
Posts: 164
Well, I haven't tried the scripts ingame. But I would have paused the actual conversation inside the scripts, so that it doesn't rush through the 'Continue' Nodes. You can do that by adding

Code:
ActionPauseConversation;
(Script Content)
ActionResumeConversation;
It's worth a try.

Now to the doors:

That function seems to be right. You just need to know the object's 'Tag' and you can implement it in your script:

Code:
object oDoor = GetObjectByTag('TAG_OF_DOOR');
void DoDooraction(oDoor, 5);   // open
void DoDooraction(oDoor, 6);   // close
That should do the trick...

Greetz Fastmaniac
Fastmaniac is offline   you may: quote & reply,
Old 04-21-2012, 04:47 PM   #3
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 571
Delays in .dlg work too.
Example script from KOTOR2 (so no guarantee it's the same in 1)
Code:
object oDoor5 = GetObjectByTag("Dantooine Door 5", 0);
AssignCommand(oDoor5, ActionCloseDoor(oDoor5));
and
Code:
object oDoor5 = GetObjectByTag("Dantooine Door 5", 0);
DelayCommand(0.5, AssignCommand(oDoor5, ActionOpenDoor(oDoor5)));
Hassat Hunter is offline   you may: quote & reply,
Old 04-21-2012, 08:00 PM   #4
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Thanks for the replies! Sadly, the scripts still don't seem to do anything.
I modified them as such:

Code:
void main()

{

	ActionPauseConversation();

	object oDavik = GetObjectByTag("tar08_davik081");
	vector vStartDavik = Vector(70.0, 125.0, 0.0);
	location lStartDavik = Location(vStartDavik, 0.0);

	object oCalo = GetObjectByTag("tar08_calo081");
	vector vStartCalo = Vector(72.0, 127.0, 0.0);
	location lStartCalo = Location(vStartCalo, 0.0);


	AssignCommand(oDavik, JumpToLocation(lStartDavik));
	AssignCommand(oCalo, JumpToLocation(lStartCalo));

	ActionResumeConversation();

}
Code:
void main()

{

	ActionPauseConversation();

	object oDavik = GetObjectByTag("tar08_davik081");
	vector vDestinationDavik = Vector(55.1257476806641, 104.52611541748, 0.0);
	location lDestinationDavik = Location(vDestinationDavik, 0.0);

	object oCalo = GetObjectByTag("tar08_calo081");
	vector vDestinationCalo = Vector(62.3564224243164, 104.714508056641, 0.0);
	location lDestinationCalo = Location(vDestinationCalo, 0.0);

	int bRun=FALSE;

	object oDoor = GetObjectByTag("ptar_davdoor");


	DelayCommand(1.0, DoDoorAction(oDoor, 5));
	DelayCommand(3.0, AssignCommand(oDavik, ActionMoveToLocation(lDestinationDavik, bRun=FALSE)));
	DelayCommand(4.0, AssignCommand(oCalo, ActionMoveToLocation(lDestinationCalo, bRun=FALSE)));

	ActionResumeConversation();

}
Taunger is offline   you may: quote & reply,
Old 04-21-2012, 08:12 PM   #5
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 571
Well, the fault could also be in your .dlg file.
Care to upload it for me to check?
Hassat Hunter is offline   you may: quote & reply,
Old 04-21-2012, 08:53 PM   #6
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
This link should work:

https://docs.google.com/open?id=0B4G...kN0Z09aVURKNkU

EDIT: In case anyone wants to actually try to run the dialog/scripts, these are the animated cameras I made to go along with it:

for the MDL file: https://docs.google.com/open?id=0B4G...i03TkdPQlRHOXM,

for the MDX file: https://docs.google.com/open?id=0B4G...C1FeTY5LVdCWHc.

You can just put them in Override along with the DLG and script files.

P.S. Yes, I know the first one isn't a very good camera move , but at least it shows whether Davik and Calo are moved.

Last edited by Taunger; 04-21-2012 at 10:04 PM.
Taunger is offline   you may: quote & reply,
Old 04-22-2012, 02:04 AM   #7
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 571
Why do you have waitflags set?
Also seems like your first node could use a delay... otherwise the fade-in doesn't really work well... or so it would seem to me.
Hassat Hunter is offline   you may: quote & reply,
Old 04-22-2012, 04:49 PM   #8
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
The WaitFlags are so it waits until the camera moves are finished.
The fade-in works fine, it continues into the second entry's camera move.

Anyway, I still have no clue what could be hampering the scripts.
Taunger is offline   you may: quote & reply,
Old 04-23-2012, 11:49 AM   #9
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 571
While I do not mod KOTOR1 and have never worked with Waitflags, looking them up here has Tupac stating they delay the node until the animated camera is done with "1". Which may be your problem here, the script triggering after the animated scene is done, and so no opening door can be seen.

As said, try delays instead (so waitflag 0). Does it work now?
Hassat Hunter is offline   you may: quote & reply,
Old 04-23-2012, 04:11 PM   #10
Taunger
Rookie
 
Taunger's Avatar
 
Join Date: Oct 2010
Location: Mos Eisley
Posts: 46
Current Game: KotOR
Sadly, the scripts still don't seem to run.

Here's the modified file: https://docs.google.com/open?id=0B4G...zRzWlhhbFVDanM
Taunger 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 > Davik's Introduction script in KOTOR 1

Tags
davik, davik kang, dialog, dlg, git, machinima, script, scripting

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:56 PM.

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