I’m trying to make restraint inventory items apply strength and dexterity (edit: order flipped for clarity) decreases to captives, but only one of the effects (the first) is being applied reliably. Dexterity reduction is sometimes there and sometimes not.
AssignCommand(oRestraint, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectAbilityDecrease(ABILITY_STRENGTH, nStr)), oCaptive));
AssignCommand(oRestraint, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectAbilityDecrease(ABILITY_DEXTERITY, nDex)), oCaptive));
The restraints are successfully applying several other effects at the same time, as well, none of which are causing trouble. It only happens for the ability decrease effects here.
I’ve tried linking the effects via EffectLinkEffects, as well as applying the second effect at a slight delay, but it hasn’t helped. Is anyone familiar with this problem, or knows a trick for getting both effects on reliably?
Alternatively, suggestions for other combat maluses to apply to captives while bound would do the trick too. The aim is to make captives mostly useless in combat.
As this is for making them useless in combat why not use EffectACDecrease instead. From the lexicon -
EffectACDecrease(int, object, int)
Creates an AC decrease effect.
object nModifyType = AC_DODGE_BONUS,
int nDamageType = AC_VS_DAMAGE_TYPE_ALL
AC_* (Default: AC_DODGE_BONUS)
DAMAGE_TYPE_* (Default: AC_VS_DAMAGE_TYPE_ALL)
Effect sets to remove the specified amount of bonus from an object. The type of AC removed is of nModifyType.
The target this effect is applied to must be a creature for it to work. This effect cannot be applied instantly, only temporarily or permanently.
Placeables and Doors have no AC, and the attack rolls are only for getting a 1 (Natural Miss, somehow) and a 20 (Natural hit) or a Critical Hit.
Cirtain AC bonuses can help against cirtain attacks, and dodge bonuses always stack. Touch attacks are a good example of where, for example, Armor AC bonuses do not apply. It also helps because different items give different types of AC bonuses.
The limit of nValue is unknown.
Default value for nDamageType should only ever be used in this function prototype.
AC decreases do stack, and the type to decrease will, as it were, decrease the armor of that type until it is 0. All this means is that if you specifiy 10 penalty to Natural AC, yet they have only a amulet of +2 Natural AC, it still does a 10 AC penalty, and the +2 Natural AC doesn’t apply to, say, touch attacks.
If the above comment is wrong, it will be best to use Dodge Bonus to accuratly decrease by nValue, as Dodge is always a present value (in the form of Dexterity bonuses).
Effect functions are Constructors, which are special methods that help construct effect “objects”. You can declare and link effects, and apply them using an ApplyEffectToObject() Command. Once applied, each effect can be got seperately via. looping valid effects on the target (GetFirst/NextEffect()). See the Effect Tutorial for more details.
That sounds promising, and possibly like a better option entirely, since it presumably won’t mess with other things, like Open Lock skill rolls. Thanks, Tarot.
It’s probably a good idea to decrease attack and damage bonuses as well.
Yeah. I’ll leave the stats alone, give them AC Decrease, Attack Decrease, and Miss Chance instead.
Would anything else make sense to throw on captive creatures? Skill reductions on move silently and intimidate, maybe? hm.
Don’t forget encumbrance. Even the ropes must weigh something. You might want to look at EffectMovementSpeedDecrease as well.
Are you calling assigncommand on an item?
Yep. It makes the item the creator of the effect, so GetEffectCreator can be used in the effect-removal loop to remove only the effects created by that item. (Or so I think, anyway. Pretty sure the PC is OBJECT_SELF where this stuff is happening. … ::headscratch:: Need to test. Addendum: Oh! Right. OK, OBJECT_SELF is actually the module, since it’s an OnActivateItem script. Yep, AssignCommand-ing the ApplyEffectToObject-s is making the restraint effect creator of the various effects.)
I didn’t think items had an action queue. Should you be able to do that on an object without an action queue?
Damned if I know. It doesn’t seem to work for most commands. SpeakString doesn’t do anything, and IIRC inventory item containers can’t use ActionTakeItem either; has to be the owner using ActionGiveItem to put things inside. Could be interesting to experiment with, someday.
If your world has magic in it then you probably want to tie their fingers and gag them as well, giving them 100% spell failure chance.
Edit: Btw, is it unfeasible to simply make an armor item called a straightjacket or something with all the penalties on it as properties and then forcing PCs to wear it? It would have the added benefit of making them look like captives, since armor determines look.
Nice thought! I’d’ve missed that. Added 100% spell failure for captives that don’t have the Still Spell feat and 25% spell failure for those who do just to be a jerk to captive spellcasters.
It’s perfectly feasible. In this case, armor appearance change is happening via swapping out the robe slot appearance of the armor, or else spawning and equipping a template armor if the target has nothing equipped in the chest slot. Has the drawback of taking away the robe appearance. We considered doing a “captive” phenotype, but we didn’t think it was a good idea to do on short notice, given the time constraints of the CCC.
I like the idea of gags! That should be a separate item, head-aligned VFX and all. Heck, blindfolds, too.
Videogames are meaningfully improved by being unable to control your own character, or even see what’s happening.
I’d think restraining someone gave them 100% spell failure unless they had still spell and that gagging someone gave them 100% spell failure unless they had silent spell.
They can’t have both normally, so they would need automatic still spell and a silent spell feat or vice versa, or both automatic to cast, unless they were casting some of the spells (like darkness and true strike) that only have a single component.
I like the idea of making the gag a headpiece and making it apply blindness. (Maybe someone made a custom model for a bag over the head?) You could make a pair of gauntlets too that prevent people from changing their equipment while worn.
You could also consider preventing the captive from resting, if possible. Lots of way to torment people, lol.
::suggestive eyebrow waggle of having actually made a bag-over-the-head helmet already.::
Yeah. Lots of neat stuff that restraints pack could be upgraded with. Noted for future reference.
On the OP, is this happening in the module on acquire event? If so, there’s no need to AssignCommand, just ApplyEffectToObject. The module will do that instantly. Otherwise, try assigning the commands to the module.
Cool thing about the bag is it’s a kind of Schroedinger’s gag You can’t see their mouths so they’re basically gagged underneath if you say so.
They would be simultaneously gagged and not gagged.
@Proleric : Right, that’s partly what I was getting at. Also, AssignCommand adds a command to an object’s action queue. I’m not sure what it’s supposed to do when called on an object that doesn’t have an action queue.
You’re thinking of ActionDoCommand(). AssignCommand() simply passes the command off to a different object.
At any rate, the AssignCommand() doesn’t seem to be the problem as the same thing happens when the object assigned to is the PC or when you remove AssignCommand() completely (letting the module apply the effect).
I’m honestly at a loss for why this isn’t working. When I try to apply the status effects to myself, both of them appear. When applying them to an NPC, only the Dexterity penalty appears. Linking the effects makes no difference, nor does changing the order in which they are applied. I wondered if having the same effect type with different subtypes was a problem, but the same does not happen with EffectAbilityIncrease().
I did link to AssignCommand’s Lexicon page. It says pretty clearly that it adds it to the action queue. Or is that wrong?