Jump to content

target_speaker shut down


Recommended Posts

Hmm i cant seem to get this to work, but probably i made an error somewhere.

 

I have a target_speaker which sounds an alarm as soon as the npc's strigger the sequence for the alarm. this is all fine. Its a trigger, connected to a target_relay with 4 npc stormies and a target_speaker which sounds the alarm (this works).

 

However, I made a script that will trigger on pressing a button, to silence the alarm (i need to script some stuff still, but the idea is if the alarm is off, the player can move on further without being bothered by stormies, if it isn't there will be more stormies along the ride) However, I cant shut off the alarm. I tried to kill it via behaved, but it had no effect.

 

my target_speaker has a script_targetname called alarm, so i tried to shut it down in behaved by running the following

//Generated by BehavEd

rem ( "Shuts down the alarm sound" );

affect ( "alarm", /*@AFFECT_TYPE*/ FLUSH )
{
	kill ( "alarm" );
}

but it had no effect. 

 

I dont want to remove the target_speaker, but if there is no other way.

Link to comment

let me explain the setup. I have a painscript, which let the npc in question walk to a trigger_once and use it. This trigger_once is linked to a target_relay that is linked up to 4 npc's and the target speaker (i think it would maybe be wiser even if i remove the speaker out of it and have it activate by script, but i need to figure out how to turn it off / on by script). In the image in the spoiler you see part of the setup.

 

 

 

explain.jpg

 

 

 

So on the right is a new trigger_once, connected to a target_scriptrunner that fires the above script (i tried it with inactive, kill entity, remove entity, but no luck)

 

Because its tagged to a target relay, i cant link the target_speaker to the other trigger_once.

 

I think i need to look again at my options. Any suggestions?

Link to comment

How about "remove entity" through the script? There was such an option, as far as I remember.

 

The other option might be making soundset (open sound.txt at sound folder and add your lines there), and make a trigger with command soundset name_of_your_soundset. In this case - no need for target_speaker. 

 

To deactivate it you will have to make a second trigger, which will activate soundset kejim_exterior for example.

Link to comment

 

So on the right is a new trigger_once, connected to a target_scriptrunner that fires the above script (i tried it with inactive, kill entity, remove entity, but no luck)

 

 

As i said, that had no effect either....

 

I do have an idea, but I have to find a way to not make the npc spawn and change somewhere the global variable again. Is there a way to let an npc spawn only once (like a count on the npc_spawner)? I need the relay to reach the speaker, so setting the count on the relay isnt an option then.

 

no offense, but somehow, the more i get into behaved, the more restrictions i find ;)

Link to comment

I solved the issue, but its not as beautiful as I hoped and it costed me 2 more entities, however, I can now control the speaker at will through script.

 

I disconnected the target_speaker from the relay, but added a new target script_runner which i connected to the relay. I placed a trigger multiple somewhere against the ceiling that connects to the target speakers. I know, from the npc script i have running to start up the alarm sequence, I can use triggers freely, while not even standing in it, so what I did was I targetted with the use command in behaved the trigger to "use" it. Since its a trigger mulitple it can be toggled on and off now, so my other trigger_once, activating the script to use the trigger multiple just once. 

 

Turns out. after reading documentation last night in bed while the girlfriend and cat were asleep, that target_speakers can only be controlled by triggers, not through script. I havent tested this yet, but I wonder if they respond to a target_activate and target_deactivate, which I still have to find out, because if they do, I still put a questionmark to the fact it didnt respond to the  ( /*@SET_TYPES*/ "SET_INACTIVE", "true" ); which was what @@redsaurus suggested.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...