Jump to content

Forcing a bool var on a vanilla script, without editing such script


marcelocastro

Recommended Posts

Hi guys,

 

I want to force a bool on a vanilla quest script to remain false while my own quest script is running (preventing the vanilla quest from shutting down). And I want to do so without editing the vanilla script. Is it possible?

 

If not, is there anyway to remotely pause a script? I've been trying something like

 

quest myQuest
myQuest = WorkshopSuperMutantAttack01 as quest
REScript myREScript
myREScript = myQuest as REScript
myREScript.Utility.Wait(10)

 

but I get the "the type name Utility cannot be used as a property" error on the compiler.

 

Any suggestions?

Link to comment
Share on other sites

"Utility" is a script. You cannot call it on another script like that. Also, you can't force an external script to pause unless it has a specific function built-in that you could call to do so.

 

If the bool variable is a property, then you should simply be able to set that property on the vanilla script

 

vanillascript.boolpropertytoset = FALSE

 

If it's not a property, or there's no built-in function to set the bool that you can call, then no, you can't touch it.

Edited by steve40
Link to comment
Share on other sites

"you can't force an external script to pause unless it has a specific function built-in that you could call to do so."

 

Not in a direct way, but maybe you can run interference on the target quest creatively. Example: temporarily hide the item that triggers quest stage completion, or make an NPC sandbox away from a quest completion marker until you are done. It's hard to say what you could do without knowing and looking at the specific quest.

Link to comment
Share on other sites

Thanks for the help guys.

 

I don't think I'll be able to bypass this flag with creative thinking. Unless there is a way to stop a workshop from loading.

The pertinent vanilla bool trigger I want to stop is on Workshop Attack quests (like WorkshopSuperMutantAttack01). On stage 20 script fragment REScript puts up a flag if the workshop (target of the attack) is loaded and REParent immediately starts cleaning up, the vanilla workshop attack fails and I lose all references to the attackers (they are still there, but I cant control them through my own quest).

With hardcore there wouldn't be much problem, but allowing fast travel really screws things up with this flag.

 

if workshopRef.Is3DLoaded() == false && workshopRef.OwnedByPlayer
    WorkshopRaiderAttack03Message.Show()
    SetObjectiveDisplayed(10)
    workshopRef.SetValue(kmyQuest.REParent.WorkshopActorAlert, 1)
else
    ; now quest should shutdown when everything unloads
    kmyQuest.StopQuestWhenAliasesUnloaded = true
endif

I'm trying another approach. I make sure the attack is only triggered far away from the target workshop (check with is3DLoaded), let the quest vanilla quest load and then I get the attackers to my quest and manipulate them as I please (move them, freeze them, etc...). The problem is, I can't trigger vanilla attacks on the settlements the player is currently in, and for instance, you can't trigger an attack on red rocket if you are in sanctuary (because it is 3D loaded), which is kinda lame. I'll have to make my own similar attack quests to allow the player to trigger attacks on the settlement he's in.

 

Some more info on what I'm trying to do:

 

https://forums.nexusmods.com/index.php?/topic/5948298-settlement-raids-overhaul/

 

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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