Coding Question

You have questions? We may have answers.

Moderators: Active DMs, Forum Moderators

Post Reply
User avatar
CosmicOrderV
Arelith Silver Supporter
Arelith Silver Supporter
Posts: 389
Joined: Tue Oct 23, 2018 5:35 pm

Coding Question

Post by CosmicOrderV » Mon May 06, 2019 11:24 pm

I ask this for two reasons. One is that I'm vaguely interested in what it takes to code custom class mechanics, but everything I google regarding NWN game code is unrelated building blocks, and I think I'd do better just getting a template to slightly tweak.

Also, in the circumstance I have no interest in coding, this will help tailor some of my future suggestions.

Namely, is it possible to link a mechanic to a class token of some kind, that is a skill bonus equal to an ability modifier?

Let's say for example, Search. It's bonus is intelligence based. But what if in addition to this normal bonus, I wanted to add one's wisdom modifier ALSO to the overall search bonus? Counting it towards the soft cap on skills.

Doable or nah? And if it is, could I trouble someone to link/paste/pm me about how it would be done?
Aodh Lazuli wrote:
Wed Apr 10, 2019 6:22 pm
I, too, struggle to know what is written in books without first reading them.

User avatar
Queen Titania
Community Manager
Community Manager
Posts: 3391
Joined: Sun Sep 07, 2014 6:44 pm
Location: The Seeliecourt singing with Tinkerbell

Re: Coding Question

Post by Queen Titania » Tue May 07, 2019 1:04 am

EffectSkillIncrease could help you increase search as a soft bonus.

GetAbilityModifier would help you grab the Wisdom modifier, which you could supply as EffectSkillIncrease's nValue.

The Hard part personally is setting up the condition for it to fire and be rechecked when that modifier is changed.
Please don't feed my sister.

User avatar
DM Roku
Posts: 84
Joined: Mon Nov 13, 2017 12:08 am

Re: Coding Question

Post by DM Roku » Tue May 07, 2019 3:05 am

I think it may be possible with NWNX_Skills but I've not taken a look. You could take a look at nwnx.io and go to the repository to see the additional functionality it has!

User avatar
ActionReplay
Project Lead
Project Lead
Posts: 1630
Joined: Mon Sep 08, 2014 5:09 pm
Location: Sweden

Re: Coding Question

Post by ActionReplay » Fri May 10, 2019 8:03 pm

You can do it with regular NWScript. Get the modifier and apply the bonus, soft, as mentioned above.

Problem would be if someone casts a spell or uses an item to get a bonus to this modifier you'd have to trigger the change in the skill as well.

You could handle this by checking a player's current modifier every round on the Module Heartbeat and calculate it from there. So if they cast a spell or remove an item giving a modifier bonus, it would update their skill as you see fit every 6th second. Its not perfect, as its every 6 seconds, but gets the job done.

User avatar
CosmicOrderV
Arelith Silver Supporter
Arelith Silver Supporter
Posts: 389
Joined: Tue Oct 23, 2018 5:35 pm

Re: Coding Question

Post by CosmicOrderV » Sat May 11, 2019 12:24 am

I've another question, and it's probably much more difficult. I'm mostly curious if this is possible at all.

I won't be shy with the reasoning. Let's say Paladin were to have all DC's and spell-slots, only based off Charisma. Wisdom gets taken out of the picture. Then, as well, to limit their CHA to saves bonus, as capped by however many paladin levels they have. Are these possible?
Aodh Lazuli wrote:
Wed Apr 10, 2019 6:22 pm
I, too, struggle to know what is written in books without first reading them.

Post Reply