Enable script

Post » Mon Nov 19, 2012 7:53 pm

Spoiler
Scriptname CHProgressScript extends ObjectReference

Static property TestMarker01 auto
Actor property Player auto
Quest property MQ101 auto

Event OnLoad
If Player.GetStageDone(MQ101) == 900
TestMarker01.Enable()
Else;
EndEvent
What I'm trying to do is enable a select set of items (static as well as activators and actors) when the player complete a quest. In the above script it is written for the "Unbound" quest, the one you finish as you leave Helgen (the tutorial MQ101) In my cell i have a XMarker with the Reference Editor ID "TestMarker01" its set as Initially Disabled, and linked as Active Parent to the items i want to enable.
I might be missing a simple thing, and have had help writing it, but for some reason I can't even get it to compile.
User avatar
Darian Ennels
 
Posts: 3406
Joined: Mon Aug 20, 2007 2:00 pm

Post » Mon Nov 19, 2012 10:28 pm

What ObjectReference is this script attached to? The XMarker in question?

You have some syntax issues. This should compile.

Scriptname CHProgressScript extends ObjectReferenceStatic property TestMarker01 autoQuest property MQ101 autoEvent OnLoad()    If MQ101.IsStageDone(900)	    TestMarker01.Enable()    endifEndEvent

GetStageDone is not a function, but http://www.creationkit.com/IsStageDone_-_Quest is. IsStageDone is called on Quest objects, with the stage number as a parameter. So, since PlayerRef was no longer needed I removed it. You also had no endif statement.

Give that a try and see if it does what you want. Make sure to resolve your properties in the Creation Kit or it won't work.
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am

Post » Tue Nov 20, 2012 4:36 am

the script is planed to be attached to the xmarker (well several xmarkers, since its a progression mod im build, verious displays and things as quests are completed)

Will give it a try, thank you :smile:

-Edit-
Spoiler
Starting 1 compile threads for 1 files...
Compiling "CHProgressScript"...
c:\...\skyrim\Data\Scripts\Source\temp\CHProgressScript.psc(8,25): Enable is not a function or does not exist
No output generated for CHProgressScript, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on CHProgressScript
compile log on the above script
User avatar
Quick draw II
 
Posts: 3301
Joined: Thu Nov 08, 2007 4:11 pm

Post » Mon Nov 19, 2012 8:36 pm

Don't use 'Static'. The enable function requires an ObjectReference.

ObjectReference property TestMarker01 auto
User avatar
abi
 
Posts: 3405
Joined: Sat Nov 11, 2006 7:17 am

Post » Tue Nov 20, 2012 4:39 am

Duh. Not sure how I missed that. Right. You'll need to set the marker as type ObjectReference and give it a ReferenceID in the CK (by double-clicking on it in the render window and assigning it there; this name is separate from the EditorID).
User avatar
brian adkins
 
Posts: 3452
Joined: Mon Oct 01, 2007 8:51 am

Post » Mon Nov 19, 2012 9:19 pm

wouldent it be a bit simpler for me to have 1 xmarker with all the quest stages i aim to use and have that enable or disable the parent-xmarkers for the verious items within my cell?
User avatar
Jade Muggeridge
 
Posts: 3439
Joined: Mon Nov 20, 2006 6:51 pm

Post » Tue Nov 20, 2012 1:52 am

It depends entirely on your application. Play with it and do what you think turns out the best.
User avatar
Nathan Hunter
 
Posts: 3464
Joined: Sun Apr 29, 2007 9:58 am


Return to V - Skyrim