NeverwinterConnections.com

   NeverwinterConnections.com
   Main Topics
   Builders Discussion

   Mod'ing HABD
Pages: 1  
   Author  Topic: Mod'ing HABD  (Read 98 times)
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847
Mod'ing HABD
Return To Top       

In my campaigns, I've always used a DM guarded permadeath and dealt with such situations using dice bags as needed. Recently I sat down and formalized this a bit more, and thought it's be easier to manage if I could script this into HABD. However, as I'm not really much of a scripter, beyond using Lilac and a few simple mod's to existing stuff, I thought I might share my idea and see if anyone here might lend me a hand.

For the first step, I want to look at base bleeding recovery.

For my purposes I'm using a D20 for the recovery and a roll of 18 as the base floor for success. These I know how to configure in the current settings.

These are the additions I'd like to make.

1. Adjust the base recovery rate by base Con modifier, with a max of lowering by 4 for 18+ and raising by a max of 2 for <8.

2. Further adjust the base for those who have Toughness feat -1, or Epic Toughness -2.

Using Lilac, I think I cobbled a basic series of IF/ELSE statements to cover these, but I'm pretty sure I need to adjust the target as in Lilac all I could find was player died.

Furthermore, I realize I need to add a variable for FeatMod+ConMod+Base at the end.

Here's what I've got so far....

Am I on the right track, or is this in need of major overhaul?

Thanks

Karvon

================================================
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3

For download info, please visit:
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */

//Modifying odds of recovery from bleeding in HABD

void main()
{

object oPC = GetLastPlayerDied();

if (!GetIsPC(oPC)) return;

if (GetHasFeat(FEAT_TOUGHNESS, oPC))
{
SetLocalInt(oPC, "FeatMod", -1);

}
if (GetHasFeat(FEAT_EPIC_TOUGHNESS_1, oPC))
{
SetLocalInt(oPC, "FreatMod", -2);

}
if (GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE)>= 1
{
SetLocalInt(oPC, "ConMod", -4);

}
else if (GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE)>= 16)
{
SetLocalInt(oPC, "ConMod", -3);

}
else if (GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE)>= 14)
{
SetLocalInt(oPC, "ConMod", -2);

}
else if (GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE)>= 12)
{
SetLocalInt(oPC, "ConMod", -1);

}
else if (GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE)>= 10)
{
SetLocalInt(oPC, "ConMod", 0);

}
else if (GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE)>=
{
SetLocalInt(oPC, "ConMod", +1);

}
else
{
SetLocalInt(oPC, "ConMod", +2);

}
}

I.P. Logged
GM_ODA

Extreme Poster


Last On: 02/08/12
View Profile
Message Player

Unknown

Posts: 459

Return To Top       

here you go



/*
In my campaigns, I've always used a DM guarded permadeath and dealt with such situations using
dice bags as needed. Recently I sat down and formalized this a bit more, and thought it's be
easier to manage if I could script this into HABD. However, as I'm not really much of a scripter,
beyond using Lilac and a few simple mod's to existing stuff, I thought I might share my idea and
see if anyone here might lend me a hand.

For the first step, I want to look at base bleeding recovery.

For my purposes I'm using a D20 for the recovery and a roll of 18 as the base floor for success.
These I know how to configure in the current settings.

These are the additions I'd like to make.

1. Adjust the base recovery rate by base Con modifier, with a max of lowering by 4 for 18+ and
raising by a max of 2 for <8.

2. Further adjust the base for those who have Toughness feat -1, or Epic Toughness -2.

Using Lilac, I think I cobbled a basic series of IF/ELSE statements to cover these, but I'm pretty
sure I need to adjust the target as in Lilac all I could find was player died.

Furthermore, I realize I need to add a variable for FeatMod+ConMod+Base at the end.

Here's what I've got so far....

Am I on the right track, or is this in need of major overhaul?

Thanks

Karvon

================================================ */
//Script generated by GM_ODA 20100302

void main()
{

object oPC = GetLastPlayerDied();

if (!GetIsPC(oPC)) return;

int nTargetNumber=18;

if (GetHasFeat(FEAT_TOUGHNESS, oPC)){nTargetNumber+= ( -1 );}
if (GetHasFeat(FEAT_EPIC_TOUGHNESS_1, oPC)){nTargetNumber+= ( -2 );}

int nConMod = GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE);
if(nConMod<(-2))nConMod=(-2);
if(nConMod>4)nConMod=4;

nTargetNumber+= nConMod;

if(d20() >= nTargetNumber)
{
// SUCCESS do the good thing for the PC here
// edit here

// edit to here
return;
}

// else FAIL! call the vultures!

// edit here

// edit to here

}

I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

on Mar 2, 2010, 4:52 PM, GM_ODA wrote:
here you go

int nConMod = GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE);
if(nConMod<(-2))nConMod=(-2);
if(nConMod>4)nConMod=4;



Umm doesn't GetAbilityScore return the ability NOT the bonus/penalty of the ability, hence the need for IF/ELSE sequence to determine that bonus or penalty?

