Jump to content

Setting a Location as automatically "cleared" for workshop


Recommended Posts

There's a lot of ways to do this.

 

The most easiest way is to put an xmarker in the cell containing the workshop and attach this script to it:

Scriptname LocationClearedScript extends ObjectReference

Location property LocationToClear auto

AUTO STATE Waiting
    Event OnCellAttach()
        GoToState("Done")
        LocationToClear.SetCleared()
    EndEvent
ENDSTATE

STATE Done
    Event OnCellAttach()
    ;
    EndEvent
ENDSTATE

What this will do is set the location to clear, and then run no more after that.

 

Fill the property with the location you want.

How do you attach script? I put an xmarker in the cell but see no way to input the data you describe here?

Link to comment
Share on other sites

double click the workshop in the render window, or right click in the cell view window on the workshop and click edit.

 

scroll to last tab, scripts, double click the script, set the following (don't use defaults):

 

  • OwnedByPlayer = true
  • StartsHostile = False
  • EnableAutomaticPlayerOwnership = True
  • MinRecruitmentProhibitRandom = true
  • MinRecruitmentAllowRandomAfterPlayerOwned = False
  • AllowAttacksBeforeOwned = False
  • AllowAttacks = False (if this is a player home and not a settlement, if settlement, set to true for random attacks)

that should automatically make it so the player can use the workbench.

 

You'll probably also want to set AllowBrahminRecuritment = False so you don't end up with brahmin running around inside your cave.

 

Another step you can do is add a workshopSetOwnedTrigger, it doesn't need to be big, just place it right where the player teleports in to the cell at and linkref it to the workshop, this will ensure that for any reason the workshop gets flipped to not player owned even with the above flags set, that the workbench will get set to player owned as soon as they enter the cell.

 

don't forget to setup your workshop quest too.

 

if you haven't:

  • create a new quest and give it a unique name, something like mymodSettlementQuest
  • on the Quest Data tab, check Start game enabled, run once, set priority to 41
  • on the quest stage tab on the right hand side, right click and click new, type in 10, right click again and click new, type in 20
  • click on 10, check the box that says Run on Start
  • right click in Log Entry and click new, add a Designer note that says 'quest start'
  • click on 20, right click in log entry and click new, add a designer note that says 'quest end'
  • click the 'Quest Aliases' tab
  • right click and click new Ref Alias Collection
  • set the alias name to 'Workshops'
  • add a match condition - haskeyword workshopkeyword
  • add a match condition - locationhaskeyword loctypeworkshop
  • add a match condition - getincurrnetlocation - the location assigned to your cell
  • click okay
  • Click okay again, then open the quest back up and click on Scripts
  • add the script WorkshopAddLocation
  • if properties didn't pop up, double click the script
  • click autofill in properties and it should autofill the workshopParent
  • click on workshopCollection, click edit, and set it to Workshops

The location assigned to your cell will need a couple keywords added to it:

  • loctypeclearable
  • loctypesettlement
  • loctypeworkshop
  • loctypeworkshopsettlement

your zone for the location will need to have never reset and workshop checked on it.

 

you'll need a centermarker for the workshop and a spawnmarker (bothxmarkers) you linkref from the workshop to them using workshoplinkcenter for the center marker and workshoplinkspawn for the spawn marrker, bother markers should be xmarkerheadings

 

If you want the people you send to the cave / settlers to wander about the cave you'll need to add a defaultdummy and linkref the workshop to it with the keyword workshopsandbox then size it for where you want them to wander about, this can also come in handy say if you have a room on the outer edge of the area you don't wnat the settlers to enter, as they will only wander the sandbox area.

 

the buildable area is a defaultdummy linkref it to the workbench using the keyword workshoplinkprimative, you can have multiples of these linked to the workshop to cover odd shaped areas, and scale them to fit the area..

 

Hope the info helps.

The workshopSetOwnedTrigger worked for me,thankyou,, was struggling with this for hours

Link to comment
Share on other sites

  • Recently Browsing   0 members

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