Jump to content

NPC's using Magic/Scripted enchantments


Mez558

Recommended Posts

Posted

To explain what I have done to start with, I added the undress script from Eli's Knock their Boots off to the werewolf knockback ability and then added that to a weapon (Thresher Maul from Immersive Weapons, in case you are interested) so with a power attack it knocks the target back and blasts off their clothes and weapons. All good fun. Except when an NPC uses it, like a bandit, it doesn't work.

 

Is this something I can fix or is it just how the game is? I've not tried giving it to a follower yet. I shall try that but certainly no antagonist character has been able to take advantage of their OP hammer.

Posted

Maybe npc never used the power attack? Now I think about I don't recall any npc using power attack with 2 hand weapon, have you seen them do this and if so maybe it was only if they had a specific class or combat ai?

Posted
3 hours ago, RW311 said:

Maybe npc never used the power attack?

no difference between npc and dragonborn for that, but npc are more stupids

 

if npc have a 2h hand hammer, and his combat style is 1h.... a shield in his inventory? he may go fist + shield (complicated to pick idle 2hhammerfront, if npc hammer isn't equipped)

tank combat style will play with his shield much more than barbarian combat style

power attack require stamina, you regen it fast with your tempered enchanted gear and your perks? nd the npc with his natural regen of 0.4 per second or whatever?

he is starring at you behind his shield because he no longer have the stamina to do something else, and when you hit that shield, that eat some of that npc stamina, that become a starring meat shield waiting for you to finish him off

attack effect of knocking down, bleed or whatever won't happen if the attack can be block, and you block it

bear see you, bear charge you, bear end up in a tree, you won't be send flying either, power attack have to hit something, for something to happen

 

but i would take a closer look at what that script is supposed to do, before doing anything

 

script do something when werewolf use knock down attack

script do something when not werewolf use hammer power attack that also have a % of know back

don't that something happen when target is knock back? not because it got hit by whatever attack

what are the chance for that npc, to knock back something? that npc isn't the cheatty dragonborn in tempered enchanted gear and multiple buffs from quests that allow him to keep drinking his beer while a level 10 wolf is trying to bite him

Posted

Just to be clear, this isn't a perk or a skill, it's an enchantment on a weapon. The script is attached to the enchantment.

NPC's do use power attacks, not as often as the PC might but they do but power attacks are done.

I can only assume that the activator part  (On Power Attack) only works for the PC and so doesn't count for NPC's so the enchantment is never activated for anyone but the PC.


The original knock back ability that Lycanthropes get works on a percentage chance (so an RNG I guess) but I couldn't get this to work when applied as a Weapon enchantment, it was all or nothing and all the time was way too powerful.

 

Oh well, a bit of a shame. My alternative would be to make the weapon exceptionally slow and remove the power attack caveat. Might be a little more balanced like that. Not that a weapon that sends you flying and strips your weapons and armour is balanced :D

 

As an Edit to this:
 

The conditions do not seem to allow for NPC's.
I've tried it with the Target set to Subject and it doesn't work at all. It only seems to work with the Target is set to Player. Which explains why NPC's cannot activate the Enchantment with power attacks.
Shame :(

Posted

is it that hard to just check?

 

Actor Property TargetRef Auto

Event OnEffectStart(Actor target, Actor caster)

    if (caster != Game.GetPlayer())
        return
    endif
    
    ;Debug.Notification("Shout!!!")
    
    ; Get the target
    TargetRef = target
    
    DropItemInSlot(30)    ; Head
    DropItemInSlot(37)    ; Feet
    DropItemInSlot(42)    ; Circlet
    DropItemInSlot(55)    ; Wearable Lantern??
    DropItemInSlot(57)    ; Wearable Lantern??
    
EndEvent

 

you just have to delete caster != player for that to run on npc

no need to slow down weapons either, just replace that if with a if random(0,3)>2 or something

 

 

 

Posted
3 hours ago, yatol said:

is it that hard to just check?

 

Actor Property TargetRef Auto

Event OnEffectStart(Actor target, Actor caster)

    if (caster != Game.GetPlayer())
        return
    endif
    
    ;Debug.Notification("Shout!!!")
    
    ; Get the target
    TargetRef = target
    
    DropItemInSlot(30)    ; Head
    DropItemInSlot(37)    ; Feet
    DropItemInSlot(42)    ; Circlet
    DropItemInSlot(55)    ; Wearable Lantern??
    DropItemInSlot(57)    ; Wearable Lantern??
    
EndEvent

 

you just have to delete caster != player for that to run on npc

no need to slow down weapons either, just replace that if with a if random(0,3)>2 or something

 

 

 

 

It's not an issue with the script. It's an issue with how CK applies Conditions.

 

The enchantment script works fine for everyone PC and NPC alike providing you don't set any conditions in CK but I set the Condition IsPowerAttacking. However there is no way to assign that to a generic wielder of the weapon, the only option that works is Player and obviously that doesn't work for NPC's.

 

But thank you for your suggestions. I had already edited Eli's script to add other slots to it but hadn't looked at that part. The version I have works for the Draugr as well so it's not the same one you have there which looks like it's the player only version.

 

This is mine, well this is Eli's script that edited to remove other items and not remove Circlets (because you always lose them. Items disappear when dropped in Skyrim all the time but Circlets, they just roll away and fall into Oblivion w

 

Actor Property TargetRef Auto

Event OnEffectStart(Actor target, Actor caster)

    Debug.Notification("Shout!!!")
    
    ; Get the target
    TargetRef = target
    
    ; Left remove some armor
    DropItemInSlot(30)    ; Head
    DropItemInSlot(32)    ; Body
    DropItemInSlot(33)    ; Hands
    DropItemInSlot(34)    ; Forearms
    DropItemInSlot(37)    ; Feet
    DropItemInSlot(38)    ; Calves
    DropItemInSlot(49)    ; UnderWear
    DropItemInSlot(52)    ; UnderWear2
    DropItemInSlot(57)    ; Wearable Lantern

    ; Drop any weapon in the left hand
    Form item = TargetRef.GetEquippedWeapon(true)
    if (item)
        TargetRef.UnequipItem(item, true, false)
        TargetRef.DropObject(item)
    endif
    
    ; Drop any weapon in the right hand
    item = TargetRef.GetEquippedWeapon(false)
    if (item)
        TargetRef.UnequipItem(item, true, false)
        TargetRef.DropObject(item)
    endif
    
EndEvent

 

 

 

Condition.jpg

Posted
30 minutes ago, Mez558 said:

 

Condition.jpg

run on : player

bet for that to work on npc, you have to select run on : all, or humanoid or whatever there is there

Posted
7 minutes ago, yatol said:

run on : player

bet for that to work on npc, you have to select run on : all, or humanoid or whatever there is there

 

Unfortunately that option isn't there. I thought it might be subject but that doesn't work either.

 

 

Condition2.jpg

Posted
1 hour ago, Mez558 said:

 

 

Condition2.jpg

 

if i read what i see right, that effect have condition actor player ispowerattacking

 

there's a select on the right, you probably have to be pick caster or something after selecting subject, or reference, or whatever it is (there's the crap kit site to check what it is for doing something)

 

you want the weapon to strip the target, not all the time, that script would do it

 

script pouf extend magiceffect

 

event onhit(actor npc, actor target)

int i = random (1,100)

if i > 50

   DropItemInSlot(30)    ; Head
    DropItemInSlot(32)    ; Body
    DropItemInSlot(33)    ; Hands
    DropItemInSlot(34)    ; Fo

endif

endevent

 

no need to give any condition to the effect, you want that to only happen if target is hurt? put if target.health < x instead, or whatever you want

 

 

 

 

Posted
17 hours ago, yatol said:

 

if i read what i see right, that effect have condition actor player ispowerattacking

 

there's a select on the right, you probably have to be pick caster or something after selecting subject, or reference, or whatever it is (there's the crap kit site to check what it is for doing something)

 

