Jump to content

What xactly am I doing wrong?


jediakyrol

Recommended Posts

so...trying to fix whatever Bethesda broke in 1.7.15 that made Jun and Marcy immortal again for saves in which the Sanctuary quest hadn't been completed...and I'm stuck.

Here's my current testing script.

Scriptname JunMarcyFixBoxScript extends ObjectReference

ReferenceAlias property Alias_MarcyLong auto const mandatory 

Event OnActivate(ObjectReference akActionRef)
	JMFix()
EndEvent

Function JMFix()
	Actor jun = Game.GetFormFromFile (0x00019fdb, "Fallout4.esm") as Actor
	WorkshopNPCScript marcy = Alias_MarcyLong.GetRef() as WorkshopNPCScript

	Debug.Notification("is Jun Immortal? " + jun.IsEssential())
	jun.GetActorBase().SetEssential(false)
Debug.Notification("1")
	jun.GetActorBase().SetProtected(true)
Debug.Notification("2")
	jun.SetScale(4)
Debug.Notification("3")
	Debug.Notification("How about now? " + jun.IsEssential())
	Debug.Notification("Is Marcy Immortal? " + marcy.IsEssential())
	marcy.GetActorBase().SetEssential(false)
Debug.Notification("1")
	marcy.GetActorBase().SetProtected(true)
Debug.Notification("2")
	marcy.SetScale(4)
Debug.Notification("3")
	Debug.Notification("How about now? " + marcy.IsEssential())
EndFunction

Now...I followed two different methods for testing...

For Jun it is a mashup of what I remember from Skyrim plus some tutorial references plus mass wild guessing (the turning into a giant is just for quick visual confirmation, and the notes are to show that the script is actually stepping through).

For Marcy it is an exact copy of the lines from the Patch 1.6 script. (... ... ...which no longer works either...but I figured what the hell, let's try anyway)

 

The file compiles with no errors and was successfully attached to a test object that runs it on activation

Neither npc accepts the changes...the "Is x Immortal?" check returns false even though when confirming through CK and in game that they are Indeed marked essential...and the script will hang up every single time right after the "Is Marcy Immortal?" note, never displaying the next. which I assume to mean something happens in marcy.GetActorBase().SetEssential(false)

 

I assumed that maybe there was something holding persistence on them and tried to select them in console and run DPPI... ... ...but it doesn't seem to work anymore.

I am also fairly certain GetFormFromFile isn't even supposed to work that way...but I was randomly mashing keys at that point and it compiled so I was all "fuggit"

 

As rusty as I am at all this...I am completely at a loss.

 

Edit: Oh glob I forgot a letter in the title...THE FREAKING TITLE! ... ... ...I'm going to go to bed and pretend this last day didn't happen.

Edited by jediakyrol
Link to comment
Share on other sites

GetFormFromFile() is not necessary here as you can just call those other functions on their reference aliases.. In fact you could just turn off their essential status right in the quest they are in. Protection status is no good because I'm pretty sure they aren't set to be protected, as you can send them into bleedout status over and over again and they wont die (protected means you can 'kill' them like 2-3 times before they die permanently). Uhm, SetScale() doesn't do what you think it does. It just sets the scale of an object(size).

And it's possible you're locking up the script with all those notifications, possibly creating stack dumps. So try this little override function:

ReferenceAlias property Jun auto
ReferenceAlias property Marcy auto
Quest property SanctuaryQuest auto
 
 
Function SetAliasEssential()
       Actor kJun = Jun.GetReference() as Actor
       Actor kMarcy = Marcy.GetReference() as Actor
 
       if (SanctuaryQuest().isCompleted() == true)
           kJun.SetEssential(false)
           Utility.wait(0.1)
           kMarcy.SetEssential(false)
       endif
      
       debug.notification("Are they both essential? " +kJun.isEssential()+ , +kMarcy.isEssential())
EndFunction
Edited by EveningTide
Link to comment
Share on other sites

yeah...I was using setscale to see if they were actually accepting the changes sent without using console commands when I was just copying the official patch 1.6 script straight-out... ... ...it never took...but then...neither did patch 1.6, which is why I decided to do this.

...I also don't understand why they removed the ability to simply use the BaseID when calling for an object like in Skyrim...why do I have to do two extra steps when I already know what their base and ref already are?

 

 

AND... ... ...nope...didn't work...they just will not take any changes applied to them through a script...console works though... ... ...And the notification reported that both returned "false" for essential even though actually looking at them reported true.

Could something be forcing them to be persistent? Maybe whatever the tweak was they made in 1.7.12 to stop settlers from changing their clothes/race/sex every 5 seconds? Maybe I'd have to remove them from the Workshop NPC group, change them, then add them back?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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