Author Topic: FRED Question #11521  (Read 2077 times)

0 Members and 1 Guest are viewing this topic.

Offline NGTM-1R

  • I reject your reality and substitute my own
  • 213
  • Syndral Active. 0410.
I want to rig a surrender of an enemy force such that they will surrender on either one of two conditions: the hull integrity of their installation drops below 45% or 55% of their fighters and bombers are destroyed. The first condition was easy. The second is proving less so.

So, I go to set up an event for the second surrender  I figure that's what the percent-ships-destroyed sexp is for. Added the three enemy wings...and it tracks casualities such that each individual wing must take 55% casualities, not the three as a whole. This leads two of the wings getting wiped out (for a total of 16 out of 28 fighters getting whacked minimum, which ought to meet the requirements...but doesn't...) most of the time and the last getting mostly wiped out too.

Thus the question: is it possible to make the mission track total enemy fighter casualities as opposed to doing so by individual wing?
"Load sabot. Target Zaku, direct front!"

A Feddie Story

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Variables.

(For each fighter) When->ship-destroyed->current fighter,Variable+1
When->variable>value (in your case 15), trigger surrender event.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline NGTM-1R

  • I reject your reality and substitute my own
  • 213
  • Syndral Active. 0410.
Perhaps you can provide a more detailed explanation...?

Also that would work out to an awful lot of seperate events...
"Load sabot. Target Zaku, direct front!"

A Feddie Story

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
You're right that it does work out to a lot of events.  But if %-destroyed isn't working then it may be the only way to do it.  According to the SEXP explanation, the way you originally tried should actually work.  What happens if you fill the list with individual ship names rather than wings?

EDIT: I just tried this, the original method does in fact work. One percent-destroyed-delay with four wings of four fighters each all listed in one event triggered properly, when I destroyed 8 fighters (all of wing A, most of wing B, and one fighter from wing C) so it may be something else that's wrong.  Also keep in mind that while you calculate 16/27 as 55%, rounding may change that by a value of one so you may actually have to destroy 17 fighters to trigger the event.
« Last Edit: September 08, 2005, 12:02:38 am by 570 »
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Also keep in mind that percentage-destroyed uses all the ships in all waves not just the current one. If one of your enemy wings has more than one wave that will throw off any calculations FS2 is making. If you're finding that a much higher percentage of ships needs to be killed that's probably your problem.

I see no reason why percentage destroyed shouldn't be working in this case.


@ StratComm : Even if the percentage destroyed system isn't working properly variables is still the wrong way to go. The best solution would be to use when-argument like this

When-argument
-number-of
-16
-LIST OF SHIPS IN ALL THREE WINGS
-Is-Destroyed-Delay
--< Argument >
-DO WHATEVER

I'd only use variables if this was a retail mission seeing as how this one event can do the same job as the 29 events you'd need using variables :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline ShadowWolf_IH

  • A Real POF Guy
  • 211
    • CoW
percent destroyed when using wings will keep tracvk of wings...to do it with ships...simply list each ship.

when
.....or
........<
..........HUll points
.............installation
..........45
........percentage ships destroyed
............55
................Alpha 1
................Alpha 2
................Alpha 3
.............etc etc etc for each ship. don't use wings
You can't take the sky from me.  Can't take that from me.

Casualties of War

 
Quote
Originally posted by karajorma
Also keep in mind that percentage-destroyed uses all the ships in all waves not just the current one. If one of your enemy wings has more than one wave that will throw off any calculations FS2 is making. If you're finding that a much higher percentage of ships needs to be killed that's probably your problem.

I see no reason why percentage destroyed shouldn't be working in this case.


@ StratComm : Even if the percentage destroyed system isn't working properly variables is still the wrong way to go. The best solution would be to use when-argument like this

When-argument
-number-of
-16
-LIST OF SHIPS IN ALL THREE WINGS
-Is-Destroyed-Delay
--< Argument >
-DO WHATEVER

I'd only use variables if this was a retail mission seeing as how this one event can do the same job as the 29 events you'd need using variables :)


When-argument confuses me
Sig censored by people with no sense of humor

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Not just you. Virtually everybody. There are only a handful of FREDders using it which is a real shame because it's hugely powerful.

I was going to point you at my FAQ but then I realised I haven't uploaded the changes that include an explaination cause I'm still tinkering with that page so I'll just post it here.

--------------------------------------------------------------------------------------
When-Argument / Every-Time-Argument

Probably the two most confusing of the new SEXPs for most people these two SEXPs are also amongst the most powerful. Both SEXPs allow you to do things that previously would have required a lot of tiresome fiddling with variables. In addition they also allow you to do things in 1 event that previously could have required hundreds.



You use these SEXPs like this. Suppose I had a senario where I wanted something to happen if ever Alpha 1 got within 2000m of any of Cancer, Leo or Libra wings. What you could do is make an event like the one to the left for each wing. Then in a fourth event I'd check if any of the events had come true and then do whatever I wanted to happen. That works reasonably well but what if there were 9 wings instead of three? I'd need ten events in total. Nine events checking to see if Alpha was close and one with an an enormous or SEXP checking if any of those events had occured. As you can see this would take a long time to make, uses up a large number of the SEXPs you're allowed in a mission and would be a pain in the neck to change if you wanted to add something to when the 9 events trigger (suppose you later decide that it only matters where Alpha is after a certain capship arrives. You've now got to go back an edit all nine events).



When-Argument gives you a way to do this more simply. The SEXP allows you to declare a list of ships that the rest of the event will apply to. The event to the right replaces the four events I needed to check the distance from Leo, Cancer and Libra wings with a single event. If I wanted to do the same thing for nine enemy wings I wouldn't need any more events. I'd just add the names of the six extra wings below Libra.
The event works quite simply. When the mission is running FS2 looks at the list of ships this event applies to. Whereever it sees the word argument it sticks in the name of the wing at the top of the list. If condition is true (i.e Alpha 1 is less than 2000m of Cancer wing) then the event triggers and whatever you've replaced do-nothing with will happen. If not FS2 goes back this time substituting the second name on the list wherever it sees argument. FS2 continues down the list until it reaches the end or finds something that triggers the event.
--------------------------------------------------------------------------------------


It's not complete yet cause I need to explain the conditions that can trigger it and also show that it doesn't have to be ships in the list (It can be anything, Names of messages, Names of subsystems, Pretty much anything that can appear in a SEXP).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline NGTM-1R

  • I reject your reality and substitute my own
  • 213
  • Syndral Active. 0410.
Well, nothing works with waves implemented anyways, so it's back to percentage-destroyed and I'll just have to add more wings and chop the waves off the ones that are there.
"Load sabot. Target Zaku, direct front!"

A Feddie Story