OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: NightJay0044 on 11 Sep 2005, 06:51:21

Title: 85% (AI) Soldiers Dead?
Post by: NightJay0044 on 11 Sep 2005, 06:51:21
Alright, for my first wav of attack for the battle. For example:

-I have 2 sqauds simply by select (F2), and inserting squads.
-I'm going to have 2 BMP's.

Now what I need is how to simply make it so, that when the second wav of attack comes in, because the first wav is the 2 squads and the 2 bmbs. But when the second wav comes in, I only want the 2nd wav to come in when the 1st wav's units in both squads are like 85% dead, also the 2 bmps are wiped out, that's when the second wav will attack..

Can someone try and show me the simplest way of doing this?

Thanks..
Title: Re:85% (AI) Soldiers Dead?
Post by: bedges on 11 Sep 2005, 09:30:20
switch trigger, condition

Code: [Select]
({alive _x} count units group grp1) + ({alive _x} count units group grp2) <=4)
synchronised with the second wave's waypoint before they move in.
Title: Re:85% (AI) Soldiers Dead?
Post by: funkster on 11 Sep 2005, 09:43:25
Correct me if I am wrong here bedges,

but that condition does not check that the two BMPs are dead right?

I think he wants your script and a lil more, something like:

Code: [Select]
(({alive _x} count units group grp1) + ({alive _x} count units group grp2) <=4)
AND ((BMP1 getDammage) == 1) AND ((BMP2 getDammage) == 1)

Uh, something along those lines....?
Title: Re:85% (AI) Soldiers Dead?
Post by: macguba on 11 Sep 2005, 11:01:14
Yes.  

But, don't use getDammage ==1:    if the damage  0.99999 the trigger won't fire.   Better to use getDammage > 0.99 or not canFire and not canMove.

Oh, and don't use F2 groups to insert a group for a proper mission.  That's just a shortcut for making test missionettes and messing around in the mission editor.       Missions are much better if you make your own group, with higher skill, a better rank structure and a weapon loadout appropriate to the circumstances.   For example if you wanted them to do a lot of shooting from far away you'd include machine gunners and binoculars.
Title: Re:85% (AI) Soldiers Dead?
Post by: NightJay0044 on 11 Sep 2005, 14:53:12
Alright, so what do I put in a trigger then? What exact details do I imply? That will make the second wav attack when the first wav is 85% dead with both squads and both bmps dead?
Title: Re:85% (AI) Soldiers Dead?
Post by: bedges on 11 Sep 2005, 14:56:41
as stated in replies above...

a switch trigger, condition field

Code: [Select]
(({alive _x} count units group grp1) + ({alive _x} count units group grp2) <=4)
AND ((getDammage bmp1) >= 9.5) AND ((getDammage bmp2) >=9.5)


synchronised to the second wave's attack waypoint...
Title: Re:85% (AI) Soldiers Dead?
Post by: NightJay0044 on 11 Sep 2005, 15:29:17
@Bedges~
Hey, your code gives me an error in the game right when I start.

Code: [Select]
(({alive _x} count units group grp1) + ({alive _x} count units group grp2) <=4)
AND ((getDammage bmp1) >= 9.5) AND ((getDammage bmp2) >=9.5

I made it a switch trigger and put all that code into the condition field. and I also did name my groups "grp1, "bmp1" etc. Any help? thanks.
Title: Re:85% (AI) Soldiers Dead?
Post by: Planck on 11 Sep 2005, 15:37:09
Hmmmmmm......you have a ')' missing from the end of that.


Planck
Title: Re:85% (AI) Soldiers Dead?
Post by: NightJay0044 on 11 Sep 2005, 15:49:37
Code: [Select]
({alive _x} count units group grp1) + ({alive _x} count units group grp2) <=4)  AND ((getDammage bmp1) >= 9.5) AND ((getDammage bmp2) >=9.5)
Alright, tried putting a ")" at the end of the code. Still didnt work..??
Title: Re:85% (AI) Soldiers Dead?
Post by: bedges on 11 Sep 2005, 15:54:26
my mistake  :-[

condition field

Code: [Select]
(({alive _x} count units grp1) <=2) and (({alive _x} count units grp2) <=2) and (not (canmove bmp1)) and (not (canmove bmp2))
grp1 is already a group, no need to ask for "units group group"...

tested and works.
Title: Re:85% (AI) Soldiers Dead?
Post by: bedges on 11 Sep 2005, 16:28:37
NightJay0044, try to keep to one problem per thread. the question you tacked onto the end here relates to another thread you've made about the 5 loons. i think it's more appropriate to continue there.

thread continues here (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=25498).

if this problem with the 85% thing is fixed, hit the 'solve' button for this thread.