Jump to content

Creating Script to Activate XMarker after quest stage


Recommended Posts

I trying to create a mod that cleans up Thirsk Mead Hall after you defeat the chief, seems stupid to have a Hall that completely useless to Players except for the throne as it currently sets.  I created an XMarker that I will link as the parent to all the changes I make to the area.  I'm really new to trying to write scripts and modding in general.  I found a bit of code that looked like what I wanted it to do but it won't compile. Currently my coding looks like but I can't get it to compile.  Any help would be awesome.

 

Scriptname TMHPHProgressScript extends ObjectReference

Property THPHenabler Auto
Quest property DLC2MH02 Auto

Event OnLoad()
If DLC2MH02.IsStageDone(200)
THPHenabler.Enable()
endif

EndEvent

Link to comment

First you want to not set all the stuff that you want to disable as an enable child of the XMarker, to do this you double click on all Objects, go to "Enable parent" and set your marker as the enable parent there. If you want those objects to be enabled when disabling the marker (I assume the marker is originally enabled), you need to tick the "Set Enable State to opposite of Parent" checkbox at the bottom of that Sub Menu

 

Once youve done this, you go to where your script will be fired, probably at the end of the Thirsk Hall Quest or so. I will assume based on your post that you arent that far yet; but if you already got a trigger set up and everything, part of the following will be unnecessary

In the Thirks Hall Quest, the last part of it, you create a new Quest Stage (Stage number technically doesnt matter though its good praxis to make it a high number, hjigher than any other stage). When creating this Stage & going into the Stage at the very top therell be a checkbox called "Shut Down Stage", tick that one. In the field below RMB -> New, that will make the Script Box available for you to write something in it. Write a "," in it and click ok, then reopen the Quest and go back to your Stage

You can now select the "Property" button in your Quest, do that and create a new "ObjectReference" Property give it the name "myMarker" and fill it with the Marker you created. Then click ok and in the Script box you now delete the semicolon and instead write:

myMarker.Disable()

 

Click ok again and then you should be done creating your first mod. Yay.

 

Good Praxis would demand you to now get the .pxc and .pex Script you edited/created and put it in the same Folder together with your created .esp. You might also want to do a backup for the .psc file and move that one back into the source folder after you pulled your edited .psc out of the folder, so your source folder still has all the vanilla scripts stored in it

Link to comment

I've tried doing this as you instructed in an Overwrite of the DLC2MH02 quest but I am unable to "ObjectReference" Property give it the name "myMarker", when I try doing that it spits out a bunch of nonsense saying it failed to create the file


 

Quote

 

Starting 1 compile threads for 1 files...
Compiling "DLC2_QF_DLC2MH02_0201A50C"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(0,0): unable to locate script Quest
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(7,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(12,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(17,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(22,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(27,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(32,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(37,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(42,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(47,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(52,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(57,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(62,23): unknown type locationalias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(67,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(72,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(77,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(82,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(87,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(92,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(97,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(102,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(107,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(112,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(117,24): unknown type referencealias
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(147,9): objectreference is not a known user-defined type
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(203,9): objectreference is not a known user-defined type
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(218,25): unknown type objectreference
No output generated for DLC2_QF_DLC2MH02_0201A50C, compilation failed.

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

 


 

and it never shows up as a property I can then "fill" with the marker I created.  If I try and create the property again it then spits out


 

Quote

 

Starting 1 compile threads for 1 files...
Compiling "DLC2_QF_DLC2MH02_0201A50C"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(220,25): script property myMarker already defined
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(220,25): script variable ::myMarker_var already defined
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(220,25): script property myMarker already has a get function defined
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\DLC2_QF_DLC2MH02_0201A50C.psc(220,25): script property myMarker already has a set function defined
No output generated for DLC2_QF_DLC2MH02_0201A50C, compilation failed.

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


 

If I go into the PSC file I can see the line but I can't see it anywhere in CK.

 

Quote

ObjectReference Property myMarker  Auto

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...