Author Topic: Submitted a TMI Plugin (another version) to the vault  (Read 245 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« on: January 01, 2011, 03:04:37 am »


               This is a Windows Plugin for nwnx-windows, which may be of use to people who have real problems with the TMI Limit in nwnscript.


http://nwvault.ign.c....Detail&id=1482

When it gets approved, it should appear here.

This is a derivitive work off Addicted2rpg's work - I looked on the vault for a way to contact him, but couldnt find one. Oh well....
I just dont want people thinking I am taking credit for his plugin, he totally made the plugin base, I just added a little extra functionality to it.

Basically, he made a windows plugin which allowed the raising of TMI Cap on start up of the server - via reading from the nwnx.ini


I pretty much pieced together parts of the existing code, and made it possible for the plugin to set the TMI Limit via nwn script in addition to the start up method.

(This is probably something that Linux servers already had via nwnx, but I think Windows guys werent quite there yet)


Basically, setting the TMI Limit via nwnscript is done via.


void NWNXTMISetTMILimit(int nTMICap)
{
 SetLocalString(GetModule(),"NWNX!TMI!SET",IntToString(nTMICap));
 DeleteLocalString(GetModule(),"NWNX!TMI!SET");
}

And then called like so -

NWNXTMISetTMILimit(4);  //Doubles the Bioware TMI Cap
NWNXTMISetTMILimit(8);  // Bioware x4
NWNXTMISetTMILimit(16);  // Bioware x8


I was attempting to get Unlimited TMI Cap working from nwnscript, but that part wasnt working - trying to set unlimited seemed to crash the server, as such, I commented that code out - perhaps someone else can continue to work on it.

That being said... Unlimited TMI Cap is a dangerous thing, and with the current functionality, there really isnt much need for it anyway.

If you have a script that takes longer than
NWNXTMISetTMILimit(20);  to finish..... then there might be something wrong.


There isnt much validation in this version of the plugin from nwnscript, so just make sure you send it a positive number for the cap value.

2 is the default Bioware value.


Note - I know this is more a nwnscript forum, but this plugin doesnt look like it would 'belong' in the plugin/dev forum, with other apps and such.

Besides, TMI is a real problem that many people have with 'Scripting'    its a potential fix for windows users who encounter the problem, and have to find alternative ways around it.


Note - Source code is included too.
               
               

               
            

Legacy_NorthWolf

  • Full Member
  • ***
  • Posts: 143
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #1 on: January 02, 2011, 07:13:59 pm »


               Good work.



In the end I'm pretty sure you can't give an infinite TMI cap. I think this was covered over the Linux development, but I imagine Virusman could give you an exact number.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #2 on: January 03, 2011, 07:16:31 am »


               The original linux nwnx_system plugin by acaos allows TMI limits up to 8 million:


/* Set the current process TMI limit, with a minimum of 16k and a maximum of 8M. */
void SetTMILimit (int nLimit);

Funky
               
               

               


                     Modifié par FunkySwerve, 03 janvier 2011 - 07:17 .
                     
                  


            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #3 on: January 03, 2011, 11:27:29 am »


               I've ported the Linux version:

http://www.nwnx.org/...p?p=13987#13987
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #4 on: January 04, 2011, 02:08:15 pm »


               I would recommend using Virusman's ported version,

That being said, it was a good plugin for me to get some experience with.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #5 on: January 04, 2011, 08:03:56 pm »


               I'd be interested to see a diff, since I'm planning to start tinkering with plugins as well, no doubt to the utter horror of virusman. '<img'> It'd be good to know what API issues there were, to avoid them myself.



Funky
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #6 on: January 04, 2011, 08:20:08 pm »


               I thought when he said API issues, he meant perhaps the calling conventions I used in my first version.



I used

NWNX!TMI!SET  

where as the linux version used

NWNX!TMI!SETLIMIT



Maybe I misunderstood.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #7 on: January 05, 2011, 12:52:56 am »


               So the link first posted above is for the windows version, and can be scripted in game through a script file is what your saying correct.  the prginal windows tmi version does allow unlimeted but its not recomened.  Thanks for the xtra script function Baaleos, it will make it nice to be able to udjust it in came to insure no TMI error.  I'll give it a look.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Submitted a TMI Plugin (another version) to the vault
« Reply #8 on: January 05, 2011, 11:39:11 am »


               One difference though, to be aware of.

In Virusman's version, you need to set the TMI via setting an ACTUAL limit.



eg

a Value of 1200000   is valid



the one I posted takes multipliers

a Value of 2 = Bioware Default, 4 = Double the Standard, and 8 = 4x the Standard.