DarthRevan101

How would I go about doing this?:

Recommended Posts

For a mod I'm working on, I need to make a situation where once the PC enters a certain planet, with a certain party member, during a certain part of a quest an NPC will appear when the module loads. Like when you here about Bastila's mother or Mission's brother. Where would I even start going about this? :P

Share this post


Link to post
Share on other sites

For a mod I'm working on, I need to make a situation where once the PC enters a certain planet, with a certain party member, during a certain part of a quest an NPC will appear when the module loads. Like when you here about Bastila's mother or Mission's brother. Where would I even start going about this? :P

You would need the globals of the quest, and then you'd need to edit (decompile with DeNCS) the OnEnter script (check the .are or .ifo file) to check for the party member and the variables.

 

Alternatively to the globals, you could check the journal's entry for a particular quest...

Share this post


Link to post
Share on other sites

You would need the globals of the quest, and then you'd need to edit (decompile with DeNCS) the OnEnter script (check the .are or .ifo file) to check for the party member and the variables.

 

Alternatively to the globals, you could check the journal's entry for a particular quest...

 

In DeNCS I get this message;

error cannot open actions file  C:/windows/system32/nwsscript.nss

 

Nevermind, according to the readme DeNCS only works for TSL.. :P

Edited by DarthRevan101

Share this post


Link to post
Share on other sites

In DeNCS I get this message;

error cannot open actions file  C:/windows/system32/nwsscript.nss

 

Nevermind, according to the readme DeNCS only works for TSL.. :P

 

It works perfectly fine for K1 too, you just have to swap DeNCS' default nwsscript.nss (the TSL version) with the K1 version. I think it's in the main DeNCS installation folder.

Share this post


Link to post
Share on other sites

decompile with DeNCS

 

Btw, this might be relevant to your interests: I've been writing an NCS disassembler the last few weeks, which can disassemble all NCS scripts found in Neverwinter Nights to Dragon Age II, including KotOR and KotOR2. Doesn't need an nwscript.nss either.

 

It's assembly output looks like this. It also does some stack analysis and marks subroutines with a full signature, i.e. the numer of arguments and their types, and the return type (or types, in case of a subroutine returning a struct).

 

It can also create a DOT graph description file, which can be used by Graphviz to draw a control flow graph, like this here, which makes scripts either to understand, I find.

 

I've also added a simple control structure analysis, which makes it detect do-while and while loops, as well as if and if-else. An artificial example would be here. The next step is adding simple C-like code generation, to expand it into a proper decompiler. I.e. the result will be something close to the original NWScript source. Minus variable names, of course. And it'll be a lot more verbose at first. And I'm not yet handling structs and vectors as joined either.

 

There's no binary release yet, but the source can be found in the xoreos-tools repository. Specifically, ncsdis.cpp and the nwscript/ directory.

 

Anybody interested in expanded this is of course always welcome; please feel free to contact me. I also have an assembler and a compiler (to replace the old OpenKnights nwnnsscomp in all its different flavours) on my TODO list; that'd be up for grabs too.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.