You are here

Adding effects to PC's

5 posts / 0 new
Last post
CorruptionOverw...
Adding effects to PC's

I've recently been looking into adding effects to PC's for reaching specific milestones:

e.g. 20th level Fighter gets +1 Attack Bonus

The method I've looked into doing this with is using an ApplyEffectToObject function on login to apply the attack increase so long as they have the proper levels (check for levels, apply bonus). So far that seems to work good, however I've realized there's a few snags. 

If I set any kind of bonus as an instant increase, it's permanent, but can never be removed (known bug with this function) - which means I'd have to not allow any kind of releveling should a player mess up their build. For obvious reasons this isn't a wise course of action, so I won't be doing it.

If I set the bonus as permanent, it seems to last indefinitely - however it is removed on death. I haven't done enough testing to find out if there's other ways to remove this besides death/it being removed by a script. The death is what's providing the issue however:

Are there any functions by which to reapply this variable after a player is brought back to life?

It can be added to the OnPlayerRespawn, but from what the lexicon says this only fires when they press the respawn button - not when they're brought back by an effect such as raise dead or ressurection, or even dm heal.

Any help in how to keep these effects applied would be welcome. I've debated adding it's application to a heartbeat script, but that seems like it'd cause lag? (I've been warned that heartbeats can cause issues with lag because of how frequently they fire)

If anyone knows any other methods by which this might be removed that I haven't seen yet, I'd appreciate knowing that as well. Thanks for any help provided.

  • up
    50%
  • down
    50%
MysteryX

I am not advanced enough to know the details, but I know the module Citadel uses a creature skin placed on the PC to hold ability and skill bonuses for completing various quests.  It is explained in the fourth paragraph of the walkthough.  The skin is implemented in the first area of the module, and the first ability and skill increases come in the second area of the module.

  • up
    100%
  • down
    0%
CorruptionOverw...

Skins are a good idea, though I find the documentation on how to use them lacking. I'll look into this though. :) thank you for the reply

  • up
    50%
  • down
    50%
The Amethyst Dragon

A creature skin works almost like any other kind of item, except that PCs can't add or remove them. You have to use scripting to give such an item to the PC, add the attack bonus (or use a premade skin with the attack bonus already added), then the script can AssignCommand() to the PC to equip the skin to the correct equipment slot. The exact commands and slot constants are in the NWScript editor.

- The Amethyst Dragon
---------------
World of Aenea (The origin of almost all my works.)
NWN Custom Content: The Complete List (90+ entries...You want this stuff.)
CEP 2.62 (Oh, this? Just a little something I've been working on since 2014.)
------ Neverwinter Nights Community Site: The Unofficial Homepage for NWN ------

  • up
    50%
  • down
    50%
FantasyObsessedRPGer
FantasyObsessedRPGer's picture

I'm glad someone brought this up as I am currently working on the same thing, or something similiar at least. In making some custom feats of my own for various custom classes, I too had to assign 'ApplyEffectToObject' in order to get the script effects to stay and not fade out. In researching this particular bit, I found stuff on the NWN wiki about creature skins and the NWN Lexicon about adding effects to PCs and other targets. Regarding the effects application and I feel this is very important to add as it can make a huge to monumental difference depending on what it is you're trying to do, there are three duration types and three effect subtypes. You have the option of doing a temporary effect, a permanent effect or an instant effect. For myself, I want the duration type to be permanent, as these are feats after all. So I put in the appropriate duration constant and then add my subeffect. The thing about the sub effects is that you can choose to make it Extraordinary, Magical or Supernatural. Magical is a normal effect, and is I think, removed upon resting and can be dispelled by spellcasters or items with the ability on them, so is not useful for a permanent, non-removable feat like I am trying to do. Supernatural is not removed upon resting, but can still be dispelled. Extraordinary cannot be dispelled, but I am not positive whether or not it is removed on resting as I haven't tested that out yet.

 

I also determined that the best thing to do for passive feats is make it an Extraordinary effect, whereas activable feats can be any one of the three subtypes. Depends upon what kind of feat or effect you're going for. Regarding the event handlers, I also found that you have to change the OnClientEnter and OnPlayerLevelUp AND OnPlayerRespawn events for effects to stay put or be added in the first place. For creature skins, you just need to change the first two. I also think OnModuleLoad event is something to consider for effects (not creature skins), especially if you're starting a module with the effects already added to the PC. Or is this not necessary? I would like to know this for my own reference, if anyone has an answer for it. Thanks. If you're trying to do an OnResurrect event handler, then that needs a custom script/event handler for it from what I discovered as it is not a default event in the toolset. I don't know how you do that though, so you'll have to keep looking.

 

Some other stuff is I don't think either one (effects or skin items) can change the Challenge Rating of whatever you apply it to, so that is kinda sucky. I know it doesn't for creature skins, not sure about effect application.

 

Also, and this is a problem. If let's say, I wanted to add a permanent ability score increase AND have it count as part of their actual base ability score, I would not use a custom feat or effect for that, as it won't do the same thing as what an already in-game Great Ability feat will (Great Strength, Great Wisdom, etc.) Those actually apply upon level up and count towards the overall ability score total, effects will not, unfortunately as I tested that out. It won't matter if you make it permanent or not, the hardcoded epic feats are the only way to actually for real increase the ability score and make it count towards the total. Which is necessary for other feats that require a certain ability score total (Planar Turning for instance). And I don't think creature skins will work with custom feats anyway, correct me if I'm wrong. So that leaves me with the ApplyEffectToObject function only.

 

I am going to be updating my Divine Disciple class soon, as I am pondering the specifics on adding Transcendence as a custom feat, and not miscellaneous bonuses like what is there now. Just trying to decide on a few things is all, then I can reupload it.

 

Some of this stuff I am sure you probably already knew, but hopefully something here helped. And if not, then for other people who may be trying to do the same thing as us. :)

Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world. -Albert Einstein

I love RPGs for the stories they tell, the adventures and character creation possibilities. The histories and made-up philosophies. A multiverse of ideas, creations, and story telling with rich in-depth backgrounds. The possibilities are endless. Definitely something to get wholly immersed in.

  • up
    50%
  • down
    50%