View previous topic :: View next topic |
Author |
Message |
meatpuppet
Joined: 04 Jun 2010 Posts: 2
|
Posted: Fri Jun 04, 2010 16:06 Post subject: NWNX2 Weapons Plugin |
|
|
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 |
|
|
meatpuppet
Joined: 04 Jun 2010 Posts: 2
|
Posted: Thu Jun 17, 2010 15:24 Post subject: |
|
|
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 |
|
|
|