Jump to content

What Did I Goof This TIme? (Script Help)


Recommended Posts

Posted

After the help with getting my MCM Menu started, I added in a second option.  It's supposed to make the extra 9 recruits I added to the area outside Fort Dawnguard able to be toggled on & off (depending upon what side your on and how much of a challenge you want getting at Fort Dawnguard if you're on Harkon's side)

 

It displays in the MCM Menu, and I can check the box fine, but the actors don't toggle at all.  They just keep on keeping on, lol.

 

What did I miss?

 

Scriptname DawnSentryMCM extends SKI_ConfigBase 
{Creates Dawnguard Sentries MCM Menu}

int EssentialOID
int RedShirtsOID

 

bool Property MakeEssential = false auto
bool Property DisableRedShirts = false auto

 

event OnPageReset(string page)
          SetCursorFillMode(TOP_TO_BOTTOM)
          EssentialOID = AddToggleOption("Make Sentries Essential", MakeEssential)
          AddEmptyOption()
          RedShirtsOID = AddToggleOption("Disable Dawnguard Recruits", DisableRedShirts)

endEvent

 

event OnOptionHighlight(int option)
          if (option == EssentialOID)
                    SetInfoText("Makes all Non-Recruit Sentries Essential")
          ElseIf (Option == RedShirtsOID)
                    SetInfoText("Will Disable the Recruits Around Fort Dawnguard")
          endIf
EndEvent

 

 

event OnOptionSelect(int option)
          if (option == EssentialOID)
                    if MakeEssential == false
                             DawnSentryEssentialToggleQuest.Start()
                             MakeEssential = !MakeEssential
                    elseif MakeEssential == true
                             DawnSentryEssentialToggleQuest.Stop()
                    MakeEssential = !MakeEssential
                    endif

         elseif (option == RedShirtsOID)
                    if DisableRedshirts == false
                               DawnSentryHQRedShirt001.enable()
                               DawnSentryHQRedShirt002.enable()
                               DawnSentryHQRedShirt003.enable()
                               DawnSentryHQRedShirt004.enable()
                               DawnSentryHQRedShirt005.enable()
                               DawnSentryHQRedShirt007.enable()
                               DawnSentryHQRedShirt008.enable()
                               DawnSentryHQRedShirt009.enable()
                               DawnSentryHQRedShirt010.enable()
                               DisableRedShirts = !DisableRedShirts
                  elseif DisableRedshirts == True
                              DawnSentryHQRedShirt001.disable()
                              DawnSentryHQRedShirt002.disable()
                              DawnSentryHQRedShirt003.disable()
                              DawnSentryHQRedShirt004.disable()
                              DawnSentryHQRedShirt005.disable()
                              DawnSentryHQRedShirt007.disable()
                              DawnSentryHQRedShirt008.disable()
                              DawnSentryHQRedShirt009.disable()
                              DawnSentryHQRedShirt010.disable()
                              DisableRedShirts = !DisableRedShirts
                  endif
            EndIf
            SetToggleOptionValue(option, MakeEssential)
            SetToggleOptionValue(option, DisableRedShirts)
endevent

 

Quest Property DawnSentryEssentialToggleQuest Auto
Actor Property DawnSentryHQRedShirt001 Auto
Actor Property DawnSentryHQRedShirt002 Auto
Actor Property DawnSentryHQRedShirt003 Auto
Actor Property DawnSentryHQRedShirt004 Auto
Actor Property DawnSentryHQRedShirt005 Auto
Actor Property DawnSentryHQRedShirt007 Auto
Actor Property DawnSentryHQRedShirt008 Auto
Actor Property DawnSentryHQRedShirt009 Auto
Actor Property DawnSentryHQRedShirt010 Auto

Posted

First off you dont need to add 10 of them - make one property and set parents so disabling one object would disable everything that is linked to that one.

 

Code seems fine - you sure that you've set properties right?

You can take a look in your papyrus log - to check if there are some errors like "cannot run Disable() function on none object"

Posted

I remember setting a x marker (or similar) as a parent and that if you disable the x-marker that anything that has a child relationship to it would also be disabled.  My cannon fodder recruits are scattered across three exterior cells in the "DLC1HunterHQWorld" exterior area though; all around the Fort and Dayspring Canyon.

 

My initial idea was to start them all disabled, load them into a quest and have their enabled quest aliases become active when the MCM Menu was checked  Sort of like the previous Essential option for the real Sentries.  Bethesda's "InitialDisable" script doesn't work though (surprise surprise) and that idea went into the tiolet after half a night of trying to make it work.

 

Noob question time; Aside from hitting auto fill on the script properties box and adding the properties to the script (which I did), did I need to add the properties anywhere else? 

Posted

Aqqh answered my question via a response to my PM, so probably didn't feel a need to reply here.  I'll answer the question though based on our conversation so the rest of you who read and MAY run into something similar can know the final answer:

 

First, I was operating under the incorrect assumption that we could only link a parent relationship to something in the same cell.  As it turns out, we can create a "parent / child" link between things anywhere in-game.  Ergo I cleaned up my script code and only linked to a Xmarker parent of the recruits set as "children" to the Xmarker.

 

Secondly, it was the property that was causing the problem,  As Aqqh explained to me, actor properties don't always auto fill correctly and have to be entered manually sometimes.  As it was, switching to the ObjectReference property for the Xmarker eliminated that issue anyway.

 

Problems solved,  :D

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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