Jump to content

Triggers and scripts


devinpatterson

Recommended Posts

I placed an enclave soldier in a mod. He is disabled and persistent. Then I set up a cubic activator about 15'x15' about 10 feet or so ahead of him. Attached a simple script to the trigger (just a EnclaveSolderRef.enable). This way I figured the player would walk by and an enclave solder would surprise him/her from behind. Unfortunately as soon as I load the game he appears. So I delete the trigger and he is gone (disabled), and try it again making another trigger. And once again he is there when I load up my save. He should be disabled until the player walks into the trigger at which point he would be enabled. Or am I misunderstanding what the trigger is/does? Anybody have any idea what is going on?

 

For the activator I attached a script, ticked the new box, changed the id and the name (blank). Everything for the Refid for the activator is default. The EnclaveSolderRef is default other than ticking the persistent ref & initially disabled boxes. No scripts or anything unusual from the EnclaveSolder, just changed some stats and added a few items to inventory.

Link to comment
Share on other sites

I placed an enclave soldier in a mod. He is disabled and persistent. Then I set up a cubic activator about 15'x15' about 10 feet or so ahead of him. Attached a simple script to the trigger (just a EnclaveSolderRef.enable). This way I figured the player would walk by and an enclave solder would surprise him/her from behind. Unfortunately as soon as I load the game he appears. So I delete the trigger and he is gone (disabled), and try it again making another trigger. And once again he is there when I load up my save. He should be disabled until the player walks into the trigger at which point he would be enabled. Or am I misunderstanding what the trigger is/does? Anybody have any idea what is going on?

 

For the activator I attached a script, ticked the new box, changed the id and the name (blank). Everything for the Refid for the activator is default. The EnclaveSolderRef is default other than ticking the persistent ref & initially disabled boxes. No scripts or anything unusual from the EnclaveSolder, just changed some stats and added a few items to inventory.

 

What kind of script are you using?

 

Use

Begin OnTriggerEnter      (note it might be Begin OnTriggerEntry or something similar I can't recall)
    Ref.Enable
End

 

If you're using Begin GameMode block it will run at the start of the game

Edited by PaladinRider
Link to comment
Share on other sites

Yep I was using begin on gamemode block, thanks PaladinRider. This will hopefully also help me with problems I'v been having re: triggers and making a sniper npc. Thank you

 

No problem, glad to help. With questions like these though, the best thing is often to look at vanilla scripts. Take a look at original scripts where triggers are used and you can learn and solve your problems.

 

Happy modding :thumbsup:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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