Ir al contenido

Foto

FAQ on custom classes, spells, and feats. (Repost)


  • Por favor identifícate para responder
67 respuestas en este tema

#51
4760

4760
  • Members
  • 1.203 mensajes

Let's try to do it as follows then.

 

Create a script and rename it, say, on_equip:

/*
adds the characters intelligence modifier to their armor class while they also have a shield in their left hand
*/

const int FEAT_DEFEND_FLANK = 2858;

/* Boolean function to check if the creature passed in paramater wields a shield
and has got the feat "defend flank".
Returns TRUE is that is the case, FALSE otherwise */

int IsShieldEquipped(object oPC)
{
    // get the type of item wielded in the left hand
    object oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
    int nType = GetBaseItemType(oItem);
         // check if (holding a shield) and (having the right feat)
    if (((nType == BASE_ITEM_LARGESHIELD) || (nType == BASE_ITEM_SMALLSHIELD)
    ||  (nType == BASE_ITEM_TOWERSHIELD)) && (GetHasFeat(FEAT_DEFEND_FLANK, oPC)))
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}


/*
Apply / remove the bonus for having a shield equipped and the FEAT_DEFEND_FLANK
*/
void main()
{
     object oPC = GetFirstPC(FALSE);
     if (IsShieldEquipped(oPC))
     {
          int nAbility = GetAbilityModifier(ABILITY_INTELLIGENCE,oPC);
          effect eEffect = SupernaturalEffect(EffectACIncrease(nAbility, AC_DEFLECTION_BONUS, AC_VS_DAMAGE_TYPE_ALL,FALSE));
          ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, HoursToSeconds(12));
          SendMessageToPC(GetFirstPC(), "Defend flank activated!");
     }
     else
     {
          SendMessageToPC(GetFirstPC(), "Defend flank deactivated!");
     }
}

I'd probably put it in the OnEquip and OnUnequip slots of the module rather than the OnHeartbeat.

First reason: it will only fire when an item is equipped / unequipped, so the changes will be immediate.

Second reason: although it will not make any difference, it will not fire unnecessarily and delay other heartbeat scripts.

 

If you go that route, you might want to add a call to the above script from the existing OnEquip / OnUnequip scripts (in my toolset, they're "x2_mod_equ" and "x2_mod_unequ").




#52
Laugh out loud

Laugh out loud
  • Members
  • 109 mensajes

 

Let's try to do it as follows then.

 

Create a script and rename it, say, on_equip:

/*
adds the characters intelligence modifier to their armor class while they also have a shield in their left hand
*/

const int FEAT_DEFEND_FLANK = 2858;

/* Boolean function to check if the creature passed in paramater wields a shield
and has got the feat "defend flank".
Returns TRUE is that is the case, FALSE otherwise */

int IsShieldEquipped(object oPC)
{
    // get the type of item wielded in the left hand
    object oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
    int nType = GetBaseItemType(oItem);
         // check if (holding a shield) and (having the right feat)
    if (((nType == BASE_ITEM_LARGESHIELD) || (nType == BASE_ITEM_SMALLSHIELD)
    ||  (nType == BASE_ITEM_TOWERSHIELD)) && (GetHasFeat(FEAT_DEFEND_FLANK, oPC)))
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}


/*
Apply / remove the bonus for having a shield equipped and the FEAT_DEFEND_FLANK
*/
void main()
{
     object oPC = GetFirstPC(FALSE);
     if (IsShieldEquipped(oPC))
     {
          int nAbility = GetAbilityModifier(ABILITY_INTELLIGENCE,oPC);
          effect eEffect = SupernaturalEffect(EffectACIncrease(nAbility, AC_DEFLECTION_BONUS, AC_VS_DAMAGE_TYPE_ALL,FALSE));
          ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, HoursToSeconds(12));
          SendMessageToPC(GetFirstPC(), "Defend flank activated!");
     }
     else
     {
          SendMessageToPC(GetFirstPC(), "Defend flank deactivated!");
     }
}

