Jump to content

Home

How can I make dialogue scripts?


JarrekStar

Recommended Posts

I would really like to know how can i make the correct scripts to this dialogue...Please help me! I know this may have been asked before but I just couldn't find it. So could you please tell me how to do these things? You help is really appreciated...

 

 

Dialogue:

 

(Owner) - Good day! What can I do for you?

(PC) - Well, what can you do for me?

(Owner) - I can heal you and your party!

Ok, do so then! [End dialogue]

No, thanks... [End dialogue]

(Owner) I can give you 1500 credits

Ok, do so then! [End dialogue]

No, thanks! [End dialogue]

(Owner) I can give you a completely random item...

Ok, do so then! [End dialogue]

No, thanks... [End dialogue]

Nevermind... [End dialogue]

 

I hope this is clearly understandable...

Link to comment
Share on other sites

Do you mean "How can I create a script that can do those things?" or "How can I attach those scripts to a dialog?"

 

I think you mean the first question...

 

This is what a script that gives you 1500 credits would look like:

void main() {
GiveGoldToCreature( GetFirstPC(),1500);
}

For healing:

void main() {
effect eHeal = EffectHeal(500);
ApplyEffectToObject( DURATION_TYPE_INSTANT,eHeal, GetPartyMemberByIndex(0));
ApplyEffectToObject( DURATION_TYPE_INSTANT,eHeal, GetPartyMemberByIndex(1));
ApplyEffectToObject( DURATION_TYPE_INSTANT,eHeal, GetPartyMemberByIndex(2));
}

For an item:

void main(){
object oItem=CreateItemOnObject( "item_template", GetFirstPC());
}
Link to comment
Share on other sites

The above scripts need to be named uniquely and compiled first and then placed in your override. Using KT or DLGEditor, you should see for each dialog branch a field that says something like "Script to fire for this node". Enter in the name of the script you wish to fire (not including the .ncs extension.)

Link to comment
Share on other sites

Originally posted by JarrekStar

Great I understand but I can't compile the scripts...dunno why neither with KT nor with nwnnsscomp

What do you mean by that? Are you getting any error? If yes, can you post the output from the compiler as well as the exact script you are trying to compile?

Link to comment
Share on other sites

I mean I try to compile the script (the one which gives 1500 credits) it's called hd_givecred.nss and I use the command nwnnsscomp.exe -c hd_givecred.nss

And if I try to compile it with KT it gives this error:

 

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

 

************** Exception Text **************

System.IO.FileNotFoundException: Could not find file "D:\Logs\working\hd_givecred.ncs".

File name: "D:\Logs\working\hd_givecred.ncs"

at System.IO.__Error.WinIOError(Int32 errorCode, String str)

at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)

at kotor_tool.frmProjectManager.miBuildProject_Click(Object sender, EventArgs e)

at System.Windows.Forms.MenuItem.OnClick(EventArgs e)

at System.Windows.Forms.MenuItemData.Execute()

at System.Windows.Forms.Command.Invoke()

at System.Windows.Forms.Control.WmCommand(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

 

************** Loaded Assemblies **************

mscorlib

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll

----------------------------------------

kotor_tool

Assembly Version: 1.0.1885.28829

Win32 Version: 1.0.1885.28829

CodeBase: file:///C:/Program%20Files/Fred%20Tetra/Kotor%20Tool/kotor_tool.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll

----------------------------------------

System

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll

----------------------------------------

System.Drawing

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll

----------------------------------------

Microsoft.VisualBasic

Assembly Version: 7.0.5000.0

Win32 Version: 7.10.3052.4

CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll

----------------------------------------

System.Xml

Assembly Version: 1.0.5000.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll

----------------------------------------

r7tcrod3

Assembly Version: 0.0.0.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll

----------------------------------------

3bgs83wt

Assembly Version: 0.0.0.0

Win32 Version: 1.1.4322.573

CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll

----------------------------------------

 

************** JIT Debugging **************

To enable just in time (JIT) debugging, the config file for this

application or machine (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

 

For example:

 

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

 

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the machine

rather than being handled by this dialog.

 

 

And I dont't know what to do... :confused:

Link to comment
Share on other sites

Here!

 

-------------------------------------------

NSSCOMP.bat output 2005.03.03. 16:01

-------------------------------------------

nwnnsscomp.exe version: 1.01

-------------------------------------------

Compilation complete: 1/1 file compiled

Link to comment
Share on other sites

This output is weird...you should normally get more details than that :confused:

 

I'm no expert but perhaps it is a language issue :confused: this seems to happen to people who do not have an English OS or and English Game :confused: (I could be wrong on that)

 

And you get the same results wehn you use the method indicatd by Beancounter instead of the batch file?

Link to comment
Share on other sites

Did you place nwscript.nss into the same folder as your compiler - I don't know aboutthe command prompting, but if you are compiling using the batch file provided with Robious' compiler you should be fine with just putting nwscript.nss into the same folder.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...