Karvon

« Last Edit: on: Mar 3, 2010, 5:56AM » I.P. Logged
vanya mia

Forum God


Last On: Today
View Profile
Message Player

United Kingdom

Posts: 2259

Return To Top       

Yes, you need GetAbilityModifier instead.

Not 100% sure, as I don't know the context in the original script, but it looks like you are reversing the value of the CON modifier in which case I think

SetLocalInt ( oPC, "ConMod", 0 - GetAbilityModifier ( ABILITY_CONSTITUTION , oPC ) ) ;

gets you what the multiple if statements do in the version you originally posted.

« Last Edit: on: Mar 3, 2010, 8:50AM » I.P. Logged
GM_ODA

Extreme Poster


Last On: 02/08/12
View Profile
Message Player

Unknown

Posts: 459

Return To Top       

wooops.. yeah, coding sleepy is not good, the mod command is what was intended.

the following is fixed. Note this version does what you intended... the prior suggested fix does not cap on the +4 nor on the -2, but rather just give you the raw modifier.

Be well.

G


//Script generated by GM_ODA 20100302

void main()
{

object oPC = GetLastPlayerDied();

if (!GetIsPC(oPC)) return;

int nTargetNumber=18;

if (GetHasFeat(FEAT_TOUGHNESS, oPC)){nTargetNumber+= ( -1 );}
if (GetHasFeat(FEAT_EPIC_TOUGHNESS_1, oPC)){nTargetNumber+= ( -2 );}

int nConMod = GetAbilityModifier ( ABILITY_CONSTITUTION , oPC );
if(nConMod<(-2))nConMod=(-2);
if(nConMod>4)nConMod=4;

nTargetNumber+= nConMod;

if(d20() >= nTargetNumber)
{
// SUCCESS do the good thing for the PC here
// edit here

// edit to here
return;
}

// else FAIL! call the vultures!

// edit here

// edit to here

}

« Last Edit: on: Mar 3, 2010, 8:13PM » I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

Ok, think I understand this all so far...

However, as I mentioned, I'm not sure that...

object oPC = GetLastPlayerDied();

I don't think this will actually work, as the player is bleeding, and in fact not dead at this point. I merely used that target as that was the closest option offered in the Lilac scripting wizard.

I think I found where I can plug this portion of script into the habd_onpcdying script.

I changed the variable name to match the current habd variable. oPC is earlier defined as OBJECT_SELF, so figure that will carry over into the inserted code and properly collect the relevant info from the right PC.

Does GetAbilityModifier return the mod based on base or modified ability? Looking at the Lexicon, it doesn't seem you can add a TRUE flag like you can with GetAbilityScore.

Thanks to all for the assists so far,

Karvon

Modified script thus far...
===============================================
// if you get here - you are dying and have not been healed
// so you need to roll to see if you stabilize. Default d10.
int nSavingRoll = Random(HABD_STABILIZATION_DICE)+1;

// See what you must roll to self-stabilized
int iNeededSavingRoll = HABD_GLOBAL_STABILIZATION_NUMBER;
if ( HABDPlayerIsSolo(oPC) )
iNeededSavingRoll = HABD_SOLO_STABILIZATION_NUMBER;

///// new code insert ///////////

if (GetHasFeat(FEAT_TOUGHNESS, oPC)){iNeededSavingRoll+= ( -2 );}
if (GetHasFeat(FEAT_EPIC_TOUGHNESS_1, oPC)){iNeededSavingRoll+= ( -4 );}

int nConMod = GetAbilityModifier ( ABILITY_CONSTITUTION , oPC );
if(nConMod<(-2))nConMod=(-2);
if(nConMod>4)nConMod=4;

iNeededSavingRoll1-= nConMod;

/// end of new code insert /////

================================================

edited for final version I settled on.

« Last Edit: on: Mar 5, 2010, 12:06AM » I.P. Logged
Gulfwulf

Forum God


Last On: Today
View Profile
Message Player

United States

Posts: 4798

Return To Top       

The player never goes into dying mode, so you need the last player died, Karvon. I have a bleeding system I set up for D20 that I can modify and post here if you want it.

« Last Edit: on: Mar 3, 2010, 10:46PM » I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

Ah, this is NOT the full script, just a segment of the larger habd_onpcdying. I merely posted the relevant segment where I felt I could insert my additions to the existing code.

Does that make sense?

Karvon

I.P. Logged
Zelknolf

Experienced User


Last On: 10/04/10
View Profile
Message Player

United States

Posts: 31

Return To Top       

I think Vanya Mia had it right, looking at the original code. You want 18+ con to produce a -4 to this variable, and 6 con to produce a +2? If that's the case, you want:

if(GetHasFeat(FEAT_TOUGHNESS, oPC))iNeededSavingRoll -= 1;
if(GetHasFeat(FEAT_EPIC_TOUGHNESS_1, oPC))iNeededSavingRoll -= 2);

