Jump to content

Recommended Posts

Posted

Well, long story short, I've been trying to get a sound marker to go on then off at certain times. I initially attempted to apply conditions within AI packages to make it go off. That should have worked, but could never get it to work.

 

https://forums.nexusmods.com/index.php?/topic/7788313-set-a-condition/

 

Now, and I think it is actually a better option, I am trying to get this to be triggered when an NPC enters the trigger (on sound) and leaves trigger (off sound).

 

I've got the triggerbox set with the following script attached:

 

  Reveal hidden contents

 

 

No properties on script.

This triggerbox is link-ref to an activator (below).

Z is set to number other than zero.

 

Have activator (initially disabled) with defaulttoggleselfonactivate script attached, no properties

Has player activation ticked

Z is set to number other than zero

 

Sounder maker has the above activator set as Enable Parent.

 

Won't work.

 

I'm not a script-er. The script above was gifted to me for another very similar situation, but for some reason won't work.

 

Any help is appreciated. Thanks

Posted

Not sure what the iCount is for, can't you keep it simple:

 

EVENT onTriggerEnter(objectReference akActionRef)
if akActionRef == Game.GetPlayer()
;Do something
endif
endEvent


EVENT OnTriggerLeave(objectReference akActionRef)
if akActionRef == Game.GetPlayer()
;Do something else
endif
endEvent

 

 

Also kTemporary is a property and needs to be defined.

Posted

iCount is used to keep track of how many/when objects enter and leave the trigger. It's an old way to ensure that the events do not fire out of sequence(i.e OnTriggerLeave firing before OnTriggerEnter). The creator of papyrus though has stated in the past the GetTriggerObjectCount() is better.

Posted

But is the iCount the reason this isn't working? Because it is working on a similar set up in the mod using a moveable static instead of the sound marker. Thanks for responding.

Posted
" Now, and I think it is actually a better option, I am trying to get this to be triggered when an NPC enters the trigger (on sound) and leaves trigger (off sound). "


Why don't you use a default vanilla script ? :

defaultDisableExitEnableEnter


This script will disable the triggerbox's linked references when the player exits the triggerbox, then enables them when the player enters the triggerbox. This script will only work on triggerboxes. Only 5 linked references can be recognized.

Posted
  On 8/12/2019 at 2:35 PM, maxarturo said:

 

" Now, and I think it is actually a better option, I am trying to get this to be triggered when an NPC enters the trigger (on sound) and leaves trigger (off sound). "
Why don't you use a default vanilla script ? :
defaultDisableExitEnableEnter
This script will disable the triggerbox's linked references when the player exits the triggerbox, then enables them when the player enters the triggerbox. This script will only work on triggerboxes. Only 5 linked references can be recognized.

 

I would gladly but as I said I'm not a scripter so I don't know which one might work. Right now the activator which is linked to the trigger as defaulttoggleselfonactivate script attached, which is a vanilla script. Also, this needs to work with NPCs not the player.

Posted
I don't know why you need an " Activator ", but you can Link Ref the " Sounder maker " directly to the script's properties ( MyREF ).

* " Sound Marker " should be in a initialy disable state.

Script should look something like this so that all actors can trigger it :


  Reveal hidden contents


Posted

As I pointed out above this may be your problem "Also kTemporary is a property and needs to be defined".

Posted (edited)

@maxarturo: Thanks for writing that up for me. You said I don't need an activator but you included a property for an activator? Not sure what to do. I've created the script and it compiled. Linked the myRef property to the sound marker. Just need to understand the activator part?

Edited by NexBeth
  • Recently Browsing   0 members

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