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_structs plugin for Linux (updated to version 2.1)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Fri May 11, 2007 21:34    Post subject: nwnx_structs plugin for Linux (updated to version 2.1) Reply with quote

This plugin allows reading and manipulation of values not normally exposed in engine structures. Right now it supports Effect and Item Property structures.

NWNX Structs plugin 2.1
http://dl.hgweb.org/nwnx/nwnx_structs-2.1.tar.gz

    Fix bug with GetEffectDurationRemaining() and GetItemPropertyDurationRemaining() not returning the correct time for long-lasting effects


Older Versions
http://www.intertex.net/~zac/nwnx/nwnx_structs-2.0.tar.gz

    Renamed CalculateEffectDurationBasis() to CalculateStructDurationBasis()
    Added GetItemPropertyDuration()
    Added GetItemPropertyDurationRemaining()
    Added GetItemPropertyInteger()
    Added SetItemPropertyInteger()
    Added GetItemPropertySpellId()
    Added SetItemPropertySpellId()

http://www.intertex.net/~zac/nwnx/nwnx_effects-1.3.tar.gz

    Code cleanup

http://www.intertex.net/~zac/nwnx/nwnx_effects-1.2.tar.gz

    Adds better documentation/prototypes to nwnx_effects.nss
    Adds GetEffectDuration()
    Adds GetEffectDurationRemaining()
    Adds CalculateEffectDurationBasis() - read the nwnx_effects.nss file for details

http://www.intertex.net/~zac/nwnx/nwnx_effects-1.1.tar.gz

    Adds GetEffectInteger(effect eEffect, int nIndex);
    Adds SetEffectInteger(effect eEffect, int nIndex, int nValue);

http://www.intertex.net/~zac/nwnx/nwnx_effects-1.0.tar.gz

    Adds SetEffectSpellId(effect eEffect, int nSpellId)


Acaos


Last edited by acaos on Mon May 19, 2008 2:08; edited 9 times in total
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri May 11, 2007 23:52    Post subject: Reply with quote

Good work.
I think that it isn't very funky to hook the middle of the function, though.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Sat May 12, 2007 0:11    Post subject: Reply with quote

Yes, that's a really ugly place to put it.

From what I could determine, that entire function I hooked is used to push and copy variables before a function call. I didn't want to hook anything but the effects part, so other variable types would not be slowed down at all.

I'm still looking for a better place to stick it. There's a call right after, but it's a computed call and can go to several different places.

Acaos
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Sun May 13, 2007 2:15    Post subject: Reply with quote

I've updated the plugin to v1.1. This adds GetEffectInteger() and SetEffectInteger().

The indices to use depend on the specific effect type. You'll need to play around to find out what's what. The index is limited to between 0 and 15 as a safety measure to prevent poking too deep into memory.

Acaos
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Sun May 13, 2007 8:40    Post subject: Reply with quote

Another update, this one to 1.2.

This adds the ability to get the duration of an effect as well as the remaining time on the effect.

The CalculateEffectDurationBasis() function must be called before calling GetEffectDurationRemaining(), targeting a creature or player. It only needs to be called once. I haven't yet managed to dig out the internal uptime timer, so this does a bit of a song and dance to determine that.

Acaos
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Wed Jun 13, 2007 8:52    Post subject: Reply with quote

Updated to version 2.0.

Plugin renamed to nwnx_structs.

This renames CalculateEffectDurationBasis() to CalculateStructDurationBasis().

Adds support for reading and manipulation of values in item property structures.

Acaos
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Mon May 19, 2008 2:09    Post subject: Reply with quote

I've updated the link to make this accessible again.

Also, I received a recent request via PM about effect icons. Although this version of structs does not support it, NWNeXalt, my new 1.69 NWNX plugin, does have an EffectIcon() function which displays icons from the effecticons.2da file.

Acaos
Back to top
View user's profile Send private message
Ginden



Joined: 07 Feb 2009
Posts: 4

PostPosted: Sun Apr 18, 2010 21:20    Post subject: Reply with quote

EffectBonusFeat prevents the use of horse menu from patch 1.69.
_________________
In Soviet Russia, NWNX edit you!
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Jun 06, 2010 3:35    Post subject: Reply with quote

acaos wrote:
I've updated the link to make this accessible again.

Also, I received a recent request via PM about effect icons. Although this version of structs does not support it, NWNeXalt, my new 1.69 NWNX plugin, does have an EffectIcon() function which displays icons from the effecticons.2da file.

Acaos
Well there is EffecIcon function and it work, a bit.

I was able to change icon to any existing one, but there is only very few unused one. Making new effect icon via adding new line into 2da and use that line number didn't worked.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Jun 06, 2010 7:03    Post subject: Reply with quote

axs wrote:
It's equal to orginal effecticons.2da icons number, 130. So you can only replace not used icons.
so thats why it didnt worked, thanks axs
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Fri Jul 09, 2010 17:00    Post subject: Reply with quote

You need to actually edit the client executable to add new effect icons, unfortunately. Here's the necessary hex editing (from our client patch on HG):

Windows Version
- This version of the client changes byte 0x15476C from 0x82 to 0xFE. This raises the limit on effect icons from 129 to 254.

Linux Version
- This version of the client changes byte 0x07B9CA from 0x81 to 0xFE. This raises the limit on effect icons from 129 to 254.

Acaos
Back to top
View user's profile Send private message
Ravine



Joined: 26 Jul 2006
Posts: 105

PostPosted: Wed Dec 01, 2010 12:31    Post subject: Reply with quote

To be specific: the SetEffectCreator and SetEffectSpellId works, but only inside the script which modified it. When i check the spellId from other scripts, the ID returns the original value :S
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Dec 15, 2010 11:50    Post subject: Reply with quote

nwnx_structs manipulates the local copies of effect structs stored in local variables. To apply these changes, you have to re-apply the effect.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Feb 07, 2011 2:02    Post subject: Reply with quote

I'm trying to make a version of the iprp functions for windows, but I suck at reading bytecode, nor do I have a linux executable...

Does "8B 46 10 8B 7D 0C 8B 4A 08 FF 34 B8 0F BE 04 1F" (from the signature search function of nwnx_structs) equal StackPushEngineStructure?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Feb 08, 2011 11:39    Post subject: Reply with quote

No, it's in the middle of CVirtualMachineStack::AssignLocationToLocation.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development 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