you want the weapon to strip the target, not all the time, that script would do it

 

script pouf extend magiceffect

 

event onhit(actor npc, actor target)

int i = random (1,100)

if i > 50

   DropItemInSlot(30)    ; Head
    DropItemInSlot(32)    ; Body
    DropItemInSlot(33)    ; Hands
    DropItemInSlot(34)    ; Fo

endif

endevent

 

no need to give any condition to the effect, you want that to only happen if target is hurt? put if target.health < x instead, or whatever you want

 

 

 

 

I tried the other "Run on" conditions, none seemed to work. I just think that is an issue with CK.

 

Thanks for the script I might give that a try.

  • 3 weeks later...
Posted

Fixed this, if anyone cares :D

So to start with, the Werewolf KB effect doesn't ever seem to work against the player. It works on NPC vs NPC but not against the player so giving an NPC a weapon with this as a Magic effect doesn't work anyway.

Created a new MGEF using a duplicate of the _Eli_VoiceNudeEffect03 MGEF that uses Eli's script. Only changing Delivery to Contact rather than aimed and then made a new enchantment using this.
Set conditions to
IsPowerAttacking - Player - or
IsPowerAttacking - Subject

This seems to work fine.

Added the FRD push effect to it as well with same conditions, using the same method. Creater an MGEF that is Contant instead of Aimed (and remove all the sounds) however this is a lot more violent a knockback compared to the Werewolf one so I am going to try and get that one working in it's place, somehow :D

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...