Deleted11438360User Posted May 4, 2016 Share Posted May 4, 2016 Hi everyone, I'm VERY new to scripting. I would like to know how I can check the death of an NPC remotely. The problem I am having is that I don't want to attach the script to an actor for compatibility reasons - as this actor is a vanilla NPC. If anyone could tell me (in simple terms) what I would need to do, I would be very grateful. I have been thinking of remotely adding a spell effect to the NPC from elsewhere, and then using a ActiveMagicEffect on that effect to do stuff when the actor dies. Honestly though, this is all above me. Any help at all is appreciated. If you can add examples so I can learn (I'm a visual person) that would be dandy. Many thanks. Link to comment Share on other sites More sharing options...
csbx Posted May 4, 2016 Share Posted May 4, 2016 This is way way out of my capability, but could you not set up a quest that has that character as an alias and then attach a script to that alias ? Or is that just as 'incompatible' as attaching it to the base actor ? Link to comment Share on other sites More sharing options...
Deleted11438360User Posted May 4, 2016 Author Share Posted May 4, 2016 I thought about that, but that is why I am asking because I have no idea. You mean like this?: http://www.creationkit.com/index.php?title=SM_Event_Node I just want to get if the actor is dead and then do stuff if they are. Maybe I'll have say 5 people and I want to see if they are dead. I guess I could add a counter and when that counter reaches 5, the quest will stop running. I basically only started trying to script last night. I think my logic may be sound, but it's just executing it correctly that I'm struggling with. Link to comment Share on other sites More sharing options...
soupdragon1234 Posted May 4, 2016 Share Posted May 4, 2016 (edited) You can check for the alive/dead state of any actor on any running script anywhere with IsDead()If Amren.IsDead() ; is actor dead? ; do dead stuff here Else ; do other non-dead stuff here Endif Or if the actor is in a reference alias that has a script attached you can use the On Death event Event OnDeath(Actor akKiller) ; game has noticed actor has just died so do stuff here, akKiller is the actor who did the killing EndEventyou don't need a script though you can just use a condition function on a specific reference or simply subject if attached to a reference alias. :thumbsup: http://i.imgur.com/7mVlvEP.png Edited May 4, 2016 by soupdragon1234 Link to comment Share on other sites More sharing options...
Deleted11438360User Posted May 4, 2016 Author Share Posted May 4, 2016 Oh brilliant. The last method is the simplest yet so very effective. The things we DON'T think of sometimes. Thank you. I'm going to have to read more into ReferenceAlias because I'm currently assuming it allows you to do stuff with NPCs without affecting their base? Link to comment Share on other sites More sharing options...
soupdragon1234 Posted May 4, 2016 Share Posted May 4, 2016 (edited) On 5/4/2016 at 1:35 PM, arronus said: Thank you. I'm going to have to read more into ReferenceAlias because I'm currently assuming it allows you to do stuff with NPCs without affecting their base? Yes exactly, think of it as a box that the actor sits inside, you can attach scripts, ai packages, factions, keywords etc to the box without compromising the actor within. :wink: Edited May 4, 2016 by soupdragon1234 Link to comment Share on other sites More sharing options...
Deleted11438360User Posted May 4, 2016 Author Share Posted May 4, 2016 (edited) Okay I'm a bit stuck here because I wanted to have a go at the ReferenceAlias option. I went to the wiki but I can't find any information really. So I have an ObjectReference script and I want the player to activate this. When activated, if the NPC isn't dead, it should shows a messagebox; otherwise it shows a menu. I can't use IsDead from the ObjectReference script because it says it doesn't exist. Now, I need to check if someone's dead and report that value to my object. I'm going to go and say an alias should be setup from a quest? I have no idea how to set this up though really. Edited May 4, 2016 by Guest Link to comment Share on other sites More sharing options...
FrankFamily Posted May 4, 2016 Share Posted May 4, 2016 (edited) An activator that checks for an actor to be dead?Scriptname lalala extends ObjectReference Actor Property MyTargetActor Auto {point this in ck to the actor in question, if this was an objectreference you would have to cast to actor later} Message Property MyMessage Auto {fill with the message to show} Event OnActivate(ObjectReference akActionRef) If MyTargetActor.IsDead() MyMessage.Show() Else ;maybe do something if he is not dead? another message? if not then remove else Endif EndEvent Edited May 4, 2016 by FrankFamily Link to comment Share on other sites More sharing options...
Deleted11438360User Posted May 4, 2016 Author Share Posted May 4, 2016 That works FrankFamily! I was probably missing something that I didn't notice like an idiot. I copied your code and it worked. Fantastic, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts