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 
 
Beta Plugin: nwnx_weapons
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 Aug 08, 2008 0:34    Post subject: Beta Plugin: nwnx_weapons Reply with quote

I've been breaking apart the NWNeXalt plugin we use on Higher Ground into a variety of smaller, more modular plugins. Two of these are already in the SVN repository. The first is nwnx_funcs which is a rework of nwnx_functions, and I will be making a post about it after a bit more cleanup.

It is the second I am here to post about, however. The nwnx_weapons plugin allows you to set various weapon feats, so you can finally offer weapon feats for CEP or custom weapons on your PWs.

Code:
int GetWeaponOption (int nOption);
int SetWeaponOption (int nOption, int nValue);
int GetWeaponIsMonkWeapon (int nBaseItem);
int SetWeaponIsMonkWeapon (int nBaseItem, int nMonkLevelsRequired);
int GetWeaponDevastatingCriticalFeat (int nBaseItem);
int GetWeaponEpicFocusFeat (int nBaseItem);
int GetWeaponEpicSpecializationFeat (int nBaseItem);
int GetWeaponFocusFeat (int nBaseItem);
int GetWeaponGreaterFocusFeat (int nBaseItem);
int GetWeaponImprovedCriticalFeat (int nBaseItem);
int GetWeaponLegendaryFocusFeat (int nBaseItem);
int GetWeaponOfChoiceFeat (int nBaseItem);
int GetWeaponOverwhelmingCriticalFeat (int nBaseItem);
int GetWeaponPowerCriticalFeat (int nBaseItem);
int GetWeaponSpecializationFeat (int nBaseItem);
int GetWeaponSuperiorCriticalFeat (int nBaseItem);
int SetWeaponDevastatingCriticalFeat (int nBaseItem, int nFeat);
int SetWeaponEpicFocusFeat (int nBaseItem, int nFeat);
int SetWeaponEpicSpecializationFeat (int nBaseItem, int nFeat);
int SetWeaponFocusFeat (int nBaseItem, int nFeat);
int SetWeaponGreaterFocusFeat (int nBaseItem, int nFeat);
int SetWeaponImprovedCriticalFeat (int nBaseItem, int nFeat);
int SetWeaponLegendaryFocusFeat (int nBaseItem, int nFeat);
int SetWeaponOfChoiceFeat (int nBaseItem, int nFeat);
int SetWeaponOverwhelmingCriticalFeat (int nBaseItem, int nFeat);
int SetWeaponPowerCriticalFeat (int nBaseItem, int nFeat);
int SetWeaponSpecializationFeat (int nBaseItem, int nFeat);
int SetWeaponSuperiorCriticalFeat (int nBaseItem, int nFeat);


In addition, this plugin makes any light weapon finessable. I will be enhancing the options to make this more configurable in the future, and also allow for other ability scores to be used instead of Strength, Dexterity, and Wisdom (Zen archery). We already have those capabilities on Higher Ground but they are not yet implemented here.

More documentation is available in the nwnx_weapons.nss file which can be found under plugins/weapons in the SVN repository.

This plugin is only available for Linux at this time, and I do not have any plans to port it to Windows, although Virusman may be able to do so after he returns in September.

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



Joined: 23 Aug 2005
Posts: 31

PostPosted: Fri Aug 08, 2008 11:06    Post subject: Reply with quote

Hi acaos.

I've tried to compile this plugin, but it failed in function "GetIsWeaponLight" due to undeclared constants CREATURE_SIZE_TINY and CREATURE_SIZE_HUGE.

Code:
common/c_GetIsWeaponLight.c: In function 'GetIsWeaponLight':
common/c_GetIsWeaponLight.c:31: error: 'CREATURE_SIZE_TINY' undeclared (first use in this function)
common/c_GetIsWeaponLight.c:31: error: (Each undeclared identifier is reported only once
common/c_GetIsWeaponLight.c:31: error: for each function it appears in.)
common/c_GetIsWeaponLight.c:32: error: 'CREATURE_SIZE_HUGE' undeclared (first use in this function)
make[1]: *** [common/c_GetIsWeaponLight.o] Error 1


