JacobJ 10 Posted June 14, 2011 Hello all I have a problem. I have 6 triggers that ends the mission. Each trigger has END1 to END6, so all triggers have different end-types. The problem is, that I have a trigger that won't end the mission. It is the end1 trigger. I have tried to switch the end1 with end2 and end2 with end1 and that doesnt make a difference for the end1-original trigger, it just won't end the mission. The other end2 trigger I set to end1 ended the mission as it should, so I guess the end1 type isnt the problem. I guess it is my conditions.. but... I have copied the conditions from the end2 trigger that works and just switched the names from e1 to e9 + warlord, to w1 to w9 + chief. But it just won't end the mission. I have searched all my scripts through to see if I had endmission "end1" placed somewhere, but nothing came up. Here is the two triggers from my mission file: Trigger that works: position[]={4854.0825,339,9989.6133}; a=0; b=0; angle=-74.8741; timeoutMin=5; timeoutMid=5; timeoutMax=5; interruptable=1; type="END2"; age="UNKNOWN"; text="Opfor done"; expCond="this && !(alive e1) && !(alive e2) && !(alive e3) && !(alive e4) && !(alive e5) && !(alive e6) && !(alive e7) && !(alive e8) && !(alive e9) && !(alive warlord)"; expActiv="tower setdamage 1; hummer setPos (getPos humrescue); tsk1 setTaskState ""Succeeded""; tsk2 setTaskState ""Succeeded""; tsk3 setTaskState ""Succeeded""; tsk4 setTaskState ""Failed""; tsk5 setTaskState ""Failed""; tsk6 setTaskState ""Failed""; if (paramsarray select 5 == 1) then {player removeSimpleTask tskPoints; tskPointstotal = player createSimpleTask [""Total points""]; tskPointstotal setSimpleTaskDescription [format [""Total points: %1"",mst],format [""Total points: %1"",mst],format [""Total points: %1"",mst]];};"; Trigger that doesnt work: position[]={4849.9697,339,9990.4131}; a=0; b=0; angle=-139.936; timeoutMin=5; timeoutMid=5; timeoutMax=5; interruptable=1; type="END1"; age="UNKNOWN"; text="west done"; expCond="this && !(alive w1) && !(alive w2) && !(alive w3) && !(alive w4) && !(alive w5) && !(alive w6) && !(alive w7) && !(alive w8) && !(alive w9) && !(alive chief)"; expActiv="tsk4 setTaskState ""Succeeded""; tsk5 setTaskState ""Succeeded""; tsk6 setTaskState ""Succeeded""; if (paramsarray select 5 == 1) then {player removeSimpleTask tskPoints; tskPointstotal = player createSimpleTask [""Total points""]; tskPointstotal setSimpleTaskDescription [format [""Total points: %1"",mst],format [""Total points: %1"",mst],format [""Total points: %1"",mst]];};"; I can't see where the problem is, I hope you guys can help me out here. ---------- Post added at 14:23 ---------- Previous post was at 14:16 ---------- I have also now tried to search all my scripts and my mission.sqm for the names w1 to w9 and chief and nothing is wrong there.. Share this post Link to post Share on other sites
kylania 546 Posted June 14, 2011 Why do you have the "this &&" in there? That's not actually checking anything since it's a simple alive check trigger. Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 I thought it had to be there for the timeout to work??... Well its something ive placed in afterwards to see if it was the problem, but that didnt do anything. It also doenst work if I remove it. Share this post Link to post Share on other sites
kylania 546 Posted June 14, 2011 Can you post the mission maybe? Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 I would rather not, untill it is done. What exactly do you need from it? Maybe I can extract? As said I have searched with notepad ++ through all the scripts I have and nothing unexpected came up. Share this post Link to post Share on other sites
kylania 546 Posted June 14, 2011 Did you try it without the this &&? Coz in editor testing, the this && is causing the problem. Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 Ive just removed the this && part and it didnt help. Share this post Link to post Share on other sites
demonized 16 Posted June 14, 2011 (edited) if you are only checking for those units to be dead, then i would remove the edit: i did not refresh window before post. this && from the triggers conditions, else it might be that you have set the this condition to something else on the not working trigger. are the names all correct, that is the only other thing that may be wrong, and as kylania said, we are just wild guessing now and that will not help. Edited June 14, 2011 by Demonized Share this post Link to post Share on other sites
kylania 546 Posted June 14, 2011 Ive just removed the this && part and it didnt help. Then there is something else causing the issue and without the mission it would be silly to keep trying to guess what it is. :) Good luck though. Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 I tried to remove the this && and it didnt work. What do you mean with I could have set the this condition to something else? Can you explain that a bit further? Share this post Link to post Share on other sites
demonized 16 Posted June 14, 2011 i guessed it was a mission.sqm info you posted in OP, but if i place down a trigger in editor and look at mission.sqm i get a activationBy="ANY"; when i set the trigger activation to none, i dont get it (same as your post) but if i then use this AND alive player as condition, nothing happens, so if removing of this && does not workm there is a issue with the names checked alive or the tasks, names or something else in the creation of them. most likely a handler error or something. but again, witout more info this is major guesswork. Share this post Link to post Share on other sites
2nd ranger 275 Posted June 14, 2011 I tried it too and it only works without this && (I copied the mission.sqm trigger into an existing sqm). Make sure the trigger is definitely not firing by removing all your Activation code and just putting Hint "a" or something. Condition: !(alive w1) && !(alive w2) && !(alive w3) && !(alive w4) && !(alive w5) && !(alive w6) && !(alive w7) && !(alive w8) && !(alive w9) && !(alive chief) And as Demonized said, make sure all the unit names are correct. If the above still doesn't work then the only explanation is you've misnamed a unit (or of course someone is still alive). Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 And the very last sentence of yours is the problem. I tried to disable respawn and woops it ended the mission. But how can this be? I thought that when a unit dies, he doesnt get the same name as before he got killed. Does a respawning unit keep its name?? I have a remote respawn-area where players go into spectator-mode, how can I solve this, but still keeping the respawn possible. Another question is, why does it work with the east-soldiers? It works when respawn is on and when respawn is off.. isnt this a bit strange?? ---------- Post added at 18:15 ---------- Previous post was at 18:04 ---------- Okay, now I tried to turn on the respawn again, but still only the all-opfor-killed trigger works for ending the mission. When all the blufor dies the mission doesnt end. Is there some other way of triggering an endgame, instead of the !alive w1 condition? Share this post Link to post Share on other sites
demonized 16 Posted June 14, 2011 what is your respawn timer? this sounds to be your problem, bluefor respawning before they are all dead, so there is almost always a alive unit of the condition. edit: for triggering an end game there is infinite possibilities, its just up to what you want as mission creator. Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 hmm I have none... maybe I should try to put in a second or two and see if it helps.. brb.. ---------- Post added at 18:27 ---------- Previous post was at 18:23 ---------- Yes indeed that did the trick! Thank you very much once again! Share this post Link to post Share on other sites
demonized 16 Posted June 14, 2011 hmm I have none... maybe I should try to put in a second or two and see if it helps.. brb.. you realize that all the named units have to be dead in the exactly the same (2 second window) for the trigger to activate? so unless all is killed in pretty much the same bang, they will never trigger the end condition. you can assign "lives" to players, and when so and such amount of lives used, then end condition is true: using setVariable and getVariable(the one with defaultvalue) this would be pretty much straightforward to do, and will help you if you do not want long respawn timers. Edit: good you got it working, the little things, makes the biggest problems. :) Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 arggghh!! Didnt thought of that. Isnt it a bit weird anyhow. Because when a unit gets killed, the same unit doesnt respawn, its a new unit and that unit doesnt have the same name as the unit that died. Right? Then the trigger should only trigger when all the units are dead and because those units do not respawn, but new once does, they (the new once)wont interfear with the trigger.. Or am I wrong about this? ---------- Post added at 06:55 PM ---------- Previous post was at 06:43 PM ---------- Could I make a trigger for each unit and on the units death a variable that gets +1. When the variable hits 10 (the number of units I have on each side) it ends the mission. I know that is 20 triggers I have to set up, but atm its the only thing I am capable of doing. ---------- Post added at 07:14 PM ---------- Previous post was at 06:55 PM ---------- hmm, what about making one trigger, that is repeatable and that has: cond: !(alive w1) OR !(alive w2) OR ....... OnAct: blubuffer = blubuffer + 1; publicvariable "blubuffer"; Then make another trigger to fire the end1, when the blubuffer = 10. Wouldnt that work? ---------- Post added at 07:57 PM ---------- Previous post was at 07:14 PM ---------- I have the respawn-area, where dead players go into spectator mode. Can I somehow make a: while (true) do { if (_x side = west) then {listblu = listblu + _x}; if (count listblu = 10) then {endmission end1}; sleep 1; }; I am not totally sure about this coding, but will try it out, when I get to the computer again. ---------- Post added at 07:59 PM ---------- Previous post was at 07:57 PM ---------- Or maybe I just make an eventhandler for each of the units spawning at the beginning of the mission and when the eventhandler for each unit has fired a variable will have 10 in it and the trigger will fire the end1. Share this post Link to post Share on other sites
JacobJ 10 Posted June 14, 2011 Okay an little update: Ive done this by using the blufor and opfor variables I already had. I then made two comparator-triggers, one for west and one for east. In those I compared the blufor and opfor variables against blubuffer and opbuffer, wich are two variables created with this: _list = []; { if (_x isKindOf "SoldierWB") then { _list = _list + [_x]; }; } forEach playableunits; blubuffer = count _list; publicVariable "blubuffer"; _list1 = []; { if (_x isKindOf "SoldierEB") then { _list1 = _list1 + [_x]; }; } forEach playableunits; opbuffer = count _list1; publicVariable "opbuffer"; If there are 5 players joining each team, the two lists will contain 5 units each. When the blufor or opfor variables hit 5, they are == 5 and the trigger will fire the end1 or end2 and the mission stops. Because I have preparation-time (time for the opfor to setup their defence, before the blufor team are allowed to move) I had to start my points-system when the blufor-team are allowed to move. At that time the opfor units can be all over the place and thats why I can't use trigger-areas and thislist's to define the opbuffer and blubuffer. The thing I did instead was to use foreach playableunits and this works very well. I am in for some serious testing of this. There are many places where there can be errors and I will post here if anything comes up. For now, I want to say thanks for the help! Share this post Link to post Share on other sites
wamingo 1 Posted June 14, 2011 If you only want 1 life then perhaps this is an interesting method? global ..... myMen = [man1,man2,man3...]; man init .... this addEventHandler ["killed", { myMen = myMen - [_this select 0] }]; trigger .... count myMen < 1; Share this post Link to post Share on other sites