Author Topic: Editing scripts on fly on nwnx?  (Read 628 times)

Legacy_Valgav

  • Full Member
  • ***
  • Posts: 118
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« on: November 09, 2015, 11:51:45 pm »


               

Is there any way to simple debbuging of scripts? Or restarting server, login and running script with chat prints of variables is the only way to test scripts?



               
               

               
            

Legacy_niv

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #1 on: November 10, 2015, 02:42:46 pm »


               

That's quite possible and a lot of people do this:


 


You need nwnx_resman for this; make sure to grab a recent one, because there have been some memory leaks in the past.


 


Configure resman in nwnx2.ini to have a directory where it reads resources from, then place compiled scripts into <dir>/ncs/. You need a way to compile scripts - if you are on Windows, the easiest way is just to grab *.ncs from your open module directory (NWN/modules/temp0) after using the toolset compiler.



               
               

               
            

Legacy_Valgav

  • Full Member
  • ***
  • Posts: 118
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #2 on: November 15, 2015, 06:04:22 pm »


               

Many thanks, but which plugin should I use? resman on dynres?



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #3 on: November 16, 2015, 09:56:59 am »


               

dynres allows for some more complex features - eg: you get control over the dynamic resources by calling some nwnx methods.


If it is just updating scripts on the fly, then resman is the way to go - as it requires no scripting or calling of methods to update your resources, it is fully automatic



               
               

               
            

Legacy_Valgav

  • Full Member
  • ***
  • Posts: 118
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #4 on: November 16, 2015, 05:52:41 pm »


               

I assume that in dynres i have to run function to load resources? Or maybe standardo resources are loaded automatic and some more complexed cases requires using functions?


 


Also what about resources in module? Both for resman and dynres. External resource will override internal or should i exlude this script from running module?



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #5 on: November 17, 2015, 09:07:07 am »


               

DynRes - if memory serves lets you specify which files to load from disk and which to load from module/hak.


 


Both plugins will prioritize what is in the externalsources directory - over any embedded files.


I think this may also override haks - but don't quote me on that.


 


Types of files that can be overriden include:


nss / ncs 


character files / creature files


items


areas (gic, are)


blueprints of any type


journal (jrl)


factions .fac   


 


Some of those however, only get loaded at startup  - so for them to take effect (particularly the journal and factions), you may need to reboot the server.



               
               

               
            

Legacy_Valgav

  • Full Member
  • ***
  • Posts: 118
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #6 on: November 17, 2015, 09:24:49 pm »


               

Resman seems to favor internals over externals. Or did i missed something in my settings?


 


If not my only chance is probably dynres with full scan on heartbeat but i have no idea how to give nwn full list of files for dynres resources names strings.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #7 on: November 19, 2015, 03:03:35 pm »


               

depends on version and platform you are working on.


 


I think for linux - you must make sure that all your resource names are lowercase, they may also need to be in subfolders within the externalsources directory, according to their file type.


 


On windows - scripts and stuff can be in the main folder - but for areas, I need to have gic and git files inside a folder called are.


 


ResMan should prioritize externals first.


Check log file and post it here if you run into issues.



               
               

               
            

Legacy_Valgav

  • Full Member
  • ***
  • Posts: 118
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #8 on: November 19, 2015, 06:07:58 pm »


               

You probably have this version. Am I right?  '<img'>


 


I'll try compile my own version.


 


EDIT: I've getting some errors. '<img'> Could you share your version? 



               
               

               
            

Legacy_Valgav

  • Full Member
  • ***
  • Posts: 118
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #9 on: November 19, 2015, 10:10:11 pm »


               

Finally I compiled that method. But it seems to by one way. Once it register external resource it's in memory and you can get back to internal without restarting. Even deleting of that file didn't helped.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Editing scripts on fly on nwnx?
« Reply #10 on: November 19, 2015, 11:21:50 pm »


               

Fraid not - the one I use isnt configured to allow internal to be used again