How to Enable a Static Mesh on Quest Complete

Post » Mon Jun 18, 2012 11:38 pm

Hey everyone.
I'm working on my home, and it occurs to me that a trophy room would be fun. Something that, when a quest completes, will display something related to that quest in the room; like a statue.

My problem is...I have no idea where to begin, or how to go about doing so. The best idea I can think of, is that in the Thieves Guild, there are objects that only enable (display) once you reach that stage. I'd love for something like that to work, like the stage where, say, you reach the stage where you kill , then it displays a trophy in your house.

I figure "Initially Disabled" has something to do with that, but I'd love a little help here. Or even someone to be my hero and flat out tell me how to go about doing so. Thanks!
User avatar
Lizbeth Ruiz
 
Posts: 3358
Joined: Fri Aug 24, 2007 1:35 pm

Post » Mon Jun 18, 2012 9:29 pm

You're on the right track with Initially Disabled. Have that checked by default.

In the quest script, you'll need to make a property (a variable) to represent your trophy object. The line should look something like this:

ObjectReference property MyTrophy auto

You'll have to click the properties button and select your object from the render window using the crosshares that'll pop up when you click on "Select Reference in Render Window" or something like that.

Then, basically, in the result script for the quest stage that has the condition of "if killed ", have this run:

MyTrophy.Activate()



I haven't done this myself in a while, so if anything seems unclear or isn't working, don't be a stranger!
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Mon Jun 18, 2012 11:44 pm

Thanks, however I have a few questions.
For instance:

The trophy in question would be a loading screen static mesh, such as the Alduin loadscreen for finishing the Main Quest. Problem is the object itself doesn't have a script option, however the referance window does (clicking to the end of the > arrows on the referance window). Would I need to add the script to the referance or to the loading screen static mesh itself (if the latter, how?)

Also, what if the quest doesn't end with an NPC dying. Would there be a command to check if the quest completed? Such as, in bad example: OnQuestComplete.Enable?

Third, when you say "if killed" what would that script command be? I have 0 skill/experience with scripting.

And finally, when you say the quest script, which script are you referring to exactly? The script I add to the static mesh, or a script put elsewhere? Also, what do you mean by "result script"?

Thanks, for a real beginner like me this seems complicated, but I'm slowly learning my way around!
User avatar
victoria gillis
 
Posts: 3329
Joined: Wed Jan 10, 2007 7:50 pm

Post » Mon Jun 18, 2012 4:51 pm

It's rather late for me so I didn't read everything, but I've been looking into Static scripting as well. Frankly it's a pain in the backside since there's no script option for them (as you've noticed).

