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 
 
Cool Help?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
Lazarus Magni



Joined: 15 Jun 2011
Posts: 30

PostPosted: Thu Sep 19, 2013 3:59    Post subject: Cool Help? Reply with quote

We have used the nwnx_cool plugin for a while for quite a few of our modifications. It has allowed us to do some amazing things in my book. One thing however we never did get right though was a change for assassins to be able to use their Int for AC. This was our most recent attempt:

int GetAlternateAC(object oPC, struct PCData pc)
{
if(pc.Asn >= 10 && GetHasFeat(FEAT_DIRTY_FIGHTING, oPC))
{
if(pc.Int < 1) return 0;
int nMax;
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
if(oArmor == GetPCItemLastUnequipped() || oArmor == OBJECT_INVALID) nMax = 100;
if(GetItemArmorType(pc.Armor) < 1) nMax = 100;
else nMax = GetMaxDexBonus(oPC);
if(pc.Dex >= nMax) return 0;
nMax -= pc.Dex;
if(pc.Int > nMax) pc.Int = nMax;
return pc.Int;
}
return 0;
}
/*
int GetAlternateAC(object oPC)
{
if(cl.Asn >= 10 && GetHasFeat(FEAT_DIRTY_FIGHTING, oPC))
{
int nInt = GetAbilityModifier(ABILITY_INTELLIGENCE, oPC);
if(nInt < 1) return 0;
int nDex = GetAbilityModifier(ABILITY_DEXTERITY, oPC);
int nMax;
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
if(oArmor == GetPCItemLastUnequipped() || oArmor == OBJECT_INVALID) nMax = 100;
else nMax = GetMaxDexBonus(oPC);
if(nDex >= nMax) return 0;
nMax -= nDex;
if(nInt > nMax) nInt = nMax;
return nInt;
}
return 0;
} */


We tried many permeations of this script, this is only the current non functional one. We did get it to work for a bit, so I know it is possible... Would love some help here if anyone is willing, and this microphone is still on...

Microphone check, one, two, what is this?
Back to top
View user's profile Send private message
Lazarus Magni



Joined: 15 Jun 2011
Posts: 30

PostPosted: Thu Sep 19, 2013 4:01    Post subject: Reply with quote

P.S. I got a few others if any of you talanted scripters are willing. No we don't pay, but we sure show our appreciation.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Sep 19, 2013 5:41    Post subject: Reply with quote

Lazarus Magni wrote:
P.S. I got a few others if any of you talanted scripters are willing. No we don't pay, but we sure show our appreciation.


you wont do that perfectly outside of nwnx, you have to modify nwnx_cool source:

Quote:
int __fastcall CNWSCreature__GetArmorClass( CNWSCreature * cre, void* )
{

if( cre == NULL )
return CNWSCreature__GetArmorClassNext( cre, NULL );

Cool.frames++;

int nAC = cre->obj.obj_vartable.GetInt( CExoString( "AC" ) );

if(cre->cre_stats->HasFeat(1234))
{
if(cre->cre_stats->cs_int_mod > 0)
{
nAC+= cre->cre_stats->cs_int_mod;
}
}

if( nAC != 0 ){

int nBase = CNWSCreature__GetArmorClassNext( cre, NULL );
//Cool.Log( 1, "o GetArmorClass: %08lx AC mod: %i\n", cre->obj.obj_generic.obj_id ,nAC );
return nBase+nAC;
}

return CNWSCreature__GetArmorClassNext( cre, NULL );
}


this is way to do, just modify 1234 with id of the feat doing this, i would myself restrict it fully only to pc but thats up to you

if you dont know how to build the plugin, pm me i can do that for you
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Thu Sep 19, 2013 6:11    Post subject: Reply with quote

Keep in mind that there are several functions that "Gets AC", you got the script function, character sheet functions etc.

The one the combat engine uses is this one:

CNWSCreatureStats::GetArmorClassVersus( CNWSCreature *, int ) @ 0046DC00

And the function the charactersheet uses is this one:

CNWSCreature::GetArmorClass() @ 004A6E00

I'm fairly certain cool hooks both of these and parses in the AC local variable, you might wanna makesure that the AC hooks are enabled in your ini file.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lazarus Magni



Joined: 15 Jun 2011
Posts: 30

PostPosted: Thu Sep 19, 2013 18:54    Post subject: Reply with quote

Thanks guys, guess I will try enabling the hook first of all... *looks sheepish*
Back to top
View user's profile Send private message
Lazarus Magni



Joined: 15 Jun 2011
Posts: 30

PostPosted: Fri Sep 20, 2013 1:00    Post subject: Reply with quote

Well so I enabled the hook, but the AC is still not working. However I just looked at the script that is in the module currently and these 2 lines:
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
if(oArmor == GetPCItemLastUnequipped() || oArmor == OBJECT_INVALID) nMax = 100;

Are commented out. Think uncommenting will do it?
Back to top
View user's profile Send private message
Lazarus Magni



Joined: 15 Jun 2011
Posts: 30

PostPosted: Fri Sep 20, 2013 1:19    Post subject: Reply with quote

The whole point of this modification was just to make is so that assassins could use their death attacks which use their Int for the DC.

An alternative solution might be to scrap our system that uses Int for AB (working), and AC (not working), and just change how the death attack is handled to use str (or Dex if higher and have finesse.) Anyone have ideas on this?

And Shadooow, I do not know how to modify plugins. If we go this route I should probably send you the version of cool we are using, since many of our other systems are tied to it. Thanks for the offer though, just exploring all possible solutions here...
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Fri Sep 20, 2013 1:24    Post subject: Reply with quote

NWNX Effects in this thread: http://www.nwnx.org/phpBB2/viewtopic.php?t=2116

Has a custom effect named EffectAC, it'll create an effect that increases or decreases AC unconditionally, meaning the AC has no typing, stacks with itself and ignores caps.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lazarus Magni



Joined: 15 Jun 2011
Posts: 30

PostPosted: Fri Sep 20, 2013 1:33    Post subject: Reply with quote

Interesting Terra, however we have a tenious balance between AC and AB for PCs and NPCs already. And no one is near the default cap so I don't think this will help us, unless you are saying we can use a portion of this for the assassin AC?
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Fri Sep 20, 2013 1:44    Post subject: Reply with quote

Yeah, it works like the AC integer but its an effect instead. It also means you can do anything with it that you can do to any effect such as linking.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lazarus Magni



Joined: 15 Jun 2011
Posts: 30

PostPosted: Sat Sep 21, 2013 2:13    Post subject: Reply with quote

Good stuff Terra
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support 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