Complete D'Jinni NWNScript function reference...

+
Complete D'Jinni NWNScript function reference...

I was trying to find out how to display an image on the screen, to make a simple version of the sex cutscene, so I needed to find out what functions the NWN Script compiler understands. So I was digging through my Witcher installation trying to find the NSS compiler and library files, when I found something even more useful - the file which provides the context sensitive help text for the NSS editor. It's called nss.api and you will find it somewhere like
Code:
C:\Program Files\The Witcher\System\Scintilla\nss.api
I've written a very rough rough parser which parses this file into Wiki markup and added the results to the D'Jinni wiki, here.Some words of caution:
  • I (obviously) haven't tested all these functions - there are 872 of them
  • I haven't even tried to translate those functions documented in Polish (a substantial minority)
  • This data is almost certainly copyright BioWare and CD Project Red (although in my defence the file doesn't acually say so), so I may get asked to take the page down..
  • The formatting isn't perfect (it was a very rough parser)
As well as function definitions the file also contains a large number of constant definitions many of which are equally helpful. If people pester me I'll wikify these as well.If someone wants to break my one humungous page into individual pages of each function, that would be useful (but of course a lot of work). The functions could then be categorised by area, which would be useful.I hope this is useful to everyone...And the punchline? As far as I can see there is no function to display a TGA (or any other) image to the screen, so my work was in vain.
 
Simon? Would you like our mostly-interpreted of the nwscriptdefn file? Which lists tons of scripts and how to use them made for The Witcher?
 
Simon, I think I have just the thing for you.How to make an illustration cutscene1. Prepare an image as a nice high-resolution picture (2048x2048 is nice, 1024x1024 would be slightly stretched on 1280x# displays); the image should be in the top 2048x1152 area).2. Save the image as fb_blablabla.dds (whatever, as long as it's exactly 12 characters until the dot, this is important)3. Copy fb1_01_01_01.mdb to fb_blablabla.mdb and hex-edit it to replace all "fb1_01_01_01" with your "fb_blablabla" (the name has exactly 12 chars, that's why it was important).This gives you a model of a flat "billboard" image with your illustration on it. Now, what to do with it:1. Create a cutscene and place the billboard in it somehow (replace an existing object, or hide this object underground...)2. Place a camera looking at it and do whatever you want. Zoom in, zoom out, pan around it...3. Oops, your illustration is likely to be too dark! Let's pump up the ambient, and kill the color glow while we're at it. Add this line when your illustration appears, in a "LUA Line" track: console "mainscene.ambient 1 1 1"; g_CameraGob:StopFullScreenEffect("ColorGlow")And, when you're done, at the end of the cutscene, put console "mainscene.ambient 0 0 0"; g_CameraGob:StartFullScreenEffect("ColorGlow") to bring things back to normal.(if anyone wonders, it can all be found out by analyzing one of the fb* cutscenes.)That should do it.-- Sinus
 
Ailinon said:
Simon, I think I have just the thing for you.
How to make an illustration cutscene1. Prepare an image as a nice high-resolution picture (2048x2048 is nice, 1024x1024 would be slightly stretched on 1280x# displays); the image should be in the top 2048x1152 area).2. Save the image as fb_blablabla.dds (whatever, as long as it's exactly 12 characters until the dot, this is important)3. Copy fb1_01_01_01.mdb to fb_blablabla.mdb and hex-edit it to replace all "fb1_01_01_01" with your "fb_blablabla" (the name has exactly 12 chars, that's why it was important).This gives you a model of a flat "billboard" image with your illustration on it. Now, what to do with it:1. Create a cutscene and place the billboard in it somehow (replace an existing object, or hide this object underground...)2. Place a camera looking at it and do whatever you want. Zoom in, zoom out, pan around it...3. Oops, your illustration is likely to be too dark! Let's pump up the ambient, and kill the color glow while we're at it. Add this line when your illustration appears, in a "LUA Line" track: console "mainscene.ambient 1 1 1"; g_CameraGob:StopFullScreenEffect("ColorGlow")And, when you're done, at the end of the cutscene, put console "mainscene.ambient 0 0 0"; g_CameraGob:StartFullScreenEffect("ColorGlow") to bring things back to normal.(if anyone wonders, it can all be found out by analyzing one of the fb* cutscenes.)That should do it.-- Sinus
That does indeed look like exactly what I want! Thank you very much.
 
PaulV said:
Simon? Would you like our mostly-interpreted of the nwscriptdefn file? Which lists tons of scripts and how to use them made for The Witcher?
I could use this too, please... :)@Simon: Thanks, Simon, this is really useful... ;)
 
Ailinon said:
Simon, I think I have just the thing for you.
How to make an illustration cutscene1. Prepare an image as a nice high-resolution picture (2048x2048 is nice, 1024x1024 would be slightly stretched on 1280x# displays); the image should be in the top 2048x1152 area).2. Save the image as fb_blablabla.dds (whatever, as long as it's exactly 12 characters until the dot, this is important)3. Copy fb1_01_01_01.mdb to fb_blablabla.mdb and hex-edit it to replace all "fb1_01_01_01" with your "fb_blablabla" (the name has exactly 12 chars, that's why it was important).This gives you a model of a flat "billboard" image with your illustration on it. Now, what to do with it:1. Create a cutscene and place the billboard in it somehow (replace an existing object, or hide this object underground...)2. Place a camera looking at it and do whatever you want. Zoom in, zoom out, pan around it...3. Oops, your illustration is likely to be too dark! Let's pump up the ambient, and kill the color glow while we're at it. Add this line when your illustration appears, in a "LUA Line" track: console "mainscene.ambient 1 1 1"; g_CameraGob:StopFullScreenEffect("ColorGlow")And, when you're done, at the end of the cutscene, put console "mainscene.ambient 0 0 0"; g_CameraGob:StartFullScreenEffect("ColorGlow") to bring things back to normal.(if anyone wonders, it can all be found out by analyzing one of the fb* cutscenes.)That should do it.-- Sinus
I've done all that. I now have a huge, black square that slides into place at the right moment...But it's completely black.Does this mean my DDS is not in the right place (it does show up under 'DirectDraw surface textures) or is there something else which could be wrong?
 
A simple question, but sometimes its the simple things that get overlooked.Is your DDS height and width sizes a factor of 2? For example 1024x1024, 512x512, 512x256. Height and width do not have to be equal, but they do need to be a factor of 2.
 
Is the DDS's name correctly referenced by the MDB? Has the engine been reloaded (sometimes it's needed)? Is the black square lit by any lights (pump ambient up)?-- Sinus
 
Top Bottom