Keinichn Posted February 11, 2021 Share Posted February 11, 2021 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 More sharing options...
dylbill Posted February 11, 2021 Share Posted February 11, 2021 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 More sharing options...
Keinichn Posted February 11, 2021 Author Share Posted February 11, 2021 Unfortunately, that didn't change anything. I might need to rethink this. Link to comment Share on other sites More sharing options...
dylbill Posted February 11, 2021 Share Posted February 11, 2021 If you want to do it via script you can try using the CreatDetectionEvent function: https://www.creationkit.com/index.php?title=CreateDetectionEvent_-_ObjectReference Link to comment Share on other sites More sharing options...
Keinichn Posted February 12, 2021 Author Share Posted February 12, 2021 That seems to be exactly what I was looking for originally. No clue how I didn't find it. I haven't tried it yet but it looks like it'll get the job done. Thanks. Link to comment Share on other sites More sharing options...
dylbill Posted February 12, 2021 Share Posted February 12, 2021 No problem :) Link to comment Share on other sites More sharing options...
Recommended Posts