I guess they should be declared within nwn_const.h?
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Fri Aug 08, 2008 15:06    Post subject: Reply with quote

first off this is awesome. I will look for this when you are done with it. I would test it but i dont have a mod ready to do so
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Fri Aug 08, 2008 16:36    Post subject: Reply with quote

Timear wrote:
Hi acaos.

I've tried to compile this plugin, but it failed in function "GetIsWeaponLight" due to undeclared constants CREATURE_SIZE_TINY and CREATURE_SIZE_HUGE.
I guess they should be declared within nwn_const.h?


That's correct, I had an uncommitted change. My mistake, and they have been committed.

Thanks,
Acaos
Back to top
View user's profile Send private message
Timear



Joined: 23 Aug 2005
Posts: 31

PostPosted: Fri Aug 08, 2008 19:48    Post subject: Reply with quote

Thank you

I will try them as soon as possible. Awsome work by the way. My respects.
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Sun Aug 10, 2008 2:33    Post subject: Reply with quote

axs wrote:
What I can do with this issue?

cc1plus: warnings being treated as errors
NWNXWeapons.cpp:48: warning: deprecated conversion from string constant to 'char*'
NWNXWeapons.cpp:48: warning: deprecated conversion from string constant to 'char*'
NWNXWeapons.cpp:48: warning: deprecated conversion from string constant to 'char*'
NWNXWeapons.cpp:48: warning: deprecated conversion from string constant to 'char*'
NWNXWeapons.cpp:48: warning: deprecated conversion from string constant to 'char*'
NWNXWeapons.cpp:48: warning: deprecated conversion from string constant to 'char*'
NWNXWeapons.cpp: In constructor 'CNWNXWeapons::CNWNXWeapons()':
NWNXWeapons.cpp:81: warning: deprecated conversion from string constant to 'char*'
make: *** [NWNXWeapons.o] Error 1

cc1plus: warnings being treated as errors
NWNXFuncs.cpp: In constructor 'CNWNXFuncs::CNWNXFuncs()':
NWNXFuncs.cpp:30: warning: deprecated conversion from string constant to 'char*'
make: *** [NWNXFuncs.o] Error 1


Other plugins have this same warning but is not treated as error.


You can remove the -Werror from the DEBUGS line in plugins/weapons/Makefile to fix this. You're probably running a more recent version of GCC.

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



Joined: 26 Jun 2008
Posts: 30

PostPosted: Sun Aug 10, 2008 11:50    Post subject: Reply with quote

Server crashes during pc fighting while using weapons plugin
only nwnx_weapon plugin loaded, no function called

log from nwnx_core :

[2008-08-10 11:08:57] Ref_ABAbilityModifier (1) found at 0x8145b20
[2008-08-10 11:08:57] found critical range return reference at 0x814c482
[2008-08-10 11:08:57] found critical multiplier return reference at 0x814c56e
[2008-08-10 11:08:57] found AB ability modifier jump reference at 0x8145b82

after removing weapon plugin the server is ok
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Sun Aug 10, 2008 18:27    Post subject: Reply with quote

Is there any chance you could get a core dump or more information about what kind of combat is going on?

Also, please search for the string 'not found' in nwnx_core.txt and see if any functions were not found. You should also check and make sure GetEffectImmunity was found.

Thanks,
Acaos
Back to top
View user's profile Send private message
max196



Joined: 26 Jun 2008
Posts: 30

PostPosted: Sun Aug 10, 2008 20:47    Post subject: Reply with quote

sure, I will send to you
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Wed Aug 13, 2008 5:06    Post subject: Reply with quote

I just wanted to note that the latest version of nwnx_weapons integrates a fix for the offhand critical multiplier bug, where the offhand weapon receives the same critical multiplier as the onhand weapon (e.g., if you have a handaxe in your onhand and a rapier in your offhand, the rapier effectively becomes 18-20/x3, acquiring the x3 from the handaxe).