However If you drag a Static item into a Cell or Worldspace you can add a script to that indiviual item (double click on it). Not every function works on static items (for instance Moveto and Disable don't), but you might be able to rig something up. I'm still tearing apart the stupid thing looking for ways too add a script to a static as well (in my case tents). But Good Luck!

Just remember in whatever script you write you have to do it as a static when you attach it to the item. For example:
Scriptname BK_TentScript extends STATIC
User avatar
Bereket Fekadu
 
Posts: 3421
Joined: Thu Jul 12, 2007 10:41 pm

Post » Mon Jun 18, 2012 5:28 pm

Oh and it's not too bad to create a new Static and do some basic movements to it (use PlaceatMe). However once it's there and the initall placement script ends there's not much you can do to it. For instance I can place and level out a tent but I can't make it go away when the player is done with it. Personally I'd reccomend my last post where you place the item in the editor and find a way to make it invisible or hide it with something else initially.

Also google: cipscis skyrim tutorials editorids (seeing as how I can't post the link).
I wasted half the day when I first started learning before reading that and going ahhhhh lol. Explains the whole defining and attaching your reference to the item script thingy.

Think I'm rambling semi-making-sense now, heading to bed
User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am

Post » Tue Jun 19, 2012 7:00 am

Oh and it's not too bad to create a new Static and do some basic movements to it (use PlaceatMe). However once it's there and the initall placement script ends there's not much you can do to it. For instance I can place and level out a tent but I can't make it go away when the player is done with it. Personally I'd reccomend my last post where you place the item in the editor and find a way to make it invisible or hide it with something else initially.

Also google: cipscis skyrim tutorials editorids (seeing as how I can't post the link).
I wasted half the day when I first started learning before reading that and going ahhhhh lol. Explains the whole defining and attaching your reference to the item script thingy.

Think I'm rambling semi-making-sense now, heading to bed

Thank you, though still not quite sure what I'm doing here. Was bad enough in Oblivion the scripting language was gibberish to me, now this Papyrus stuff is...worse >.<
I'm just thinking that a statue, of say Alduin for example, would enable (appear) in my home once I complete, say, the Main Quest. So far anything I've tried to do has given me compile errors
User avatar
Judy Lynch
 
Posts: 3504
Joined: Fri Oct 20, 2006 8:31 am

Post » Tue Jun 19, 2012 4:51 am

I got as far as "add a property of type object reference" and I get this message in the compile results:

Starting 1 compile threads for 1 files...
Compiling "QF_MQ305_00046EF2"...
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\QF_MQ305_00046EF2.psc(334,0): variable LoadscreenArgonian is undefined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\QF_MQ305_00046EF2.psc(334,19): none is not a known user-defined type
No output generated for QF_MQ305_00046EF2, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF_MQ305_00046EF2

Any idea what went wrong and how to fix it?
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Mon Jun 18, 2012 8:31 pm

Looks like you haven't declared a property. It will help if you post your whole script.
User avatar
DarkGypsy
 
Posts: 3309
Joined: Tue Jan 23, 2007 11:32 am

Post » Mon Jun 18, 2012 3:12 pm

Script? What script? The instructions I was given say:

"create an xmarker in the cell and set it's state to initially disabled. then place the trophy where you want it and set its enable parent to the xmarker. then go into the quest stage you want to activate the trophy and in the log entry window create a new log, then in the papyrus fragment window type "decoratemarker.enable()" and click on properties in the fragment window and add a property of type object reference called decoratemarker and click ok. then click on the property you just created and click the edit value button. click pick reference in render window and double click on the xmarker you created. click ok a bunch of times to close the windows save and test it. it should work"

I get as far as "click on properties in the fragment window and add a property of type object reference called decoratemarker and click ok." and it spits out all of those errors I pasted to you.

Update::::
I tried this:
Create an XMarker.
Set XMarker as Initially Disabled.
Place down the object you want as your trophy.
Set the trophy's Enable Parent to the XMarker.
Click on the XMarker, open up the reference window, go to scripts, create a new script.
Leave the line called Extends as ObjectReference.
Click the script, click on properties. Set the XMarker as the reference.

Addendum::::
I went under the quest window. After writing decoratemarker.enable() in the papyrus fragment for the quest stage that completes the quest I went to the scripts tab, clicked the quest's script that begins with QF. I clicked properties. decoratemarker was already under there, but it had no reference attached. I chose the Xmarker, and now I get no error messages spit out at me. Wish me luck, going to test it right now!

Result::::
*sigh* Even though it no longer spit errors out at me, upon completion of the quest the trophy in question did NOT APPEAR. I guess I did something wrong. Any idea why it isn't appearing?

This is the error it spit out at me before:

Starting 1 compile threads for 1 files...
Compiling "QF_MG01_0001F251"...
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_MG01_0001F251.psc(265,25): script property DecorateMarker already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_MG01_0001F251.psc(265,25): script variable ::DecorateMarker_var already defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_MG01_0001F251.psc(265,25): script property DecorateMarker already has a get function defined
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_MG01_0001F251.psc(265,25): script property DecorateMarker already has a set function defined
No output generated for QF_MG01_0001F251, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF_MG01_0001F251

also, the script reads:

Scriptname aaaKoiTrophyTestScript2 extends ObjectReference

ObjectReference Property DecorateMarker Auto
User avatar
Dark Mogul
 
Posts: 3438
Joined: Tue Feb 20, 2007 11:51 am


Return to V - Skyrim