Jump to content
Sign in to follow this  
_angus_

"Overlapping" conditions

Recommended Posts

I'm very new to trying to the Mission Editor, and apologies if this is very obvious.

I have a very simple scenario with a line of civilians in front of a line of Opfor soldiers. The idea is you need to snipe all the Opfor guys to save the the civilians. (Actually nothing is going to happen to them).

I created a trigger zone around the area and this activates if there are no Opfor guys there resulting in a Mission Completed for the player.

But I thought the player should lose if all the civilians are killed so I put a similar trigger zone around the civilain (this is inside the original zone) to cause a mission failure if no civilians are present.

It didn't work, killing all the civilians has no effect, so can you not have overlapping trigger zones?

Assuming you can't, what would be an easy way to create the 2 "co-existing" conditions?

Thanks for any help.

Share this post


Link to post
Share on other sites

Nope, you must have done something wrong, there is no problem puting triggers over each others.

Share this post


Link to post
Share on other sites

Animals and some objects count as civilians you will need to filter them out.

Share this post


Link to post
Share on other sites
Animals and some objects count as civilians you will need to filter them out.

Thanks guys, I will take another look at it and see if I can work out what on Earth I'm doing wrong. :)

Share this post


Link to post
Share on other sites

Yeah, as a lot of things count as civilian, you'd better count the amount of civilians (after naming them individually) who are still alive, in a trigger condition line for example, such as :

{alive _x} count [civilian1,civilian2,civilian3] == 0

Share this post


Link to post
Share on other sites

I made the trigger zone a lot smaller so it just covered the civilians, and whatever the problem was, its working fine now - many thanks.

---------- Post added at 09:14 ---------- Previous post was at 09:05 ----------

Yeah, as a lot of things count as civilian, you'd better count the amount of civilians (after naming them individually) who are still alive, in a trigger condition line for example, such as :

{alive _x} count [civilian1,civilian2,civilian3] == 0

Wow.

You see that's exactly the kind of thing that I think people like me (clueless) need to know.

Is there a resource of phrases like that, that people without a programming background can take a look at? Kind of like when you visit a foreign country and you have a list of useful phrases so you can at least make it to your hotel. :)

Share this post


Link to post
Share on other sites
Absolutely : https://community.bistudio.com/wiki/Category:Scripting_Commands

The wiki is the scripting bible, together with this forum search engine.

Ah, yes - I have looked through that, and its great, but I don't think I would have ever managed to put together your "alive _x" solution for my civilians, no matter how long I looked at it.

To go back to my foreign language analogy, in a foreign country (assuming the locals are basically friendly) you can muddle your way through, but with programming, the syntax is all important, and even a slight mistake means failure.

Is there, for instance, an easy way of creating the condition that if any six of the twelve civilians are killed the mission is failed?

Maybe I should try and create a "phrasebook" as I go and make it available for other people that would like to create cool missions but are confused by the scripting side of things. :)

Share this post


Link to post
Share on other sites
Is there, for instance, an easy way of creating the condition that if any six of the twelve civilians are killed the mission is failed?

Yep, by a re use of my former script :

{alive _x} count [civilian1,civilian2,civilian3,...,civilian12] < 6

But if you're "civilian present" trigger works as intended, you can also count the amount of civilians present in that trigger (set it to "repeatable" though) : replace the "this" condition of the trigger by :

{alive _x} count thislist < 6

"Thislist" represents the "array" (ie the list of elements) of all units (and things, as some things can be civilians too, sadly) triggering the trigger.

Share this post


Link to post
Share on other sites
Yep, by a re use of my former script :

Thank you, Prof. To me this is magic, and you, sir, are a wizard. :)

Share this post


Link to post
Share on other sites

I'm with Angus on this :)

There are some people who can just write (probably with lots of practice) very elegant script, just like your examples ProfTournesol.

I could maybe write that, but my first few attempts would have a lot of extra brackets and it would take me a lot longer than i imagine any competant scripter...

...It would be -really- beneficial if there was some sort of 'wizard' on the comref that allowed you to drag/drop certain arguements / requirements to form a statement and it would generate you condition-valid snippits...

Even something basic, with few commands.. But that could handle foreach / _x -- that would generate working examples quickly would help (people like me).

But as i say, i can barely get a mission to work ingame so no chance i'd be able to develop something like that :)

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  

×