Jump to content

CK How do I make a timed trigger so that my NPC spawn only when the player trigger a specific action


Andrewupkins

Recommended Posts

Your script should look like this. (Of course, you can choose another scriptname).

 

T7EEUah.png

 

Exit the editor window, then click on "Properties".

 

HaCNmBV.png

 

Fill the script properties (Minuteman01, Minuteman02, Minuteman03) with their Ref IDs. You should see their Ref IDs instead of "None" under "Value". If the script property's name and the Editor ID match, you can use Auto Fill. If not, click on Edit Value and then select your reference in the Render Window.

 

6G65UgG.png

 

Then click OK to save your script.

Edited by LarannKiar
Link to comment
Share on other sites

Your script should look like this. (Of course, you can choose another scriptname).

 

T7EEUah.png

 

Exit the editor window, then click on "Properties".

 

HaCNmBV.png

 

Fill the script properties (Minuteman01, Minuteman02, Minuteman03) with their Ref IDs. You should see their Ref IDs instead of "None" under "Value". If the script property's name and the Editor ID match, you can use Auto Fill. If not, click on Edit Value and then select your reference in the Render Window.

 

6G65UgG.png

 

Then click OK to save your script.

Thanks for the screenshot I must be dumb but even with them I can't get to add anything in the properties window whatever I write in the addproperty or form button i make script error and don't add anything, I also don't have the ObjectReference Const don't know if it's normal

Link to comment
Share on other sites

Follow these steps:

 

1. Place your three minutemen in game world in the Render Window.

 

2. Name their references (Cell Window) to "Minuteman_01_ref", "Minuteman_02_ref", "Minuteman_03_ref".

 

3. Right click on your DefaultEmptyTrigger, then click on the Scripts tab. Click on Add: add a new script. Name it: "MyMod_Minutemen_Script".

 

4. Copy paste this to the script:

Scriptname MyMod_Minutemen_Script extends ObjectReference Const

Actor Property PlayerRef Auto Const

Group MinutemenRefs
ObjectReference Property Minuteman_01_Ref Auto Const
ObjectReference Property Minuteman_02_Ref Auto Const
ObjectReference Property Minuteman_03_Ref Auto Const
endGroup

Event OnTriggerEnter (ObjectReference akActionRef)

   If akActionRef == PlayerRef

        (Minuteman_01_Ref as actor).SetProtected(false)
        (Minuteman_02_Ref as actor).SetProtected(false)
        (Minuteman_03_Ref as actor).SetProtected(false)

        Self.Disable()

   EndIf

EndEvent

5. Press Ctrl+S to compile.

 

6. Open your script's properties and click on Auto Fill, then click OK.

Link to comment
Share on other sites

Follow these steps:

 

1. Place your three minutemen in game world in the Render Window.

 

2. Name their references (Cell Window) to "Minuteman_01_ref", "Minuteman_02_ref", "Minuteman_03_ref".

 

3. Right click on your DefaultEmptyTrigger, then click on the Scripts tab. Click on Add: add a new script. Name it: "MyMod_Minutemen_Script".

 

4. Copy paste this to the script:

Scriptname MyMod_Minutemen_Script extends ObjectReference Const

Actor Property PlayerRef Auto Const

Group MinutemenRefs
ObjectReference Property Minuteman_01_Ref Auto Const
ObjectReference Property Minuteman_02_Ref Auto Const
ObjectReference Property Minuteman_03_Ref Auto Const
endGroup

Event OnTriggerEnter (ObjectReference akActionRef)

   If akActionRef == PlayerRef

        (Minuteman_01_Ref as actor).SetProtected(false)
        (Minuteman_02_Ref as actor).SetProtected(false)
        (Minuteman_03_Ref as actor).SetProtected(false)

        Self.Disable()

   EndIf

EndEvent

5. Press Ctrl+S to compile.

 

6. Open your script's properties and click on Auto Fill, then click OK.

I tried that but on the last step when you tell me to autofill after having click on the properties of my script autofill all is in gray can't click on it

Link to comment
Share on other sites

  • Recently Browsing   0 members

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