I'd probably put it in the OnEquip and OnUnequip slots of the module rather than the OnHeartbeat.

First reason: it will only fire when an item is equipped / unequipped, so the changes will be immediate.

Second reason: although it will not make any difference, it will not fire unnecessarily and delay other heartbeat scripts.

 

If you go that route, you might want to add a call to the above script from the existing OnEquip / OnUnequip scripts (in my toolset, they're "x2_mod_equ" and "x2_mod_unequ").


I do appreciate all of the help but it seems that you are talking way above my level.  Do I put the first script inside both the OnEquip and OnUnequip slots and have the     ExecuteScript("feat_defend_flank", oPC); be the return TRUE; statement?  Then simply have a "feat_defend_flank" script that actually executes the bonus from the feat?  I understand that you want me to fire it using the OnEquip and OnUnequip module scripts and I realize that I will have to make my own versions of the ones that are there and I am a little confused about what to put in the OnUnequip.



#53
4760

4760
  • Members
  • 1.203 mensajes

Sorry... You don't have to change anything at all actually.

 

Assuming the code I suggested is all in a script named on_equip (but you can use any name you want, like "check_defend_feat"), all you have to do is put the same name in the OnHeartbeat slot of your module (so, in this case, "on_equip" or "check_defend_feat").

 

It will not fire each time you equip/unequip a shield, but every 6 seconds.

 

 

Using the OnEquip and OnUnequip slots was a nicer solution since you wouldn't have to wait for the next execution of the heartbeat script of the module to update the activation / deactivation of the bonus. If you're interested, I could show you how to do it (but I'm again late for real life stuff!!!)



#54
Laugh out loud

Laugh out loud
  • Members
  • 109 mensajes

Thank you, it is working perfectly.  I will test its aspects in the game and then I can continue creating my custom class.

After some testing I had to make it a dodge bonus in order for it to stack over the shields armor and then I had to set an interger variable to get it to re-fire after the shield was unequiped and re-equiped later but, as I said it is working perfectly now and now I can finish the rest of the custom class.

I am so thankfull!



#55
Laugh out loud

Laugh out loud
  • Members
  • 109 mensajes

How would someone go about taking a class feat that is already in the game and adding a reworded version of it to a custom class.  In case it matters I am trying to add the Shadow Thief's Reputation feat to a custom class I am making.  Thank you in advance



#56
Happycrow

Happycrow
  • Members
  • 612 mensajes

Laugh Out Loud:

 

Unless it's hardcoded, I believe you can simply copy it to a different line, change the .TLK reference, and then change the text inside a custom .tlk file.



#57
Laugh out loud

Laugh out loud
  • Members
  • 109 mensajes

I have finished building the beta version of my new custom class but when I went into the game in order to test it I got a message of "Character level disabled by server restrictions."  Does anyone know how to get past this error?  I would like to test this class so that I could port it for others (or at least play it myself  :P )



#58
Laugh out loud

Laugh out loud
  • Members
  • 109 mensajes

I have finished building the beta version of my new custom class but when I went into the game in order to test it I got a message of "Character level disabled by server restrictions."  Does anyone know how to get past this error?  I would like to test this class so that I could port it for others (or at least play it myself  :P )

I discovered a cure but not the cause.  Apparently this error was being caused by my Windows Vista opperating system.  I installed the custom class to my laptop (which runs on Windows 8.1) and the problem went away like it was not even there.  Note to anyone else that is seeing this error that it may not be a Neverwinter Nights 2 issue but a Windows Vista issue.



#59
Laugh out loud

Laugh out loud
  • Members
  • 109 mensajes

How do you add custom spells to NWN2 so that they can be selectable by characters upon leveling up (like a warlock or sorcerer.)  I have read several tutorials and can get them to work in NWN1 but this same method does not seem to work for NWN2.  A link to a totorial that works for NWN2 would be very helpfull.



#60
Loki_999

Loki_999
  • Members
  • 430 mensajes

How do you add custom spells to NWN2 so that they can be selectable by characters upon leveling up (like a warlock or sorcerer.)  I have read several tutorials and can get them to work in NWN1 but this same method does not seem to work for NWN2.  A link to a totorial that works for NWN2 would be very helpfull.

 

Its quite simple.  Just make sure the spell has a spell level value under the appropriate class colume (eg: Wizard) and the column "Removed" has 0 in it.

 

Also you need your modified spells.2da in your override folder and no other versions taking priority (eg: in HAKs).



#61
Laugh out loud

Laugh out loud
  • Members
  • 109 mensajes

Its quite simple.  Just make sure the spell has a spell level value under the appropriate class colume (eg: Wizard) and the column "Removed" has 0 in it.

 

Also you need your modified spells.2da in your override folder and no other versions taking priority (eg: in HAKs).

Already have checked for this.  They are still not showing in the game.



#62
kamal_

kamal_
  • Members
  • 5.235 mensajes
Lol, perhaps you should open a separate thread?

#63
Bumblebee

Bumblebee
  • Members
  • 2 mensajes

Sorry for the zombie post.

 

Totally n00b question but after making a custom class where's the best place to upload it for others enjoyment?

 

I added the remaining shapes (including epic) to the nwn1 shifter pack migrate wizard posted for nwn2 on the vault.

 

I wouldn't get too excited I mostly repurposed existing models and I've run out of time as the approaching deadline for changing diapers looms. The plan is to leave for others to add pretty models to if they wish.

 

Natural spell now works with it as do all creature spells. Didn't have the enthusiasm to try and make knockdown or disarm work without the hot bar so they got swapped for things you can use. It's playable but being my first mod I doubt it'll work with anyone else's, I didn't exactly respect any reserved ranges.....



#64
ColorsFade

ColorsFade
  • Members
  • 1.267 mensajes

The new vault or NexusMods



#65
Bumblebee

Bumblebee
  • Members
  • 2 mensajes

Thank you. I don't it's really of that quality but I suppose I can always take it down if I get too many complaints!



#66
kamal_

kamal_
  • Members
  • 5.235 mensajes

I don't see this one in here: What needs to be done to make a custom class available in the toolset? The custom classes show ingame, but are not available in toolset?



#67
kevL

kevL
  • Members
  • 4.052 mensajes

I don't see this one in here: What needs to be done to make a custom class available in the toolset? The custom classes show ingame, but are not available in toolset?


a Dialog.Tlk in the player-folder (with custom entries inserted) needs to go, rather, in the installation-folder ?
  • A kamal_ le gusta esto

#68
kamal_

kamal_
  • Members
  • 5.235 mensajes

a Dialog.Tlk in the player-folder (with custom entries inserted) needs to go, rather, in the installation-folder

Winner! (and thanks, as I uninstalled/reinstalled the game and broke my custom class availability)

 

Next question: Is it possible to make race restricted base classes? For example to have paladins/monks be human only.

 

Answer: Yes, base classes are classes where there is normally no prerequisites, but you can define a prerequisite via the classes.2da's

PreReqTable column (with a prerequisite 2da as described in http://nwn2.wikia.co...ls_pres_*.2da).Normally this is used to define prerequisites for prestige classes, but does not have to be.

 

Note that the stock game lists cls_pres_no_animal for a prerequisite for stock base classes, but there is actually no cls_pres_no_animal.2da file. The stock 2da naming scheme assumes the column used for prestige class prerequisites, since they are cls_pres_, and the wiki says it's for prestige class prerequisites, but it can be used for prerequisites for base classes as well.

 

By giving a class prerequisites that the player can get before selecting a class at character creation, and restricting via the race/subrace prerequisite, you can create new race specific base classes or make an existing class race specific (the stock classes 2da already covers alignment specific base classes).