logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Resource Manager Plugin
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Mon Feb 21, 2005 23:23    Post subject: Reply with quote

I was assuming that a module cached script would only be loaded once by the resource plugin at module load. After running the plugin for a few days now I am not sure that is the case. It seems if the resource plugin loads the script once it will load it each time even if the module says its a cached script. Does everyone else confirm this behavior?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Feb 22, 2005 18:00    Post subject: Reply with quote

The resource manager plugin does not care whether a script is cached or not. Since it will have its own cache, that should not impose any problems.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Liberty Valance



Joined: 06 Jan 2005
Posts: 21
Location: A Persistent World West2

PostPosted: Mon Mar 14, 2005 23:11    Post subject: Reply with quote

perhaps i missed something (i'm @ the end of lunch and had to skim)... how is RM's cache going to work? will users get to specify what scripts get cached, or will caching be automatic, or will there be some sort of "intelligent" caching?
_________________
A Persistent World West2 | APWW2 Forums
Wirehead Studios
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Thu Mar 17, 2005 10:00    Post subject: Reply with quote

I am planning to create a LRU cache. Users will be able to specify the total cache size, but not what actually gets cached and what not - I do not think this is necessary anyway.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Senach
Guest





PostPosted: Wed Mar 30, 2005 6:41    Post subject: Sounds great, but I am an idiot Reply with quote

Okay, this looks very cool, esp for debugging, but...

I cannot get the plugin to find my external resources. I have the default 'scripts' folder and its resources for the demo 'ScriptMod' in several places:

NWN/scripts
NWN/modules/scripts
NWN/modules/temp0/scripts

I also just put the scripts directly into NWN/modules/temp0, hoping the plugin would find them there. No avail.

Any help? Thx.
Back to top
Alosynth



Joined: 06 Jan 2005
Posts: 24

PostPosted: Thu Mar 31, 2005 4:16    Post subject: Reply with quote

You need to modify your nwnx.ini file to tell it where to point to.

For myself, I have the following section added to the nwnx.ini

Code:
[RESOURCEMANAGER]
MaxLogSize = 512 ; in KByte
LogLevel   = 1 ; 0= nothing, 1=Resource Manager specific info, 2=list of all loaded resources
; Where Resource Manager loads the scripts from. Note the trailing backslash.
SourcePath = scripts\


This points the manager to a scripts folder in my nwn folder.
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Apr 04, 2005 18:54    Post subject: Reply with quote

Hmm, thought I did that. Let me 2x my setup. I hope it was something basic like this...
Back to top
Senach
Guest





PostPosted: Mon Apr 04, 2005 19:19    Post subject: I am lazy. Redux. Reply with quote

Quote:
I hope it was something basic like this...


Woot! It works great, and I must be a moron.

Debugging is now going to be that much easier.

Thanks.
Back to top
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue May 31, 2005 20:11    Post subject: Reply with quote

Just jumping on the band-wagon...

Using the ExecuteScript hook, would it now be possible to add parameters to scripts?

My thoughts were along the lines of assigning (compiled) code-block references for script constants.

eg
ExecuteScript("AddGold.ncs(50)",OBJECT_SELF);
// name just an example for simplicity.

// AddGold script
const string P1 = ??? // the ??? gets replaced/substituted in code-block
void main()
{
GiveGoldToPlayer(StringToInt(P1));
}

I don't know what state the script gets compiled to, but I would think that the constant for a string would be a pointer/offset that could be determined and a new value given - pointing to the string of bytes tagged on to the original code-block.

Cheers
Gryphyn

"If you've done three impossible things today..."
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Jun 01, 2005 20:56    Post subject: Reply with quote

I have hooked a function (or two) that deals with resource loading in general, so it is unlikely that the same function can be exploited for scripting specific purposes.

I guess it would be possible to do it with some more assembler and hooking, but as is often the case, time is the limiting factor here.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Thu Jun 02, 2005 5:05    Post subject: Reply with quote

NP,
I understand being 'time-poor'.
If the idea gets onto a 'Investigate-pending' state is good enough.
(afterall, you've only been at it a couple of weeks)

Cheers
Gryphyn
Back to top
View user's profile Send private message
jedi156



Joined: 07 Jul 2005
Posts: 1

PostPosted: Thu Jul 07, 2005 20:59    Post subject: Reply with quote

Quote:
From cahngelog.txt
* 12.02.2005: v0.2
- Support for many additional resource types: creatures, items, dialogs, placables, ...


Just wondering what the ... is? Could it include areas? Idea
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Thu Jul 07, 2005 22:57    Post subject: Reply with quote

In its current compiled state areas can not be loaded dynamically with the resource plugin because they are all loaded at the beginning from module resources. Since the module file itself can not be saved with erroneous (or absent) area files what is in the module is what is loaded without exception.


However.... its possible to rewrite the resource plugin to except file types so, let's say, all area files are loaded from the hard disk when called. I have been thinking about doing this.
Back to top
View user's profile Send private message
Themicles



Joined: 23 Jan 2005
Posts: 30
Location: Wolverine Lake, MI

PostPosted: Thu Aug 25, 2005 12:32    Post subject: Reply with quote

Alosynth wrote:
One feature I would like to see though (if its possible) would be the ability to to specify a specific subfolder based on the type of resource you are looking for in nwnx.ini. This way I could have a folder for scripts, a seperate folder for creatures, a seperate folder for items etc.


Seconded...
_________________
World Leader of Tairis'nądur http://www.tairisnadur.com
Member World of CoPaP http://www.copap.org
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Themicles



Joined: 23 Jan 2005
Posts: 30
Location: Wolverine Lake, MI

PostPosted: Thu Sep 01, 2005 21:06    Post subject: Reply with quote

Pap, did I ever tell you that you are something like a god in this community? Wait, I think I have. Razz

This plugin has vastly improved the development speed of my Renewable Resources system. I have only opened the toolset once in the last week or so.

I've even made a new script to spawn items that were never in the module to begin with. It's not perfect... would work better if I made an item with attached dialog, and all that stuff. But as it is, it's working for what I need (when the server is empty). I foresee all new RRS plants being made without opening the toolset. This makes me quite happy. Very Happy

Interesting thing of note: If you delete placeables from the directory, or from the Export menu, they still show in the palette, and can actually be spawned from the DM's creator menu. Yes, I made absolute sure that they were being pulled from the external folder.

If you delete items from the directory, or from the Export menu, they still show in the palette, but fail to create from either the DM Creator, or even the DM console command. This is why I made a script in which I just change the resref in CreateObject. Creating external items from script works just fine.

-Themicles
_________________
World Leader of Tairis'nądur http://www.tairisnadur.com
Member World of CoPaP http://www.copap.org
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 2 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group