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 
 
NWNX_COOL Issues
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sat Jul 19, 2014 5:09    Post subject: NWNX_COOL Issues Reply with quote

I'm not really sure what is up with the event activation for it's giving a strange error.

o UseSkill: 7ffffe9
skill: 22
arg: 0
arg3: 7fffffe9
vTarget X: 0.000000 Y: 0.000000 Z: 0.000000
target2: 000008ab
target3: 7f000000
arg6: 0
NwScript Invalid Command: 0 - EVENT
NwScript Invalid Command: 0 - DATA

The thing is I haven't done anything except have it write to log file so I can simply check it lol.....

The script is:

Code:
else if( nEvent == 5 ){

      SpeakString( "UseSkill: "+IntToString( nData ), TALKVOLUME_SHOUT); //Used for debugging since write to log for some reason never worked, this isn't working either however.
WriteTimestampedLogEntry( "Target: "+ GetName( GetEventTarget( ) ) );
WriteTimestampedLogEntry( "Target2: "+ GetName( GetEventTargetSecond( ) ) );
}


Some useful information.... I use nwnx_events, but it has no hooks for skills so I can't understand why they would conflict.

Why do I use nwnx_events? Because for some reason nwnx_events has SAVECHAR event and nwnx_cool doesn't and I use this when people have guild accounts on the server it requires a password which means if I allow saving the character before they input the password(which they can as they have to log the character to enter a password) then they just copy builds from guild accounts.

What is hooked with nwnx_events?
Download character
Attack
ExamineItem
ExamineCreature
ExaminePlaceable
ExamineDoor
ToggleMode
StealthMode
Unpolymorph
TrapTrigger
EndDialog
RemoveSanctuary

I'm sure many of these can be cancelled and replaced with nwnx_cool if there is conflicting hooks, however SAVECHAR is a must have.
To save time: If I must completely deactivate nwnx_events then please hook SAVECHAR to cool or cool is worthless to me. As that is a massive exploit.

The ONLY thing presently active for cool is UseSkill as I wanted to avoid conflicting until I could consolidate at a better time.

Thank you for any information! Very Happy
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sat Jul 19, 2014 16:16    Post subject: Reply with quote

Best I can do is nwnx_events 2 from here: https://onedrive.live.com/?cid=964767FB0C3A645B&id=964767FB0C3A645B!4553 (don't forget the !4553part) It got the events you're looking for.

find the dll in the release folder and the nwn script in the nwscript. The script and or the logfiles produced by the plugins hold most info on what they do and what functions they got. ini snippets should be commented in the nwscript or shown in the logfile. If you're fluent in lua you'll love nwnx_lua, that has a bunch of interesting functions.

Or here: http://www.nwnx.org/phpBB2/viewtopic.php?p=16517#16517
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sun Jul 20, 2014 1:56    Post subject: Reply with quote

That is unfortunate, I thought nwnx_cool was a really nice .DLL, but oddly nothing I ever tried to do with it worked.

Although I only ever tried the random function for it and now the skill hook.

Do you know why it's not working? By the way I appreciate the time you spent to help! Very Happy

I don't see an actual .DLL for nwnx_events. Just download the whole folder?
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sun Jul 20, 2014 2:24    Post subject: Reply with quote

I never had any issues with it, I broke it up though and started other projects. There are several versions floating around and I don't really remember which is which. At some point the nwscript lib and nwnx_cool updated so if you're running a new version of cool with the old nwscript you'll have problems.

Anyway, a lot of if not all of cools functionality and events can be found across the plugins I posted. nwnx_events has all those events, including savepc, examine, skills, feats, etc. You got the lua plugin which has a while library of nwn related functions which are either more elaborate or the same as funcs and cool.

What lua can do: http://pastebin.com/xsY6rESY
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sun Jul 20, 2014 3:45    Post subject: Reply with quote

Nevermind the previous question, I figured out the layout lol.

Does devcrit and pickpocket work well with the new version of nwnx_events? I remember I had them before and just having them active did... Weird things.

EDIT: What exactly does LUA do? I've never actually heard of the language before. Is it essentially like ruby for nwnx linux version? If so what are it's limitations in the server's operating environment?
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sun Jul 20, 2014 8:01    Post subject: Reply with quote

Is it still possible to get a current form of nwnx_cool? I feel like I never got a chance to use the plugin lol, which is sad for the guys who made it.
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sun Jul 20, 2014 13:11    Post subject: Reply with quote

I made cool way back, its not all that stable and there is a bunch of stuff that doesnt work.

I broke it up so you can get most of cools functionality from the plugins:

nwnx_weapons: the ability to set what feats weapons corresponds too, see nwscript lib.

nwnx_ubab: allows you to set ubabable weapons, see nwscript folder for ini snippet.

