Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

NPC's fail to cast Runes


EtherealCoder
 Share

Recommended Posts

Hi all

 

I've been trying to get NPC's to lay boobytraps -- however, they fail to cast Runes when told to do so via a multitude of ways. The following examples do not work:

 

Method 1 of 2: This works fine when making someone summon a Storm Atronach.

; Force equip the spell.
(akActionRef as Actor).EquipSpell(RuneSpellRef, 0)
							
; Force cast the spell.
RuneSpellRef.Cast(akActionRef)

Method 2 of 2: AI Procedures

 

Similarly, I've made a Procedure based on UseMagic which also fails. The condition for casting is the Spell being equipped in the left hand -- which is forced by another Script.

 

 

 

In both of these cases, I can hear the spell being charged, but it's always followed by the "fizzle" noise. So, it appears as if the system is struggling to cast as desired, but it can't aim at the correct target (nearby surface).

 

To try and engineer around this, I made a copy of the ShockRune Spell and related MagicEffect, but changed the type to Aimed. The Rune was successfully cast, though it would manifest in thin air and then change its Alpha to 0. When I walked by, it detonated -- however, I couldn't get the NPC's to aim at the ground, and SnapToNavmesh didn't work to reign in the abberant behavior.

 

Either way, I just want this spell to cast correctly. Ideally, it should do the usual: drain Magicka from the spellcaster; and only allow 1 or 2 Runes at a time depending on the Perks of the caster; etc..

Suggestions appreciated!

Edited by EtherealCoder
Link to comment
Share on other sites

I honestly don't think I've ever seen that done. I think NPC need to have something to aim at. So the mob/player/actor they are attacking feeds a x/y/z pos to them and the just cast a spell in that direction. Whereas with the player, the dot in the middle of the screen feeds the x/y/z pos into the spell. Thing to remember is that  dot knows how far away the object your looking at is. The x/y/z pos it gives out is the closet object in it's path. 

So find a way to feed the right data into the NPC and you could get them to cast it. It would be easy for quests, and maybe if you made a new follower command? So it took your data and used it? Anyways, hope that helped a bit.

Link to comment
Share on other sites

Thanks for the fast reply, Walrus.

 

I tried your suggestion -- namely passing a reference which has been moved to the proper location. Unfortunately, it didn't work.

 

I did some further experimentation, and found that changing the Projectile tied to the Magic Effect had a significant impact. Changing the Collision Layer to L_GROUND made the spell cast perfectly, but it would not detonate after. Evidently the L_SPELLTRIGGER collision layer is tied to the projectile's Alt-triggered Explosion, not what the projectile is hitting.

 

I've also been able to Remote-Cast, with two problems: the Rune is sideways vs. the ground, and it will also detonate when the "blamed" NPC caster gets near. Not desirable.

 

I've tried changing the Projectile Type and Collision Layer multiple times, but to no avail. I even set the Projectile Type to Missile / Cone, Velocity to 0, and Gravity to 2000 in order to get it to "fall" straight down. Again, the NPC's won't even cast it.

 

I've also reduced the Collision Radius significantly to avoid issues with the caster hitting him / herself, no go. Same with Disable Combat Error Correction, just in case that was messing with NPC aim.

 

Considering that SnapToNavMesh didn't even save this, I'm beginning to think that it's just impossible to get the NPC's to cast Runes. I've checked the Usage Info for the other Rune spells, and they're not widely used by anything -- I think they're one of the few spells that Bethseda did not give to any native NPC's.

 

 

 

So given that all of those options don't work, it'd be nice just to just "fake it" as follows:

  1. Place the Rune at the desired location.
  2. Set the Rune to not detonate on the supposed caster (or, ideally, their Faction).
  3. Manually subtract the Magicka from the supposed caster.

 

Has anyone had experience pulling off something like this? I would have no idea how to spontaneously create a new Projectile or assign the relevant "ownership" to protect the supposed caster.

Link to comment
Share on other sites

Hi Echo

 

I tried that, but unfortunately, the Projectile doesn't work. If it's Aimed and a Lobber, it still just freezes at the point where it's cast. If it's a Missile, then it goes through the floor (doesn't impact), though it will still detonate if I make the projectiles slow enough so I can walk through 'em.

 

If the Magic Effect is set to Target Area, then it still doesn't cast. What's especially frustrating about that is the fact that the technique you mentioned does work to get NPC's to aim at a specific location -- I used the same aiming commands and made them cast an Ice Storm spell, and they were clearly shooting at my feet. If the Target Location effect had worked for NPC's, then the Rune would have been cast perfectly.

 

While it's a wash for the Runes, at least the XMarker technique has now been proven viable for other spells / activities.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...