I've also headed off a few types of crashes and weirdness by making some of the hook-functions noinline; I found there were some cases where they might be inlined, which Doesn't Work Right.

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



Joined: 14 Aug 2007
Posts: 12

PostPosted: Wed Aug 13, 2008 8:35    Post subject: Reply with quote

acaos
I understand that this plugin is beta, but here you`ve posted:
Quote:
Yes, nwnx_funcs is a complete replacement for nwnx_functions.

But I don`t see some functions from nwnx_functions in list you provided.
Quote:
int GetArmorAC(object oObject);
void SetArmorAC(object oObject, int iAC);
int GetDescriptionLength(object oObject);
int GetUndroppableFlag(object oItem);
void SetUndroppableFlag(object oItem, int bUndroppable);
int GetItemWeight(object oObject);
void SetItemWeight(object oObject, int nWeight);
string GetEventHandler(object oObject, int nEventId);
void SetEventHandler(object oObject, int nEventId, string sScript);
void Set2DAString(string s2DA, string sColumn, int nRow, string sValue);
struct scriptvar GetFirstLocalVariable(object oObject);
struct scriptvar GetNextLocalVariable(object oObject);
int GetItemCount(object oTarget);
void RestartServer();
void DebugMe(object oObject);
void ObjectDump(object oObject);

As for GetArmorAC, I assume that it was replaced by int GetACByType (object oCreature, int nACType=AC_DODGE_BONUS) in nwnx_defenses,
but how about others functions?
You just missed this functions in list? You don`t have time to include all functions from nwnx_functions to nwnx_func? Or you are not going to add this functions at all?

P.S. Set2daString doesn`t work.
P.P.S. Great work anyway Smile
Back to top
View user's profile Send private message
max196



Joined: 26 Jun 2008
Posts: 30

PostPosted: Wed Aug 13, 2008 12:13    Post subject: Reply with quote

With the svn updates of yestarday weapons plugin now do not crash the server anymnore.
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Wed Aug 13, 2008 17:03    Post subject: Reply with quote

Max asked me this in a PM, but I'm going to reply here so everyone has the information (the nwnx_weapons.nss interface file has some related information at the top):

max196 wrote:
The options for:
int SetWeaponOption (int nOption, int nValue);
are FALSE and TRUE? or do they accept also other values?

Would be it possible to modify the devcrit to increase the critical range or multiplier? If yes, in which way?

What is possible to do with the functions provided at this time?


Here's the general options block from Higher Ground:

Code:
    SetWeaponOption(NWNX_WEAPONS_OPT_DEVCRIT_DISABLE_PC,       TRUE);
    SetWeaponOption(NWNX_WEAPONS_OPT_DEVCRIT_MULT_BONUS,       1);
    SetWeaponOption(NWNX_WEAPONS_OPT_DEVCRIT_MULT_STACK,       TRUE);
    SetWeaponOption(NWNX_WEAPONS_OPT_OVERCRIT_RANGE_BONUS,     1);


This disables Devastating Critical instakill for PCs (but not for monsters); causes Devastating Critical to grant a +1 bonus to crit multiplier that will stack with Improved Critical Multiplier from Weapon Masters, and causes Overwhelming Critical to grant a +1 bonus to crit range that will not stack with Ki Critical from Weapon Masters.

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



Joined: 08 May 2007
Posts: 153

PostPosted: Fri Aug 22, 2008 1:38    Post subject: Reply with quote

I just wanted to note that support for critical confirmation roll bonus feats (e.g. Power Critical) is now in. You'll need to update both your base nwnx2.so and your nwnx_weapons.so next time you update from Subversion.

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



Joined: 06 Apr 2007
Posts: 10

PostPosted: Sun Sep 21, 2008 0:23    Post subject: Reply with quote

is there a way to disable the dev crit instagib for all, not just a pc? would be nice if there was. nice work. thanks.
Back to top
View user's profile Send private message
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