nwnx_lua: advanced functions such as GetSet feat, skills, name, base desc etc look at above logfile. Along with everything lua 5.2 has: http://www.lua.org/manual/5.2/ the file nwn_internals can be run and demonstrates how to use nwscript functions in lua, all datatypes doesnt work. I left an example lua file in the nwscript folder.

nwnx_minipatch: see minipatch ini snippet in nwscript folder.

nwnx_events: has the events from cool that worked properly.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
leo_x



Joined: 25 Aug 2010
Posts: 75

PostPosted: Sun Jul 20, 2014 20:24    Post subject: Reply with quote

highv priest wrote:
EDIT: What exactly does LUA do? I've never actually heard of the language before. Is it essentially like ruby for nwnx linux version? If so what are it's limitations in the server's operating environment?


I'm going to butt in, and I apologize, since I've spent a lot of time working with Lua for NWN on Linux and like the language a lot. Lua (it means moon in Portuguese, so not all caps) is one of the most widely used scripting languages in game development. WoW, CryEngine, Civilization, many more use it. It's dynamically typed unlike NWScript. It has two wonderfully engineered implementations.

I'm using LuaJIT by Mike Pall in production on my sever and I've completely replaced the NWN scripting engine AND the combat engine with it, the core of the latter is here, if anyone is curious what can be done: https://github.com/jd28/Solstice/blob/master/src/solstice/attack.lua. Docs are here for the whole thing: http://jd28.github.io/Solstice/

What's more it averages under 200 microseconds per attack! So it is(/can be) fast, basically as fast as the original C++ engine.
_________________
the awakening (PW Action)
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Mon Jul 21, 2014 0:56    Post subject: Reply with quote

Oh my god.....

It's just out there how far you guys are going with nwn with a simple program as a memory editor. Rewriting the whole combat engine lol

Isn't that what the nwnx program is? A memory editor that you find the memory addresses and then just hook them such as Cheat Engine?

I feel like I missed out on the nwn revolution somewhere.

Just amazing work guys... I'll work to add Lua to my list of languages, but I have one question... How is Lua actually making these changes to nwn? I downloaded it, but the .nss file had only one single function.. A command function to tell Lua to do something customized I imagine.

EDIT: Perhaps a better way to put it... How does this abstract language with which has no core to nwn's default functionality change nwn's functionality? How does Lua know the memory locations to edit? Do I need to look these up ala OllyDbg/IDAHexstrings/Cheat Engine? or will Lua just target these memory addresses via some internal mechanism already in place?
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Mon Jul 21, 2014 1:03    Post subject: Reply with quote

For Terra! The OnUseFeat Event for nwnx_events.... Is that meant for static feats for which there is scripts(IE Barb Rage) or does it work with feats that are activated(IE Called Shot)?
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Mon Jul 21, 2014 15:49    Post subject: Reply with quote

It'll be called by the time you use the feat, as in when it gets added to the action queue. As for lua, the functions are programmed into lua from the C side of the API, if the function exists in lua then its good to use. My version of lua however doesnt replace anything, it just extends the normal nwscript.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Tue Jul 22, 2014 3:36    Post subject: Reply with quote

There is no actual commands within either the LUA or nwscript download. That's why I'm asking XD.

I do appreciate you giving me a list of labeler functions, but it has no actual script to trigger LUA to do something and I'm trying to find where that is.

Thank you for assistance! Very Happy
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Tue Jul 22, 2014 15:39    Post subject: Reply with quote

in the example file. You can pass lua code to the lua engine with the execute functions found in nwnx_lua.nss
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Wed Aug 20, 2014 0:15    Post subject: Reply with quote

I think I understand.... So these functions here would be executed INSIDE the Lua execution function?

ExecuteLuaString(OBJECT_SELF, "void SetLuaTMI( 10000 );");

So according to your explanation that should raise the TMI limit to 10,000(or rather keep it the same)?
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Wed Aug 20, 2014 19:37    Post subject: Reply with quote

That won't do anything for the nwscript TMI, its for the lua one. A security measure I added for the same reasons as nwscript has it, it won't hang your server if you should go into an endless loop. Also, the functions presented in the logfile is within a lua table called "nwn" so the correct call would be:

ExecuteLuaString(OBJECT_SELF, "nwn.SetLuaTMI( 10000 );");

You could also do stuff like:

ExecuteLuaString(OBJECT_SELF, "local pc = nwn.GetFirstPC(); while nwn.IsValid( pc ) do nwn.SendMSGToPC( pc, 'Meow!'); pc = nwn.GetNextPC(); end");

Or

string s = ExecuteLuaString( OBJECT_SELF, "meowmeow()" );

s would contain the string "ERROR: Attempted to call meowmeow a nil value". So the nwscript function will return error codes or empty string if its ok.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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