Guest Messenjah Posted August 24, 2012 Share Posted August 24, 2012 Ok, here is something weird.... I got the quest to start and the quest to repeat.... just followed the way it was done in Dark Brotherhood Forever. Made a second controller quest. At the end of my quest, it sets a stage for the controller quest, that in return, resets the first stage for my quest and registersforupdate...... Quest repeats but because my NPC is dead... I can't use an OnDeath script to set the stage again unless.... I can revive him.... any idea on how to do this? Link to comment Share on other sites More sharing options...
littleork Posted August 24, 2012 Share Posted August 24, 2012 I have been wanting to help you for a while there and I just fixed my ck so I can finally give you some coding, I did a quest in my job mod that does the same thing that you are doing so here it is. In the stage where your target is enable, do this: Target1Alias.GetReference().Enable() Actor Target1 = Target1Alias.GetReference() as Actor Target1.Resurrect() Target1Alias would be your npc that you want killed . Hope that helps. Link to comment Share on other sites More sharing options...
Guest Messenjah Posted August 24, 2012 Share Posted August 24, 2012 Wouldn't enable/disable just make him appear and disappear? I would also need to bring him back to life when the quest repeats. The other issue with this, is that there will be multiple targets in multiple locations. The dialogue should enable the npc alias but it isn't within the same quest. Only thing I can think of, is to make an int property within my dialogue quest and when one of the random lines of dialogue plays, it will change the value of the integer property. Then, on my repeating quest, I can add a script that has a function that can be called on to check the value of the integer and enables one of the target alias' based on the value of the integer.... then, the quest stage can call on the function to enable the alias..... Link to comment Share on other sites More sharing options...
Guest Messenjah Posted August 24, 2012 Share Posted August 24, 2012 (edited) Nevermind lol, I missed the resurrect part lol. Thank you so much for your help. I'll post as soon as I get it working. Edit: Have one question though: Usually, I find in most scripts it goes something like this:Alias_Target.GetReference().Enable() When you say Target1Alias.... is that just the name of your alias? Then, by doing this: Actor Target1 = Target1Alias.GetReference() as Actor Are you just telling it, that the alias is linked to the actor? Doesn't Alias_Target do the same thing but short-hand? Edited August 24, 2012 by Messenjah Link to comment Share on other sites More sharing options...
steve40 Posted August 24, 2012 Share Posted August 24, 2012 (edited) When you say Target1Alias.... is that just the name of your alias? Then, by doing this: Actor Target1 = Target1Alias.GetReference() as Actor Are you just telling it, that the alias is linked to the actor? Doesn't Alias_Target do the same thing but short-hand? This code grab the alias' reference as an ObjectReference (by default) and then makes the Actor script attach to it so that you can call Actor functions on the alias (instead of calling ObjectReference functions). The same thing could be done by: Actor Target1 = Target1Alias.GetActorRef() Edit: so you could either do: Target1.Resurrect() or Target1Alias.GetActorRef().Resurrect() Edited August 24, 2012 by steve40 Link to comment Share on other sites More sharing options...
Guest Messenjah Posted August 24, 2012 Share Posted August 24, 2012 Scriptname ASX_RecurringScript extends Quest Conditional Quest Property ASXQuest Auto Conditional Alias Property Target01Alias Auto Conditional Actor Property Target01 Auto Conditional ASX_RecurringScript Property QuestScript Auto Conditional int property TargetVariable = 0 auto Conditional Function CallTarget() If TargetVariable == 1 Target01Alias.GetReference().Enable() Actor Target01Alias = Target01Alias.GetReference() as Actor Target01.Resurrect() Endif EndFunction Here is the result:Compiling "ASX_RecurringScript"... c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ASX_RecurringScript.psc(16,37): GetReference is not a function or does not exist c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ASX_RecurringScript.psc(16,52): cannot cast a none to a actor, types are incompatible c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ASX_RecurringScript.psc(16,7): variable Target01Alias already defined as a property No output generated for ASX_RecurringScript, compilation failed. I've tried everything from attaching a quest property to the alias name and a script property to the alias name.... no idea why it doesn't see GetReference as a function... Link to comment Share on other sites More sharing options...
gasti89 Posted August 24, 2012 Share Posted August 24, 2012 Is "ReferenceAlias property", not Alias. Alias property is used for very few things that extend the ALIAS object itself (often useless), what you need is to extend REFERENCEALIAS Link to comment Share on other sites More sharing options...
Guest Messenjah Posted August 25, 2012 Share Posted August 25, 2012 Good news and bad news. Good news? It works.Bad news? Sorta. Basically, he vanishes and disables and enables correctly, quest repeats, stages repeat... but he didn't ressurrect? Basically, he re-enables but dead and without any clothes.... ReferenceAlias Property Target01Alias Auto Conditional int property TargetVariable = 0 auto Conditional Function CallTarget() If TargetVariable == 1 Target01Alias.GetReference().Enable() Actor Target01 = Target01Alias.GetReference() as Actor Target01.Resurrect() Endif EndFunction Link to comment Share on other sites More sharing options...
Guest Messenjah Posted August 25, 2012 Share Posted August 25, 2012 Added a wait timer and now he resurrects correctly. However, now it won't switch to stage 20 when I kill him, even though it will switch to quest stage 10 again... Link to comment Share on other sites More sharing options...
steve40 Posted August 31, 2012 Share Posted August 31, 2012 On the NPC I have an actor script that sets the stage to 20 when the npc dies. I think quest-related scripts usually need to be put on the alias rather than the NPC itself? Just tightening your script a little: ReferenceAlias Property Target01Alias Auto Conditional int property TargetVariable = 0 auto Conditional Function CallTarget() Actor Target01 = Target01Alias.GetRef() as Actor If TargetVariable == 1 && Target01 != None Target01.Enable() Target01.Resurrect() Endif EndFunction Link to comment Share on other sites More sharing options...
Recommended Posts