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 
 
NWNX2 Weapons Plugin

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
meatpuppet



Joined: 04 Jun 2010
Posts: 2

PostPosted: Fri Jun 04, 2010 16:06    Post subject: NWNX2 Weapons Plugin Reply with quote

I am hoping someone can shed some light on what is probably not a difficult task. I am in the l_GetAttackBonusAdjustment.c attempting to get ahold of the attacker's area to apply area-based bonuses. My attempts so far compile fine, but segfault during run. My c/c++ is pretty rusty, so I have turned here for some help. I have searched the forums, but do not seem to find specifically what I am looking for.

For example:
plugins/weapons/local/l_GetAttackBonusAdjustment.c

CNWSCreature *attacker_creature = attacker->cs_original;
CNWSObject *attacker_object = &attacker_creature->obj;
CNWSArea *area = (CNWSArea *) CNWSObject__GetArea(attacker_object);

will segfault on the last line. I was able to get to attacker_object->obj_area_id, however this is only mildly useful and not extremely descriptive (i.e. what does obj_area_id actually stand for?) I would guess is prone to change over time as the module matures and/or areas are copied/whatever.

Ideally I would be able to get ahold of the module and the attacker's area.

Thank you for any assistance you can provide.
Back to top
View user's profile Send private message
meatpuppet



Joined: 04 Jun 2010
Posts: 2

PostPosted: Thu Jun 17, 2010 15:24    Post subject: Reply with quote

I was unable to gain access to the area in the code, but I was able to overcome my problem by overriding onenter for each area in the mod and accessing the players stored variables within the c code.
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
Page 1 of 1

 
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