Andrewupkins Posted May 4, 2021 Posted May 4, 2021 So Yeah I am in concord and added 3 minutemen defending the museum and a few more raiders to match them but in game by the time I go near them they are all dead because they are directly spawn I wanted to know how to make a time trigger don't even know how to create the "M" spawn placeholder only see people using the vanilla one so if I could set a trigger so they only spawn when the player is in front of the museum so he can help them or see them dying
Zorkaz Posted May 4, 2021 Posted May 4, 2021 I'd go with a marker solution Step 1 - Make them all "Initialy Disabled" by double clicking on their world referencesAdditionally check Enable Parent on all but one. Link all to one parent. This means you will only need to script enable one NPC and the others will automatically appear Step 2 - Place an Xmarker near themStep 3 - Use a script on itI'd go withObjectReference Property TheGuyIwanttoEnable Auto Event OnCellLoad() TheGuyIwanttoEnable.enable() EndEventOtherwise you can also use a Trigger with a script likeEvent OnTriggerEnter (ObjectReference AkActionRef) If AkActionRef == Game.Getplayer() TheGuyIwanttoEnable.enable() Endif EndEvent Event OnTriggerLeave (ObjectReference AkActionRef) If AkActionRef == Game.Getplayer() TheGuyIwanttoEnable.disable() Endif EndEventFor the latter option you need to place an defaultemptytrigger (Activator) and make it enough
LarannKiar Posted May 4, 2021 Posted May 4, 2021 Or you can set these NPCs "Protected" in the Creation Kit and then simply place them in Concord. (If they're flagged as protected, only the player could kill them). Then place a DefaultEmptyTrigger and attach this script to it:Actor Property PlayerRef Auto Const Group MinutemenRefs ObjectReference Property Minuteman01 Auto Const ObjectReference Property Minuteman02 Auto Const ObjectReference Property Minuteman03 Auto Const endGroup Event OnTriggerEnter (ObjectReference akActionRef) If akActionRef == PlayerRef Minuteman01.SetProtected(false) Minuteman02.SetProtected(false) Minuteman03.SetProtected(false) Self.Disable() EndIf EndEventAfter you enter this triggerbox, the NPCs won't be protected and the trigger will disable itself.
Andrewupkins Posted May 5, 2021 Author Posted May 5, 2021 (edited) On 5/4/2021 at 6:44 PM, Zorkaz said: I'd go with a marker solution Step 1 - Make them all "Initialy Disabled" by double clicking on their world referencesAdditionally check Enable Parent on all but one. Link all to one parent. This means you will only need to script enable one NPC and the others will automatically appear Step 2 - Place an Xmarker near themStep 3 - Use a script on itI'd go withObjectReference Property TheGuyIwanttoEnable Auto Event OnCellLoad() TheGuyIwanttoEnable.enable() EndEventOtherwise you can also use a Trigger with a script likeEvent OnTriggerEnter (ObjectReference AkActionRef) If AkActionRef == Game.Getplayer() TheGuyIwanttoEnable.enable() Endif EndEvent Event OnTriggerLeave (ObjectReference AkActionRef) If AkActionRef == Game.Getplayer() TheGuyIwanttoEnable.disable() Endif EndEventFor the latter option you need to place an defaultemptytrigger (Activator) and make it enough On 5/4/2021 at 7:38 PM, LarannKiar said: Or you can set these NPCs "Protected" in the Creation Kit and then simply place them in Concord. (If they're flagged as protected, only the player could kill them). Then place a DefaultEmptyTrigger and attach this script to it:Actor Property PlayerRef Auto Const Group MinutemenRefs ObjectReference Property Minuteman01 Auto Const ObjectReference Property Minuteman02 Auto Const ObjectReference Property Minuteman03 Auto Const endGroup Event OnTriggerEnter (ObjectReference akActionRef) If akActionRef == PlayerRef Minuteman01.SetProtected(false) Minuteman02.SetProtected(false) Minuteman03.SetProtected(false) Self.Disable() EndIf EndEventAfter you enter this triggerbox, the NPCs won't be protected and the trigger will disable itself.Thanks you both for the detailled reply, so I tried to set them as protected and then place the default entry trigger added to it the new script of LarannKiar only replacing the Minuteman01 by the ID I gave to my 3 minuteman. Then I scaled the trigger box to all the concord street englobing the minutemen as well as the player position. But when I go in game they don't change to unprotected because the 3 of them fall on the ground then get back up and that previous time they were all dead. So it's not enough for the minutemen to be in the trigger box with the script added ? Do I have to link them via reference ? And for Zorkaz solution if I have understood the idea is to disable all including vanilla raiders so that they are passive until the player come near them ? Because if I don't disable all of them the raider will kill the passive minuteman ? Edited May 5, 2021 by Andrewupkins
LarannKiar Posted May 5, 2021 Posted May 5, 2021 The NPCs don't have to be in the triggerbox. It doesn't really matter as the OnTriggerEnter event fires only if the player enters the triggerbox (akActionRef == PlayerRef). If the triggerbox is too large, raiders can easily kill the three Minutemen by the time you arrive at the Museum of Freedom in Concord.. Both solutions (1. start initially disabled then enable them. 2. protected to unprotected) are good, just make sure to place high leveled Minutemen (level 50+ if the raiders are Raider Veterans or Raider Survivalists). You can also create a "friend faction" for the raiders and the minutemen. When you enter the triggerbox, the NPCs would turn hostile to each other.
Andrewupkins Posted May 5, 2021 Author Posted May 5, 2021 On 5/5/2021 at 1:06 PM, LarannKiar said: The NPCs don't have to be in the triggerbox. It doesn't really matter as the OnTriggerEnter event fires only if the player enters the triggerbox (akActionRef == PlayerRef). If the triggerbox is too large, raiders can easily kill the three Minutemen by the time you arrive at the Museum of Freedom in Concord.. Both solutions (1. start initially disabled then enable them. 2. protected to unprotected) are good, just make sure to place high leveled Minutemen (level 50+ if the raiders are Raider Veterans or Raider Survivalists). You can also create a "friend faction" for the raiders and the minutemen. When you enter the triggerbox, the NPCs would turn hostile to each other.Ok, in fact I didn't saved the script that's why, but now that I have I get a fail, I had copy this in the script of the trigger box : Actor Property PlayerRef Auto Const Group MinutemenRefsObjectReference Property RaiC&M_pvt_Arthur_Onegoodeye Auto ConstObjectReference Property RaiC&M_Minuteman_ConcordFront_01 Auto ConstObjectReference Property RaiC&M_Minutemen_ConcordFront_03 Auto ConstendGroup Event OnTriggerEnter (ObjectReference akActionRef) If akActionRef == PlayerRef RaiC&M_pvt_Arthur_Onegoodeye.SetProtected(false) RaiC&M_Minuteman_ConcordFront_01.SetProtected(false) RaiC&M_Minutemen_ConcordFront_03.SetProtected(false) Self.Disable() EndIf EndEvent
LarannKiar Posted May 5, 2021 Posted May 5, 2021 (edited) On 5/5/2021 at 3:25 PM, Andrewupkins said: Ok, in fact I didn't saved the script that's why, but now that I have I get a fail, I had copy this in the script of the trigger box : Actor Property PlayerRef Auto Const Group MinutemenRefsObjectReference Property RaiC&M_pvt_Arthur_Onegoodeye Auto ConstObjectReference Property RaiC&M_Minuteman_ConcordFront_01 Auto ConstObjectReference Property RaiC&M_Minutemen_ConcordFront_03 Auto ConstendGroup Event OnTriggerEnter (ObjectReference akActionRef) If akActionRef == PlayerRef RaiC&M_pvt_Arthur_Onegoodeye.SetProtected(false) RaiC&M_Minuteman_ConcordFront_01.SetProtected(false) RaiC&M_Minutemen_ConcordFront_03.SetProtected(false) Self.Disable() EndIf EndEvent You shouldn't use "&" in a script. Also, leave the Scriptname untouched. Edited May 5, 2021 by LarannKiar
Andrewupkins Posted May 5, 2021 Author Posted May 5, 2021 On 5/5/2021 at 7:01 PM, LarannKiar said: On 5/5/2021 at 3:25 PM, Andrewupkins said: Ok, in fact I didn't saved the script that's why, but now that I have I get a fail, I had copy this in the script of the trigger box : Actor Property PlayerRef Auto Const Group MinutemenRefsObjectReference Property RaiC&M_pvt_Arthur_Onegoodeye Auto ConstObjectReference Property RaiC&M_Minuteman_ConcordFront_01 Auto ConstObjectReference Property RaiC&M_Minutemen_ConcordFront_03 Auto ConstendGroup Event OnTriggerEnter (ObjectReference akActionRef) If akActionRef == PlayerRef RaiC&M_pvt_Arthur_Onegoodeye.SetProtected(false) RaiC&M_Minuteman_ConcordFront_01.SetProtected(false) RaiC&M_Minutemen_ConcordFront_03.SetProtected(false) Self.Disable() EndIf EndEvent You shouldn't use "&" in a script. Also, leave the Scriptname untouched. Ok I didn't get it because this all script thing is kind of overwhelming to me, so I don't have to change the text script that you gave me, so first question on which aspect of the NPC the "minuteman01, 02" etc are based ? Is it the Editor ID, the faction or other, because my 3 minuteman NPC are modified copied NPC not vanilla one so if I undrestand correclt copying your text script without modifying anything should work with them ? I just try to understand how this work so I can apply this to others
LarannKiar Posted May 5, 2021 Posted May 5, 2021 "Minuteman01" is the Editor ID. They are object references and script properties. You have fill these properties with their Ref ID. If you typed their Editor IDs in the script, you can fill them using "Auto Fill". After filling these properties, the script should work.
Andrewupkins Posted May 6, 2021 Author Posted May 6, 2021 On 5/5/2021 at 10:26 PM, LarannKiar said: "Minuteman01" is the Editor ID. They are object references and script properties. You have fill these properties with their Ref ID. If you typed their Editor IDs in the script, you can fill them using "Auto Fill". After filling these properties, the script should work.I don't understand how do I "auto fill" in the script ? do I need to type "autofill" in the script if so those script seem kind of technical were can I be iniated to basic script command so I know what I am doing were I writing stuff
Recommended Posts