geisttgih Posted May 16, 2010 Share Posted May 16, 2010 Hello, after searching through the TESCS wiki and related websites, I have yet to find a solution to my problem. I'm trying to script a spell that, as part of the spell's effect, will change an NPC's essential status to 0 if it is currently at 1. My initial block attempt (not the full code): If isEssential == 0set isEssential to 1 crashed the game when used on an Essential NPC, for (as I now know) you can't treat isEssential like a changeable variable. My search then led me to use "SetEssential [ActorBase] 0", but how can I script my spell to fill in [ActorBase] with the proper ID with each cast? Seeing as how it will be used on different NPCs. Link to comment Share on other sites More sharing options...
Shadowfen Posted May 16, 2010 Share Posted May 16, 2010 Hello, after searching through the TESCS wiki and related websites, I have yet to find a solution to my problem. I'm trying to script a spell that, as part of the spell's effect, will change an NPC's essential status to 0 if it is currently at 1. My initial block attempt (not the full code): If isEssential == 0set isEssential to 1 crashed the game when used on an Essential NPC, for (as I now know) you can't treat isEssential like a changeable variable. My search then led me to use "SetEssential [ActorBase] 0", but how can I script my spell to fill in [ActorBase] with the proper ID with each cast? Seeing as how it will be used on different NPCs. You probably want to use the GetSelf function to get a reference to the magic effect target, and then test that reference to make sure that it is both an Actor (using IsActor) and is not a creature (using IsCreature) before executing the setessential on the reference. Probably might want to make sure that the reference is not to the player as well - I'm not really sure what would happen if you attempted to set the player as essential. <g> Link to comment Share on other sites More sharing options...
LFact Posted May 16, 2010 Share Posted May 16, 2010 SetEssential does not take ReferenceID, so I don't think you can use GetSelf for that. If you want to make a target essential/not essential, you may need OBSE function 'SetRefEssential'. **Check 'Set Essential Actors' and its plus version.(Both require OBSE) Link to comment Share on other sites More sharing options...
Recommended Posts