Author Topic: Help on the Last Part of Making Scripts...  (Read 760 times)

Legacy_GlowingCactus

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Help on the Last Part of Making Scripts...
« on: April 23, 2016, 12:14:15 am »


               

I've recently picked up Neverwinter Nights for a play through, and I've also ordered NWN2. Both these games are long overdue a playing but I want to play them as me.  The PRC pack has helped a lot but it doesn't do everything I want.  So I've thrown some code together (I'm an amateur coder at best but I'm confident in what I've written.)


I've google the heck out of the internet for an answer, I've read through dozens of PDFs.  Plenty of guides to help with coding but very few of them finish it off with the important bit; compiling.  How do I compile?


 


I've got the most modern nwnsscomp.exe from neverwintervault.org and placed it in /utils/, I've got a command line open and finding my directory of scripts but the compiler can't find all the built in NWN functions I've used.  I've used the the right #includes but still can't find them.  I've tried compiling others hak-paks (heck even one of the PRC hak-paks!) But it won't find all the includes so I can't compile everything.

Can someone give me a few step by steps on how to compile please?  


(I'm using Windows as an OS, I can do DOS but I'm not that familar with much else, python etc.)



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Help on the Last Part of Making Scripts...
« Reply #1 on: April 23, 2016, 12:10:57 pm »


               

You don't actually have to compile as NwN will do that on the fly. Because this can in some cases cause lag, some people like to use an external compiler so that NwN doesn't have to. Since I've never had a need to use any of these compilers I'll let someone else chime in on their use. The only thing I do know is that they are command line compilers so you might find it easier to write one or more batch files to automate the process once you know what to do with them.


 


BTW You do have copies of both the lexicon and Lilac Soul's Script generator don't you? Also there is a continuously updated online version of the lexicon, the link for which is on the downloadable version's web page.


 


TR



               
               

               
            

Legacy_GlowingCactus

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Help on the Last Part of Making Scripts...
« Reply #2 on: April 23, 2016, 04:38:34 pm »


               



You don't actually have to compile as NwN will do that on the fly. Because this can in some cases cause lag, some people like to use an external compiler so that NwN doesn't have to. 




 


That would make sense why all these guides don't mention the steps of compiling when I can dump all my .nss files in a hak-pak and NWN will do it for me!  Not convinced this will be a quick and easy way, an external compiler would still be very useful.

 





The only thing I do know is that they are command line compilers so you might find it easier to write one or more batch files to automate the process once you know what to do with them.





 


I have no worries using the Command Prompt of windows, I was using a .bat file with the nwnnsscomp.exe script, saved typing in a lot but I didn't get the error messages very long. so whilst I was trying to get things to work I was copy/pasting the commands.  Yeah, automation would be great but I can't get the compiler I do have to find all the includes, so to anyone else fixing that, educating me, or pointing one out I could use would be great. '<img'>


 





BTW You do have copies of both the lexicon and Lilac Soul's Script generator don't you? Also there is a continuously updated online version of the lexicon, the link for which is on the downloadable version's web page.


 


TR




 



I've been using the Lexicon online.  I picked up Lilac Soul's Script Generator this afternoon but it was still sitting in my downloads folder when I wrote on the board! '<img'>  Good call, I'd seen it mentioned a lot but almost every link I clicked to get it was dead.


 


I've opened LSSG and planted in some test code and it compiles, yay!  But I haven't worked out how to compile multiple files or load a file because it is only compiling the code I pasted into the window.  I suppose one big script file is better than none.



 


Thank you very much Tarot Redhand, you did what Kaylee didn't in Out of Gas; "you got me limpin'". '<img'>


 


If anyone else has some tips, guides or advice on using external NWN Script Compiler's that would be great.



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Help on the Last Part of Making Scripts...
« Reply #3 on: April 23, 2016, 05:50:43 pm »


               

Just a thought but does the online lexicon say anything about the compilers? Also you don't have to put your script sources into a hak file (IIRC you only do that for compiled scripts). You would normally export script source in an encapsulated resource file (aka erf). To do that you go to file/export and use the tool that comes up.


 


TR



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Help on the Last Part of Making Scripts...
« Reply #4 on: April 23, 2016, 06:09:33 pm »


               The simplest approach is to open the script in the toolset, then use the Save-and-Compile button top left.

NWNTX is a toolset extension that improves performance (including a compiler many prefer).

There are batch compilers such as PRC and others on the same site, but I'm not sure which of them is the best.