Jump to content
Sign in to follow this  
Kenwort

How to make a trigger restart/reset?

Recommended Posts

Hello,

I've ran into a little problem.

Here is the situation

A town held by blufor is being attacked by opfor, once blufor detects opfor the alarm goes off in the town and once the opfor have been defeated by blufor the alarm turns off and everyone goes back to their positions.

Problem

I have a trigger that is set to activate on opfor, detected by blufor, this will turn on the alarm.

When the attackers (that blufor knows about) are defeated the alarm turns off.

Now when the 2nd opfor wave comes the alarm is not turned on because the trigger hasn't been reset, it goes off only once and that's it.

Solution ?

How to make the trigger reset when the attackers have been defeated ?

The enemy count will be random, also there is a enemy recon team near by the town.

Please help.

Thanks!

Share this post


Link to post
Share on other sites

Are you sure it doesn't work, as long as I have a trigger set to repeat it can detect when units are seen without having to force the trigger to reset.

If you do need to force a reset you need to add a variable.

game logic init

testvar = true

cond

this and testvar

on act

testvar = false

on dea

testvar = true

If you can also reset the variable in other triggers or scripts.

As long as the variable changes from true to false to true it's enough to get the trigger to reset.

Share this post


Link to post
Share on other sites

I still can't get it to work. I made small demo mission showing what I need to happen.

http://www.mediafire.com/?7x7v6475fvcz4dg

In the demo mission you will see enemy rifleman attacking then another one attacking when the previous one is defeated.

I want the detection trigger to reset once the first attack has been defeated.

Please take a look, Thanks!

Share this post


Link to post
Share on other sites

As already mentioned, set triggers to repeating for the repeating effect:

<a  href=http://img856.imageshack.us/img856/3474/arma2oa2012013112272170.gif' alt='arma2oa2012013112272170.gif'> Uploaded with ImageShack.us[/img]

edit: did not see solution before posting..

Edited by Demonized

Share this post


Link to post
Share on other sites

It was the first thing I tried but I couldn't get it to work because the alarm wouldn't turn off or on again the 2nd time. Doesn't matter now, I've sorted it out.

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  

×