Thanks, Tarot_Redhand, for your reply! The lexicon is a super-helpful archive, and I’ll definitely be returning to it going forward.
Problem is, I’ve already been using EffectMovementSpeedDecrease(int nPercentChange);
in my little code snippet. It does what it says on the tin, and I love it, but the “running” animation still occurs when the PC is moving a great distance. Lemme see if I can’t post some of my embarrassingly amateur code and show a little of what I’m attempting.
// all the effects that make up exhaustion
effect eStrDec = EffectAbilityDecrease(ABILITY_STRENGTH, 6);
effect eDexDec = EffectAbilityDecrease(ABILITY_DEXTERITY, 6);
effect eMovDec = EffectMovementSpeedDecrease(50);
int GetEncumberedL(int nStr){
int nEncumberedL;
switch (nStr){
case 1:
nEncumberedL = 6;
return nEncumberedL;
break;
case 4:
nEncumberedL = 26;
return nEncumberedL;
break;
case 10:
nEncumberedL = 86;
return nEncumberedL;
break;
default:
return nEncumberedL;
break;
}
return nEncumberedL;
}
// make object's skin "heavy" to stop running
void EffectEncumber(object oTarget, object oSkin){
int nInvWeight = GetWeight(oTarget)/10;
int nStrScore = GetAbilityScore(oTarget, ABILITY_STRENGTH, FALSE);
int nLeftover = (GetEncumberedL(nStrScore) - nInvWeight);
int nWeight;
if (nLeftover <= 5)
nWeight = IP_CONST_WEIGHTINCREASE_5_LBS;
else if (nLeftover <= 10)
nWeight = IP_CONST_WEIGHTINCREASE_10_LBS;
else if (nLeftover <= 15)
nWeight = IP_CONST_WEIGHTINCREASE_15_LBS;
else if (nLeftover <= 30)
nWeight = IP_CONST_WEIGHTINCREASE_30_LBS;
else if (nLeftover <= 50)
nWeight = IP_CONST_WEIGHTINCREASE_50_LBS;
else
nWeight = IP_CONST_WEIGHTINCREASE_100_LBS;
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyWeightIncrease(nWeight), oSkin, -1.0f);
}
void main(){
object oTarget = OBJECT_SELF;
object oSkin = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oTarget);
if (GetHasFeat(1117, oTarget)){
ExecuteScript("cond_fatigued", oTarget);
return;
}
else{
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eStrDec, oTarget, -1.0f);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDexDec, oTarget, -1.0f);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMovDec, oTarget, -1.0f);
}
EffectEncumber(oTarget, oSkin);
}
In this case, I’m using switches to test out little miss Darkstar’s strength, light-encumbrance capacity, and add weight according to what will fill up her light-encumbrance. The question might be “???” at this point, but it is indeed the thing I’m trying to do. It works. Kind of. I mean, it sets all the variables to the right values, changes the weight of the skin and everything, but her actual inventory weight does not change.
I know, my code is horribad. This isn’t something I do professionally. I just thought this “weight-gain” would work.
(Also, bad code is so bad it broke post formatting. Nice.)