Jump to content
Sign in to follow this  
Hoot1988

Alram sounding when units die?

Recommended Posts

is there away to trigger a alarm sounding when some enemies in a base die, or get injured, or the sound of distant loud weapon fire?

I mean loud as in i dont want it to sound as my SFs in the mission have silenced weapons, however if the enemy patrolling the outside fire back then i want it to sound, if they dont fire back i dont want it to.

but i still need it to sound if the one of the soldiers in a base dies.

i then want this to trigger reinforcements, but i know how to do that already:D

Share this post


Link to post
Share on other sites

You could place a large enough trigger (called e.g. unitCounter) above the enemy camp and have it "Activated by OPFOR" -- if your enemies are OPFOR -- at the beginning of the mission. In the onActivation-field you can then count the units and store the initial count to a global variable, e.g. like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> unitCount = count (thislist unitCounter)

Another trigger would now be needed to check if the initial unit count is changed, i.e. if one of them gets killed, it will be less than before. That is exactly when your alarm/reinforcement would come into play ... with just a bit more coding. Maybe there's a more elegant or shorter version. Anyway, hope you got what I was trying to say. Good luck.

Share this post


Link to post
Share on other sites

hmm count get this to work, had a look on the biki and it has no articles about a UnitCounter.

however it did lead me to a GetDammage command which i am using so that when one of the guards gets injured the alarm sounds and the reinforcements then come. i thought there was some sort of detect command that would detect my units but i cant find one at all

thanks for your help tho:D

Share this post


Link to post
Share on other sites

unitCounter is the name of the trigger you would have typed in manually in the trigger's name-field. Talking about getDammage ... you could also attach event-handlers to the enemy units. One of them events that can be attached and handled is "killed", others are "dammaged", "hit", etc. There is some documentation wrt. to this in the BIS wiki. I personally would not go the EH-way this time.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×