View previous topic :: View next topic |
Author |
Message |
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Mon Apr 21, 2014 0:12 Post subject: |
|
|
Rand returns a pseudo-random integral number in the range between 0 and RAND_MAX. RAND_MAX = 32767. So with that URL you're requesting the same range as normal rand.
This has more on the requests: https://www.random.org/clients/http/ whats crucial though is that the plugin receives a plain list of numbers and that those numbers are castable by atoi. You should probably avoid giving nwn negative numbers too, got no clue how it deals with those. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Mon May 05, 2014 7:35 Post subject: |
|
|
What does the NoReuse actually do? At what point does it start pulling numbers from the already generated .RND files before it pulls new ones from Random.org? |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Mon May 05, 2014 15:03 Post subject: |
|
|
The plugin reuses the numbers it has internally before requesting more numbers, using the newest numbers first before the old.
NoReuse means it won't reuse the numbers it has in memory. So if you do this:
Code: | [RANDOM]
Cache="D:/rand/"
MaxCache=0
Log=false
NoDownload=false
PreferStock=false
NoReuse=true
DownloadUrl="http://www.random.org/integers/?num=10000&min=0&max=32767&col=1&base=10&format=plain&rnd=new"
QuotaUrl="http://www.random.org/quota/?format=plain" |
My setting (above) will pull numbers from random.org everytime it runs out of numbers. If it fails it'll load from the RND files and if that fails it'll use default random. If you got the latest version from the release folder you can set MaxCache. If MaxCache is set it'll delete the oldest files until it has MaxCache of .RND files.
Keep in mind though that while the plugin is doing a request to random.org it'll freeze the game for the time it takes to download which is usually a few milliseconds. If you got multiple servers on the same IP only one should make requests as random.org disallow more then one simultaneous request. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Mon May 05, 2014 22:04 Post subject: |
|
|
Ah so the plugin will go through it's list of numbers in the mean time while it's downloading a new .RND file? So if I set the NoReuse flag it will simply just use numbers from one of the other .RND files while it downloads one?
I hate to give you a hard time over this, because I understand the language barrier, but I'm not truly understanding what you mean by "memory". Do you mean numbers it still had left from a previous .RND file? or perhaps numbers that it uses outside of random.org to buffer internet recalls? or is it randomly selecting numbers out of the loaded .RND file and simply re-using the numbers within it while it's downloading another? |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Mon May 05, 2014 22:42 Post subject: |
|
|
Memory = the number it has loaded, it loads 10,000 numbers and each time it runs out it requests a new set of 10,000. If reuse is enabled it'll also use the previous numbers after the new set is completed so the longer the server runs the less frequent the downloads are gonna be. It stores max 100 sets of random and it'll always start with the new numbers before moving onto the old. If its off it'll only keep one set loaded and when it loads a new one it'll delete the old, it won't reuse the numbers it already has.
The RND files is more like a fallback, it'll select a random (as per rand()) .RND file if downloading is disabled or if it failed to download a new set. The RND files are just txt files but I'm using another extension so it won't conflict with other files.
Its single threaded so it won't be downloading while doing something else. I could do it multithreaded I suppose but at the moment it runs fine for me so I don't think its necessary. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Sat May 10, 2014 3:27 Post subject: |
|
|
This is brilliantly well made, I'll have to send you some money in about 4 weeks, you got a paypal? I don't know what the value of USD is in Sweden, but it shouldn't be too bad. |
|
Back to top |
|
|
EzRemade
Joined: 19 Dec 2014 Posts: 3
|
Posted: Fri Dec 19, 2014 3:23 Post subject: |
|
|
Would anyone be so kind as to post a link to the latest 1.1? All the links on the web are dead atm |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Fri Dec 19, 2014 18:23 Post subject: |
|
|
https://onedrive.live.com/?cid=964767FB0C3A645B&id=964767FB0C3A645B!4553 (including the !4553 because the php link parse is arse)
The latest compiled should be in releases and if the plugin has a nwscript lib it'll be in the nwscript folder. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
EzRemade
Joined: 19 Dec 2014 Posts: 3
|
Posted: Fri Dec 19, 2014 19:22 Post subject: |
|
|
Thank you very much! Is it referred to as nwnx_weapons? I can't seem to find _cool in any of the folders. |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Fri Dec 19, 2014 19:39 Post subject: |
|
|
I don't have the nwnx cool stuff anymore, however the functionality should be in one of those plugins. Weapons is the plugin to grab if you're looking to add focuses to weapons. Events has most of the events that cool has, nwnx lua offers functions although in lua that can do plenty of character related stuff.
If you specificity need cool then try asking around, someone is bound to have a working version of it. I'd ask Baaleos. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
EzRemade
Joined: 19 Dec 2014 Posts: 3
|
Posted: Fri Dec 19, 2014 21:26 Post subject: |
|
|
I ended up picking up Shadooow's version from another post. I just noticed it was 1.0 and wanted to make sure that there weren't any major stability issues/leaks between 1.0 and 1.1 - but everything is running good and smooth!
Thanks for the replies Terra! |
|
Back to top |
|
|
Sag
Joined: 24 Sep 2009 Posts: 8
|
Posted: Fri Jan 30, 2015 6:36 Post subject: |
|
|
Here's one of the versions which I believe is latest but I cannot guarantee. The original nwvault is dead and the new one doesn't seem to have it either:
https://dl.dropboxusercontent.com/u/11009872/NWN%201/nwnx/nwnx_cool.dll
Here's my info for nwnx.ini
Code: | [COOL]
CriticalHit=0 ;Enable the ciritcal hit modifications (see inc_cool)
QuickChat=0 ;Enable the quickchat event
BNC=0 ;Enable the client connection event
PartyBug=0 ;Enable party action queue break hook (see inc_cool)
RemoveEffect=0 ;Enable remove effect hook (see inc_cool)
SR=0 ;Enable spell resistance hook
ALL=0 ;Enable everything
WriteToLogFile=0 ;Hook write to logfile to print to console, if 0 no console is created
TogglePauseState=0 ;Enable pause hook
weapon_hook=0 ;Enable weaponry hooks (see inc_cool)
Rand=0 ;Override nwns stanard random
GetCasterLevel=0 ;Enable casterlevel to be modified see inc_cool
CastSpell=0 ;Enable cast-spell event
ItemCastSpell=0 ;Enable item cast hook
Polymorph=0 ;Enable polymorph event
UseSkill=1 ;Enable use skill event
UseFeat=0 ;Enable use feat event
ToggleMode=0 ;Enable togglemode event
DevCrit=0 ;Enable dev crit event/critical hit
SpecialAttack=0 ;Enable special attack event
RemoveCombatInvisibility=0 ;Enable remove combat invis event (this runs alot)
AC=0 ;Enable AC override hook (see inc_cool)
AB=0 ;Same as above but for AB
ConsoleOnly=0 ;Print nwnx_cool to the console
RandomBuffer=1000 ;Randomized buffer array length
GuiTimingEvent=0 ;Enable timing bar event
CanLevelUp=0 ;Enable levelup overrides (see inc_cool)
AttackOfOpportunity=0 (hook attack of oppertuniy, 1 it can be disabled ingame, 2 its disabled)
Attack=0 ;Enable attack event
Trap=0 ;Enable trigger trap events
Log=0 ;Log level
Feat=0 ;Enable feat overrides (see inc_cool)
Bridge=0 ;Enable nwnx_bridge script for external coms (quite clonky to use still)
SetPVPPlayerLikesMe=0 ;Enable pvp list change event |
|
|
Back to top |
|
|
Raetzain
Joined: 02 Aug 2017 Posts: 2 Location: Florida
|
Posted: Thu Aug 31, 2017 5:29 Post subject: |
|
|
Hello, I'm attempting to use the NWNX_Cool plugin posted on the vault:
https://neverwintervault.org/project/nwn1/other/nwnx-cool
Specifically, I'm attempting to replace caster levels using On Spell Cast event hook.
I've ran into two problems:
1. Setting the "cstrlvl" on the PC Object works, but it still isn't returning that value when the GetCasterLevel function fires.
2. Using Class-Feats results in a zero value being returned for the GetCasterLevel function while on the DM Client. Example: Casting Invisibility from the Assassin class feat gives an instantaneously vanishing invisibility.
Any guidance would be appreciated. |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Sat Sep 02, 2017 18:23 Post subject: |
|
|
Raetzain wrote: | Hello, I'm attempting to use the NWNX_Cool plugin posted on the vault:
https://neverwintervault.org/project/nwn1/other/nwnx-cool
Specifically, I'm attempting to replace caster levels using On Spell Cast event hook.
I've ran into two problems:
1. Setting the "cstrlvl" on the PC Object works, but it still isn't returning that value when the GetCasterLevel function fires.
2. Using Class-Feats results in a zero value being returned for the GetCasterLevel function while on the DM Client. Example: Casting Invisibility from the Assassin class feat gives an instantaneously vanishing invisibility.
Any guidance would be appreciated. |
In this particular case the GetCasterLevel function doesn't really do anything you can't get by using GetLevelByClass(GetLastSpellCastClass()) and add something special for DM client.
I did it the hard way and just overwrote all the caster values in the actual spell scripts with what I felt they should be(using Terras SetEffectCasterLevel) and rewrote the MyResistSpell function to use my own formula for spell resistance. |
|
Back to top |
|
|
Raetzain
Joined: 02 Aug 2017 Posts: 2 Location: Florida
|
Posted: Sat Sep 02, 2017 19:29 Post subject: |
|
|
I've attempted to manually set the caster level to different values while using the DM Client. It still returned a zero for feat-based spells.
The whole point of replacing the GetCasterLevel return is to ~not~ edit every single spell in the game. |
|
Back to top |
|
|
|