WOTmodsproductions Posted May 21, 2017 Share Posted May 21, 2017 (edited) Hi, I'm currently making a mod and one part involves a hallucination / illusion of some NPCs. Everything works fine except when the npc dies (intended part of the scene) I don't know how to make the body disappear (as it is mean to be a hallucination and should disappear on death) I'm wondering if someone could write a simple script that will disable anything it's attached to on death And also is there anything I need to do to get this working as I'm not really familiar with scripting, all credit for the script will go to the author in the mod description of course Thanks in advance Edited May 21, 2017 by thelonewarrior Link to comment Share on other sites More sharing options...
TheDungeonDweller Posted May 21, 2017 Share Posted May 21, 2017 (edited) Assuming this NPC is a reference alias. Scriptname DisableAliasOnDeathScript extends ReferenceAlias Event OnDeath(Actor akKiller) (GetReference() as Actor).Disable() EndEventFor this really easy script, all you need to do is create a new script on the alias and copy/paste this into it.This will give you the basics on script creation: http://www.creationkit.com/index.php?title=Bethesda_Tutorial_Papyrus_Hello_World Edited May 21, 2017 by TheDungeonDweller Link to comment Share on other sites More sharing options...
WOTmodsproductions Posted May 21, 2017 Author Share Posted May 21, 2017 (edited) Ok so it's not an alias, the NPCs are spawned via an explosion using "placed object" as they appear from an explosion that distorts the air like a portal (sorry it's weird I know), is there anyway to write a script that just disables whatever it's attached to once they die? So that it just references itself? And then disables it, whatever that might be? It's basically a weapon that causes the player to hallucinate when hit and the npc spawns from nowhere in the same way you would "summon" a new creature in other games like skyrim Thanks again Edited May 21, 2017 by thelonewarrior Link to comment Share on other sites More sharing options...
werr92 Posted May 21, 2017 Share Posted May 21, 2017 Yes. Just correct the script above so it would look like this: Scriptname YourCustomScriptName extends Actor Event OnDeath(Actor akKiller) Self.Disable() EndEvent And attach it locally on the Actor Base (NPC in ObjectWindow). Link to comment Share on other sites More sharing options...
WOTmodsproductions Posted May 21, 2017 Author Share Posted May 21, 2017 Yes. Just correct the script above so it would look like this: Scriptname YourCustomScriptName extends Actor Event OnDeath(Actor akKiller) Self.Disable() EndEvent And attach it locally on the Actor Base (NPC in ObjectWindow). Thanks a lot! Works really well :) Ill be sure to mention both of you when my mod is released Link to comment Share on other sites More sharing options...
Recommended Posts