int nConMod = GetAbilityModifier (ABILITY_CONSTITUTION, oPC);
if(nConMod < (-2)) nConMod = (-2);
if(nConMod > 4) nConMod = 4;

iNeededSavingRoll -= nConMod;



Or I guess you can add negatives. nConMod = 0 - GetAbilityModifier in that case. Personally, I have an easier time reading subtraction.

I.P. Logged
Gulfwulf

Forum God


Last On: Today
View Profile
Message Player

United States

Posts: 4798

Return To Top       

I know what you posted, Karvon, but I didn't bother trying to modify HABD when I did the D20 version because of how complex it was. I went the easier route by starting from scratch.

I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

Hmm, yeah, after a second look, I would need to change the last line to:

iNeededSavingRoll -= nConMod;

as I want the con mod to reduce the roll needed for the bonus, or increase it for a penalty.

As I'm not much of a scripter, it's far easier for me to tweak an existing package I generally like, than write a full one from scratch. As I've used HABD in the past, and familiar with the basics, I chose to tweak that.

The addition I made compiled ok, which is always a good thing

Next, I'll do a small test mod and see if it works like I hope.

Then, I'll move on to the next tweak.

Thanks all for the help and suggestions so far.

Karvon

I.P. Logged
GM_ODA

Extreme Poster


Last On: 02/08/12
View Profile
Message Player

Unknown

Posts: 459

Return To Top       

nm

« Last Edit: on: Mar 4, 2010, 12:13PM » I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

Did some initial testing and the results are confusing.

HABD seems to be ignoring the non-default str level I put into the config options.

Instead of using 18, it still uses 10, and only 10. I see STR rolls over and under that which are ignored, but a roll of 10 results in a save.

OTOH, it may be simply reporting a successful save as a 10, cause I've always stabilized after a few rolls - and never bled to death, which is also a bit unlikely as my stabilization chances with my test PC is 30%.

Furthermore the instant death config in HABD is not working either atm.

It may be there's still something in the HCR scripts that's interfering, even though I went thru and turned off all the HCR related death scripts.

I guess what I'll have to try next is doing test mod with just HABD and see if it works properly in that.

Karvon

I.P. Logged
vanya mia

Forum God


Last On: Today
View Profile
Message Player

United Kingdom

Posts: 2259

Return To Top       

Can't help much without seeing all the scripts, and I've never used HABD as a separate pack. Can you post or forward the whole script, Karv?

I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

I think I figured the problem out; my test PC's level was below the level configured for killable in HABD, so he ALWAY stabiled - Duh.

Doing some updated testing to confirm this, and that a killable PC will work properly.

Karvon

I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847

Return To Top       

I've run a number of crash dummies thru a testing of the script and it seems to work as hoped.

By altering the dice used, save level and starting bleeding level in the normal habd_inc, you can decide how much you want the con and toughness to impact on the chances of success. Due to the penalty for low con, I'd suggest the save level at 3 below the max of the range, or very low CON PCs will never have a chance to recover.

Next up, CPR for the fallen.

Karvon

I.P. Logged
karvon

Forum God


Last On: Today
View Profile
Message Player

Japan

Posts: 2847
CPR for the Fallen
Return To Top       

As an extension of HABTD, I'd like to add a chance to revive those who've departed with the use of a healing kit. I'm thinking this would be a one shot effort per victim.

Alternatively, I guess you could allow multiple efforts with each subsequent effort having a less chance of success on the healing check.

I use a forced respawn to ghost after a few minutes of game time, so anyone who missed that window would stay dead.

DEATH FROM BLEEDING:
- PCs bleeding to -11 HP are critically injured.
- Such PCs can be revived to 1 HP by a one time DC 20 Healing check, followed by a DC 10 Fortitude save. 1 is always a failure and 20 is always a success on both rolls.
- PCs revived suffer no XP penalty.

DEATH FROM MASSIVE DAMAGE:
- PCs going -33 HP, or more, from a single cause are mortally injured.
- Such PCs can be revived to 1 hp by a one time DC 30 Healing check, followed by a DC 20 Fortitude save. 1 is always a failure and 20 is always a success on both rolls.
- PCs revived suffer no XP penalty.

I'm a bit clueless as to how I'd go about doing all of this. I suspect I'd need to add some sort of variable on death/dying scripts to victims to flag which category they fell into and reset this when a victim either respawned to ghost or was successfully healed. I'm guessing I'd need to modify the current healing kit scripts to have the potential effect I'm after.

Any words of wisdom/guidance appreciated

Karvon

I.P. Logged
Pages: 1  
Moderators: Rizzen, Shinji, Gilaun, Garnak, J'Dai Voisin, Lazybones, Ochobee, Eliandi
   NeverwinterConnections.com
   Main Topics
   Builders Discussion

   Mod'ing HABD

 
Copyright © 2002 Shawn Schultz. All rights reserved.
All trademarks are properties of their respective owners. Read our Terms of Use and our Privacy Policy.