Working backwards, lets start with the dead tank problem. Depending on exactly what conditions you want, the best thing to put in a trigger to test if a tank is dead is
(not canMove tank1) and (notcanFire tank1)
If you want, you can add to that
not alive tank1D etc
or alternatively you can use the not move and fire thing and use setdammage 1 on the tank crew.
As you say, using not alive tank1 just gets you into trouble. Don't use not alive for vehicles, its not good game design.
Now, the dead infantry problem. Your logic is basically right of course. If you haven't initialised the variable deadgroup I suspect it won't work. You also need to understand the difference between = and ==
Here's what I'd do. (syntax not guaranteed, check it in the command ref)
? (count units groupA == 0):Adead=true
? (count units groupB == 0):Bdead=true
? Adead and Bdead:2ndWaveGo=true
There is usually a delay of a few seconds before the count command works. It might be better for gameplay purposes to use <= 1 rather than == 0, but you can check that with playtesting.
By using seperate variables for each group, rather than a cumulative system, it will make it easier to check what's going on. For instance you could have a debugging trigger
condition: Adead
on activation: hint "Group A is dead"
Right last point, initialising variables. If OFP comes across a variable it doesn't understand, it makes the whole expression false. In your logic, its just going to ignore the whole of
If GroupA count = 0 then deadgoup=deadgroup+1
because it doesn't know about deadgroup, unless you have put this in your init.sqs (or somewhere)
deadgroup=0
In my version, there is no need to initialise the varible because I'm not asking the game to do anything until it has been defined as true. In other circumstances (for example if I want the game to do something when the variable is false) I would have to write in init.sqs
Adead=false
Does that make sense? Or did you know it already?
I assume you are using a switch trigger for the tanks' waypoint.