Scriptname DisguisePlayer extends ActiveMagicEffect {"disguises" player by making them the target race while active} Race Property TargetRace Auto ;Race to "disguise" player as. Race PlayerRace ;Internal value to store player's race while effect's active. Event OnEffectStart(Actor akTarget, Actor akCaster) ;When the effect becomes active PlayerRace = Game.GetPlayer().GetRace() ;Store player's race for later akTarget.SetRace(TargetRace) ;set player's race as target race EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) ;when the effect ends akTarget.SetRace(PlayerRace) ;set player's race as their original race, as set in the start event. EndEventAs the comments note, on activation it stores the target's race (since it involved the player, I've written that but it should work equally well on an NPC, although I haven't tested that) and switches it to the target race (given by a property) and on finishing it returns their race to its original value.
I've hooked it up to an enchantment, attached that to a piece of armour and said armour makes the player character the target race while they have it equipped as I intended, but the problem is it also changes the racial abilities. Obviously this gets in the way of the idea that it's just a disguise so I was wondering if anyone knows a way I can change the NPC's race without changing their abilities (obviously this isn't much of a difference, but it feels sloppy not doing anything about it)?
EDIT: I've also encountered some more problems after using it to create a spell effect/enchantment and applied it to the robe (see the mod in my signature);
- I've found that characters still keep their skin tone (which obviously looks off, particularly with Dunmer). Is there a way I can make the script change it manually?
- Also, I've found that the character models don't always mesh with the robe (possibly because they get switched to the new model but since the robe's already equipped it doesn't fit).
