Jump to content
Liberty Bull

Solved: Detecting !alive unit AND variable is true?

Recommended Posts

Solved: I'm dumb and !alive && variable works in triggers with no issue.

 

 

As title, in a trigger I cant seem to check if a unit is dead as well as a variable being true? 

 

In a trigger condition,

 var_beginprisonbattle && var_lawchoosencr

works to require both variables being true before firing, and I could probably just make a variable turn true when the unit in question is !alive, but as a cleaner solution I'd love to be able to check for both !alive && variable.

 

I've tried

!alive && variable.
(!alive unit) && variable; 
(!alive unit) && (variable);
((!alive unit) && (variable));
(!(alive unit) && (variable));

and nothing seems to get the results.

Edited by Liberty Bull
solved

Share this post


Link to post
Share on other sites

make 3 triggers. 1 !alive 2 variable 

trigger3 countdown 5sec cond:  trigger1 triggerActivated && trigger2 triggerActivated. That's what I mean. Ok glad you solve 

  • Thanks 1

Share this post


Link to post
Share on other sites
7 minutes ago, Nemanjic said:

make 3 triggers. 1 !alive 2 variable 3 countdown 5sec !alive && variable

 

So !alive and variable actually does work in triggers, I was trying to do this before in a script as a condition and it wasnt working there, so I falsely assumed it would be the same here. Hours of editing can make you loopy. Still not quite sur why I couldnt get it to work in a script.

Share this post


Link to post
Share on other sites
3 hours ago, Liberty Bull said:

 

So !alive and variable actually does work in triggers, I was trying to do this before in a script as a condition and it wasnt working there, so I falsely assumed it would be the same here. Hours of editing can make you loopy. Still not quite sur why I couldnt get it to work in a script.

 

If you send your script, someone could help. On my mind, forum is made for help on generic topics, points of script, methods,...
Here the page is not useful, adding triggers on triggers is not a method, even if the result is reached.

So if you want learning something about scripting, just write your code and the context if needed (aim, MP or SP, mods,...)

Share this post


Link to post
Share on other sites

I've gotta go back through the mission I'm working on to find the script I was having trouble with, I found a workaround in that case, although I suspect I never had the problem with !alive but probably with a variable being false while another being true.

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

×