Jump to content

Trying to get a spell that alerts nearby actors working via script


Keinichn

Recommended Posts

Good morning/evening everyone,

 

Currently I'm working on an item that when used has a chance to notify everyone around you of your presence rather than the intended effect. In order to do this, I have a spell created that has an area of effect, but no visual effects, sounds, or projectiles, and is a Self spell. I have the casting sound level set to "very loud", though I doubt that matters since I have no sounds.

 

If I add this spell to my player and cast it, the spell works as expected: All NPCs around me immediately know where I'm at. Casting via the following line in script gives a different result:

 

SpellToCast.Cast(PlayerRef, PlayerRef)

 

I can verify that the spell does cast via debug text that appears when it hits the NPCs in the area of effect, however none of the NPCs detect me and continue doing their AI packages like nothing happened. Anyone have any insight into why the behavior is different via script even though the player is the caster in both situations?

Link to comment
Share on other sites

Try doing SpellToCast.Cast(PlayerRef) instead. Putting the PlayerRef in the second argument means you're specifying the player as the target. Although, if you've already confirmed the spell is running on NPC's it might not matter, but it's worth a shot.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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