Home   Help Search Login Register  

Author Topic: Problem with the "end mission" triggers!  (Read 2019 times)

0 Members and 1 Guest are viewing this topic.

Offline ricnunes

  • Members
  • *
Problem with the "end mission" triggers!
« on: 19 Jun 2008, 20:32:07 »
Currently I'm developing a multiplayer mission where there are 2 main objectives in which:
1- Is to conquer a city (I'm using the Sakakah map) which should happen when the following trigger is satisfied:
-The trigger has a rectangle format with something like 1000 meters for 2000 meters in order to cover the city of Sakakah
-Activation: ANYBODY -  Repeatedly
-Condition: ((west countSide thislist)+(resistance countSide thislist)*2 > (east countSide thislist)*4)
Which means that the city is conquered if the number of west soldiers (players side) plus 2 times the number of RACS soldiers (players allies) is bigger than 4 times the number of remaining enemies (East side). This means that if for example there are 18 west soldiers in thre city and 11 RACS soldiers the city will be considered "cleaned" when there are less than 10 East soldiers left in the city.
-On act: player sideChat "The uprising has been repeled! The city is clear from enemy presence. Good Job!"; "5" objStatus "DONE"; obj5=true


2- The second trigger that I'm having problems is a "fail" mission trigger where if a certain number of civilians is killed (goes under a certain number) the mission fails. This should happen when the following trigger is satisfied:
-The trigger has a rectangle format which basically covers the entire map
-Activation: ANYBODY -  Repeatedly
-Condition: civilian countSide thislist < 27
This means that for example in that mission I have 35 civilians "wandering around" the city and if more than 8 civilians are killed the should mission fail! In somes tests I killed more than 20 on purpose and the mission never failed!
-On act: [west,"HQ"] sideChat "You failed to avoid too many civilian casualties! Mission Failed - Return to Base!"; "4" objStatus "FAILED"; obj4=true; hint "Mission Failed - Return to Base!"; "5" objStatus "FAILED"; "3" objStatus "FAILED";



The problem is when I test those two triggers in the mission editor or in the dedicated server with a "simplier mission" using those exact same triggers, everything seems to work OK and very well, but when running the "real" mission (which again has those same trigger), those triggers never fire, which means that the city is never conquered or even if all civilians are killed the mission does fail!


I tried so many things but I can't seem to find out what's wrong with those trigger, So I'm asking here for help!

Thanks in advance for any replies.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Problem with the "end mission" triggers!
« Reply #1 on: 22 Jun 2008, 01:35:49 »
#1
Apart from the fact that the activation should be once, not repeatedly, I can't see a problem here. Once means that it will check the condition continually until it changes from false to true (=> activate) then check until it changes from true to false (=> deactivate), then stop working. Repeatedly means that it will activate whenever the condition changes from false to true and deactivate whenever the condition changes from true to false indefinitely. In your example, if the trigger was activated, it would tell you that you had repelled the uprising. Then, should the soldier ratio become unfavourable, then favourable again, then you'd get the message again. OK, all of that doesn't really matter so much if it is being used as an end trigger, but I felt it might be useful for the future that I explain this.

#2
The big problem with this trigger is that living civilians, all corpses (from all factions) and many other objects are actually part of the civilian side. Thus, you could kill civilians all day, and the trigger wouldn't fire since living civilians would just be replaced by dead civilians.
-Activation: CIVILIAN PRESENT - Once (no need for repeatedly, since this only happens once)
-Condition: ({ (_x isKindOf "Man") and (alive _x) } count thislist) < 27
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline ricnunes

  • Members
  • *
Re: Problem with the "end mission" triggers!
« Reply #2 on: 23 Jun 2008, 01:37:30 »
First of all Spooner thanks for your reply.

Regarding, to your point #1, I have my doubts that the problem is because of the "once" or "repeating" options, since the the problem is that the trigger is never fired, but neverthless I will take a look at that issue.

I will definitly take a look at point #2.

again, thanks for the reply.

Offline ricnunes

  • Members
  • *
Re: Problem with the "end mission" triggers!
« Reply #3 on: 23 Jun 2008, 17:38:11 »
Ok, I currently using the sugestions that you gave but I noticed a problem with your code in where I have (in my mission) some civilians riding in buses and cars and I noticed that this code doesn't count them. It seems that this code only counts civilians (men) on foot.
I found a way to for example count buses as well, but the problem is that a bus can carry several civilians (currently each bus in my mission carries 5 civilians) and when I count a bus I have a return of only 1 where for the purposes of my mission I want to have a count of 5, since I don't care much about the counting of individual civilian vehicles but what I only want is to count every individual civilian man including those that are inside vehicles, afterall when a vehicle get damaged the civilian will walk away (if it has the chance for that, that is).

So and resuming, is there a way to count men (civilians in this case) that are not only outside vehicles but the ones inside vehicles as well?

Thanks in advance for replies.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Problem with the "end mission" triggers!
« Reply #4 on: 23 Jun 2008, 17:53:39 »
Sorry, I assumed you weren't using vehicles based on your original posts/samples. Not hard to fix though (the "crew" of a soldier is always just the soldier himself):
Code: (condition) [Select]
numCivilians = 0; ({ numCivilians = numCivilians + ( { (_x isKindOf "Man") and (alive _x) } count (crew _x)) } forEach thislist); numCivilians < 27
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline ricnunes

  • Members
  • *
Re: Problem with the "end mission" triggers!
« Reply #5 on: 23 Jun 2008, 19:13:50 »
Yes, that did the trick! Thanks very much Spooner  :)