Modding Stats - Strength, Dexterity, Vitality, Willpower

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by David Ward »

How moddable are the base stats in Grimrock 2? So far, we have not been able to figure out how to make any adjustments to how this works. Would making an adjustment be akin to making all new stats and then defining them as such? Or is that just not doable because of the hard-coding of the stats themselves?
User avatar
Frenchie
Posts: 219
Joined: Wed Oct 16, 2013 2:50 am

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by Frenchie »

You want to add new stats like Luck, which could affect crit, loot or experience?
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by David Ward »

Well....I hadn't considered that. I was thinking of changing the existing stats so that Strength, for example, yielded more damage per point; Dexterity would 2 evasion and 3 accuracy, instead of 1 and 2 respectively...that sort of thing.

But luck as a stat....could be very interesting. Tell me more. :)
User avatar
Isaac
Posts: 3174
Joined: Fri Mar 02, 2012 10:02 pm

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by Isaac »

A luck stat would probably work best in a game with a weighted percentile skill system; unless the plan was to check it via script for encounters.

The original Fallout games [the good ones IMO :mrgreen: ] used Luck to affect everything that involved a bit of chance; including critical hits. It was double edged, as a low luck would have a negative effect on one's chances, and cause critical failures more often. Weapons would drop or even fall apart.
User avatar
Frenchie
Posts: 219
Joined: Wed Oct 16, 2013 2:50 am

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by Frenchie »

I was thinking of changing the existing stats so that Strength, for example, yielded more damage per point....
Simple increasing those stats would result in the same. But I would like to know the exact formulas are used for attacks and then see how we can modify them with new stats. Let's say attack damage = roll random (min dmg, max dmg) x crit and damage applied = attack damage - armor - (evade x random roll) - protection (- resist). Luck could affect it like this: attack dmg = roll random ( (min dmg, max dmg) + luck ) x crit and damage applied = attack damage - ( (evade - luck) x random roll) - protection (- resist)
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by David Ward »

It's something on the list to consider. Will get back to you guys on here regarding a *luck* stat.

In the mean time....is there no way to really modify the stats already in the game? Making strength provide more/less carrying capacity per point is also something we're trying to do. Of course, we can just change item weights, but if there's a way to work around with the stats, that would be better.
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by minmay »

You could probably put code in all onRecomputeStats/onComputeAccuracy/onComputeCritChance hooks that figures out which one is called last (so you get the correct stat values) and then apply your additional stat bonuses there, but that won't work for something like attack power of course.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by David Ward »

Ok. Thank you.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by David Ward »

So, it appears that weapons that are equipped do not add their +Dexterity or +Strength bonuses on a point by point basis. For example, if I equip an axe that has Damage + Strength, and I have 20 strength, it only adds (from what I've seen) around 10 damage or so.

So, if I wanted the +Strength to be added to the weapon's damage on a point-by-point basis, would it be best to use the onRecomputeStats hook for that?
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Modding Stats - Strength, Dexterity, Vitality, Willpower

Post by minmay »

You cannot do that at all, as far as I know. The final attack power value cannot be changed. You can only change it by modifying the champion's stat (if the weapon uses a stat) or the weapon's attack power value.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply