Allannaa Posted October 13, 2012 Share Posted October 13, 2012 I've made a very short quest where an NPC asks the player to bring her a few items. In exchange for the help, she gives the player a key to a cottage, and is supposed to "retire" at this point. However, I can't quite figure out how to make her go away (that is, remove her from her cell in Whiterun, or just remove her from the game, either way.) Where can I look to find this info? I've been through the official CK tutes and I didn't see it (though that doesn't mean it's not there.) I'm not really good with writing Papyrus scripts, so specifics would be welcome. I should note, I've been sorting thru the forums here since noon... without being able to find this -- UNLESS -- it's some form of "disable" script? Thanks in advance! Link to comment Share on other sites More sharing options...
acidzebra Posted October 13, 2012 Share Posted October 13, 2012 (edited) Well, you're already running some kind of script, right? There are a number of ways to go about it but it sounds like yes, you want the disable() function. However, if you just call this function the actor will just pop or fade out right in front of the player. Which will look odd. What you could do is add an event that will disable the actor when the player leaves the cell with a check to see if your quest is completed, so the actor simply won't be there anymore when the player returns. I assume you already have something like the following in your script:actor property ACTORREFNAME auto quest propert QUESTNAME auto What you would add is Event OnCellDetach() if (QUESTNAME.IsCompleted()) ACTORREFNAME.disable() endIf endEvent I'm a beginner at papyrus scripting, so this may be a horrible way to go about it though :) Event OnCellDetach() is an event which fires if the cell in which the object on which the script is running is unloaded.QUESTNAME.IsCompleted() checks whether the quest QUESTNAME is completed.and disable() disables the reference. (this script snippet is also assumed to be running on the actor reference, I don't know how you set up your scripts or what they are attached to, I haven't really gotten into quest scripting yet) Edited October 13, 2012 by acidzebra Link to comment Share on other sites More sharing options...
Allannaa Posted October 15, 2012 Author Share Posted October 15, 2012 On 10/13/2012 at 9:32 PM, acidzebra said: What you could do is add an event that will disable the actor when the player leaves the cell with a check to see if your quest is completed, so the actor simply won't be there anymore when the player returns. Event OnCellDetach() if (QUESTNAME.IsCompleted()) ACTORREFNAME.disable() endIf endEvent Okay, every time I run anything like this, with an Event or a Function, the compile fails --mismatched input 'Event' expecting ENDFUNCTIONandmissing EOF at 'EndFunction' No matter WHAT, any time I use blocks like this, that's the fail I get. Always, no matter what the function or event is, in every case. I've done things like copy a block of code exactly, both by the copy/paste method, and by typing exactly what I see in one window, into another. Those two fails are what I get, no matter what. What on earth is up with that? Link to comment Share on other sites More sharing options...
Ashenfire Posted October 15, 2012 Share Posted October 15, 2012 I will check out a code and see if it works.I was in the middle of my own project, but 90% of my project results in banging my head against a jagged steel wall. I will take a break and see if I can have a quest complete then disablethe character. Link to comment Share on other sites More sharing options...
acidzebra Posted October 15, 2012 Share Posted October 15, 2012 On 10/15/2012 at 2:14 AM, Allannaa said: No matter WHAT, any time I use blocks like this, that's the fail I get. Always, no matter what the function or event is, in every case. I've done things like copy a block of code exactly, both by the copy/paste method, and by typing exactly what I see in one window, into another. Those two fails are what I get, no matter what. What on earth is up with that? That is... very odd. I tested my code on a dungeon, added NPC, added script to npc, and it worked fine. Could you paste an example of failing code? Link to comment Share on other sites More sharing options...
LukeH Posted October 15, 2012 Share Posted October 15, 2012 On 10/15/2012 at 2:14 AM, Allannaa said: Okay, every time I run anything like this, with an Event or a Function, the compile fails --mismatched input 'Event' expecting ENDFUNCTIONandmissing EOF at 'EndFunction'I suppose you have a function above that one that you simply missed to add EndFunction for it...or more exactly you pasted the new code above that EndFunction thous inside the said function (judging the second error) Link to comment Share on other sites More sharing options...
Ashenfire Posted October 15, 2012 Share Posted October 15, 2012 (edited) The following is tested, I actually did this via DIALOGUE. I borrowed it from the decorate house dialogue which will activate your furniture once youpurchase the home and upgrade. In this case it will disable an npc. The problem is that it happens immediately and looks strange for npc to disappear after talking.So, I will work on that next. If you don't want to wait, you might do an ALTERNATE dialogue which means don't have the oldlady do the conversation. The player will talk to another npc in the area out of sight of the old lady.She would then disappear and the PLAYER won't be the wiser. 1. Add this to one of the dialogue begin, end fragment boxes. decoratemarker.disable() (when you click somewhere else, it will CREATE a script) 2. Drag an Xmarker to the outside part of your cell. Do not modify. 3. Double Click on Oldlady NPC that you created and click on: Enableparent tab Select reference in window to the xmarker you just dropped. You will not modify anything here either. 4. Inside the dialogue script that got created when you added 'decoratemarker.disable()' , you will delete everything the script created except: scriptname tif_(name of your script) ;begin fragment code ;next fragment index You will paste this under all 3 of the above headers: ; =================================begin script ============================================ ;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODE decoratemarker.disable();END CODEEndFunction;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment ObjectReference Property DecorateMarker Auto ; =======================================End Script ===================================== 5. Test it in the game. Edited October 16, 2012 by Ashenfire Link to comment Share on other sites More sharing options...
Allannaa Posted October 16, 2012 Author Share Posted October 16, 2012 (edited) On 10/15/2012 at 2:26 PM, LukeH said: On 10/15/2012 at 2:14 AM, Allannaa said: Okay, every time I run anything like this, with an Event or a Function, the compile fails --mismatched input 'Event' expecting ENDFUNCTIONandmissing EOF at 'EndFunction'I suppose you have a function above that one that you simply missed to add EndFunction for it...or more exactly you pasted the new code above that EndFunction thous inside the said function (judging the second error) Alas, that would be the simple answer wouldn't it? But it's not. Even if that is the ONLY thing in a "script"... no other lines, no spaces, nothing -- that's the result I unfailingly get. Ash, I'm going to try your method. I don't actually care if Eldah Cronne pops out from in front of the player's very eyes. I mean after all, we all pop out from in front of people all the time when we hit Fast Travel, or "The Poor Man's Teleport"... amirite? Edited October 16, 2012 by Allannaa Link to comment Share on other sites More sharing options...
Ashenfire Posted October 16, 2012 Share Posted October 16, 2012 On 10/15/2012 at 6:15 PM, Ashenfire said: The following is tested, I actually did this via DIALOGUE. I borrowed it from the decorate house dialogue which will activate your furniture once youpurchase the home and upgrade. In this case it will disable an npc. The problem is that it happens immediately and looks strange for npc to disappear after talking.So, I will work on that next. If you don't want to wait, you might do an ALTERNATE dialogue which means don't have the oldlady do the conversation. The player will talk to another npc in the area out of sight of the old lady.She would then disappear and the PLAYER won't be the wiser. 1. Add this to one of the dialogue begin, end fragment boxes. decoratemarker.disable() (when you click somewhere else, it will CREATE a script) 2. Drag an Xmarker to the outside part of your cell. Do not modify. 3. Double Click on Oldlady NPC that you created and click on: Enableparent tab Select reference in window to the xmarker you just dropped. You will not modify anything here either. 4. Inside the dialogue script that got created when you added 'decoratemarker.disable()' , you will delete everything the script created except: scriptname tif_(name of your script) ;begin fragment code ;next fragment index You will paste this under all 3 of the above headers: ; =================================begin script ============================================ ;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODE decoratemarker.disable();END CODEEndFunction;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment ObjectReference Property DecorateMarker Auto ; =======================================End Script ===================================== 5. Almost forgot, make sure you have dialogue open and click on PROPERTIES and verify that you have DecorateMarker edited/assigned to the marker you placed, (sometimes they don't behave the first time you try). 6. Test it in the game. Link to comment Share on other sites More sharing options...
Allannaa Posted October 18, 2012 Author Share Posted October 18, 2012 Ash -- I did exactly what you typed, and, it's not working. OldLady stands there, walks her "patrol" and still says "Yessss?" and "Need something?" and all that -- AND what's worse, hehe, you can re-do the quest! Link to comment Share on other sites More sharing options...
Recommended Posts