-
In an effort to improve the general knowledge of how FRED works as well as having some fun I've been writing down little questions for a while. If you want to answer please put your answer in spoiler tags so that everyone can participate.
[spoiler]Your answer[/spoiler]
I'll be dividing questions into two sections. Intermediate and advanced so that everyone can have a go. Most of the questions will involve the little FRED quirks and gotchas that a good FREDder learns to recognise. I won't do beginner cause at the start about 90% of FRED is a gotcha already. :D Try to answer without looking in FRED but feel free to open it if you can't.
All the questions are based around the idea of debugging an existing mission rather than designing one from scratch. In each example you will be presented with a scenario which should have worked except for either a flaw in the FREDder's thought process or a quirk or gotcha in the SEXP the FREDder wasn't aware of. The goal is not to rewrite the SEXPs from scratch. It is simply to say why the event as written isn't working.
The idea is to simulate the mistakes we make when designing missions and help improve debugging skills. The events I'll be using will of course be greatly simplified but in all cases they are simplifications of mistakes I have made, I have seen other FREDders make, or ones I have noticed a possible gotcha for which I suspect most of the community aren't aware of.
Here's the first 4 questions.
Question 1 - Intermediate
For a mission I am working on I want Beta wing (who are friendly Ulysses class ships) to be stealthy. But when I do this it doesn't work. Beta are present at the start of the mission. Why?
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question01.jpg)
Question 2 - Intermediate
I've created a directive for a mission I'm working on but it doesn't show up until I've actually killed the Rakshasa (at which point it shows up completed). What's wrong with directive event (ignore the fact that you could just make the Rakshasa Destroyed Event into the directive ;) )
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question02.jpg)
Question 3 - Advanced
For a mission I'm working on I want the allies to spring a trap on the enemy fighters when they are all within a certain range of Alpha 1 (who is acting as bait for the trap.) Alpha 1 is busy dogfighting with other enemy ships but should get a message as soon as the trap can be sprung. However the trap keeps springing while I can still clearly see ships outside of the range of the trap. It seems to trigger almost as soon as the ships jump in most of the time but occasionally it doesn't trigger straight away. What has gone wrong?
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question03.jpg)
Question 4 - Advanced
In my mission the player must severely damage a turret on a Rakshasa in order to complete the mission. However the game never seems to record this turret as being damaged when the turret is at 9% or lower. Even if I blow the turret up the event still won't trigger. What am I doing wrong?
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question04.jpg)
-
1. You either didn't check the stealth flag or use the exp to make the ship stealthy in the first place
2. Well you already said I couldn't use my solution. :D
3. Distance evaluates to the closest ship in the wing. If you want all of them you need to evaluate each ship not the wing.
4. A bit confusing are you blowing up the ship or the turret? If the ship is killed before the turret it will never be logged as destroyed.
-
Clarified question 4.
-
Question 2 - Intermediate
I've created a directive for a mission I'm working on but it doesn't show up until I've actually killed the Rakshasa (at which point it shows up completed). What's wrong with directive event (ignore the fact that you could just make the Rakshasa Destroyed Event into the directive ;) )
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question02.jpg)
shouldnt the Kill Rakshasa also evaluate when the corvette arrives so it shows in the directive?
-
shouldnt the Kill Rakshasa also evaluate when the corvette arrives so it shows in the directive?
Nope. There is no need to test if the Rakshasa is present. (The Rakshasa is a cruiser BTW, the Moloch is the Shivan corvette). Besides if the event needed a has-arrived-delay SEXP in order to work the problem would be the exact opposite. The directive would be present from mission start.
-
ok ok! last try for myself (trying to redeem miself XD)... I would guess it could be also because you are using a when insted of something like every-time to check on the event.. somewhere near??
-
1: Stealthy only works for stealth ships. Yes I looked at the FRED Documentation for that, sue me. :p
2: is-event-true-delay cannot be used for directives. Well a long time ago you couldn't, but now you can use a true as a 3rd operator to make it usable. Alternatively, you could chain the directive after the event-true for even more convoluted sexping.
3: I'm gonna guess the distance operator giving a unrealistic number during arrival. Or it might be your convoluted not greater than. Or a combination of the two.
4: Terrorism.
Actually cheating again and looking at the documentation, I'm guessing its actually checking all turrets for going below 10%. Again, a 3rd true operator is needed to single it out.
Gimme half points on the ones I looked up. :p
-
1. In addition to the fact Beta may not be stealth-able, they don't have to be friendly either. :p
2. Oh please. :p is-destroyed-delay just like the first. (I didn't technically fold it into one, you just have a redundant, purposeless sexp. Of course, that's exactly what you had before! :p)
3. Well, assuming that Cancer is the only hostile wing in the mission (which I shouldn't do, honestly), reversing your reasoning so that it's a < (and of course the one above becomes a when).
4. I'm currently thinking the same thing I did above, and getting it to check whether the turret is above the necessary strength and evaluate as false if it is.
Last two are wrong!
-
one
Not too much of an idea. Possibly either the fact that the Ulysses doesn't have the stealth flag in the tables or ship properties.
two
The event with the directive in it only executes after the Rakshasa is destroyed, and then it is completed when it first displays because the Rakshasa is already destroyed. AFAIK you want to do something with chaining events here.
three
Cancer is ambiguous. There are probably 4 ships in that wing, and I'm guessing that when FS detects the distance of the closest member of the wing, leaving the rest of the wing still out of range. Or maybe you might want to have "distance alpha/cancer" < 3000 rather than "distance alpha/cancer" not > 3000 because it's less confusing that way.
four
I'll guess that FS gets confused between Subsystems and Turrets. It can't find a "turret01" subsystem and so never evaluates as true.
It's been a while since I've been able to touch FRED. :D
-
1. In addition to the fact Beta may not be stealth-able, they don't have to be friendly either. :p
That's actually a fair point. That would also cause the SEXP to appear to do nothing too. :)
2. Oh please. :p is-destroyed-delay just like the first. (I didn't technically fold it into one, you just have a redundant, purposeless sexp. Of course, that's exactly what you had before! :p)
While that is true the goal of this little exercise isn't to write better SEXPs than the ones I'm writing, by and large they'll be quick off the cuff examples. Since I'm concentrating on gotchas every single question will have a definite flaw in the reasoning. The goal is to figure out what the flaw is rather than what you could do instead. :) The general idea is to help everyone improve their SEXP debugging skills rather than their SEXP creation skills. If you know why these events didn't work you're closer to making an event that does work instead of simply ripping everything out and trying again. :)
In this case a simple replacement is called for but suppose that there were 3 different events like the first one and the second event was just ANDing them together using is-event-true-delay SEXPS. Each individual event now has a definite reason for existing (so you can send messages from them) and a directive for all 3 would probably be the Return to Base. Duplicating the code from all 3 events is silly and increases your workload should you ever have to change anything.
3. Well, assuming that Cancer is the only hostile wing in the mission (which I shouldn't do, honestly), reversing your reasoning so that it's a < (and of course the one above becomes a when).
In fact I was originally going to say that I had originally tried using when < Distance first with no success but I figured that made it too easy for an advanced question. :)
-
Question 2 - Intermediate
I've created a directive for a mission I'm working on but it doesn't show up until I've actually killed the Rakshasa (at which point it shows up completed). What's wrong with directive event (ignore the fact that you could just make the Rakshasa Destroyed Event into the directive ;) )
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question02.jpg)
What's wrong, in a fundamental sense is that, an event doesn't really have any being until it becomes true. A ship's presence in a mission is something that can be either true or false, and if a ship to be destroyed enters a mission then the directive becomes active. But the events, are basically in the mission from the get go. The problem with the event is, how does the event know when to create the directive? As in, what's in the event to give it direction to display the directive? There's no trigger for the directive, only a trigger for its completion. When-destroyed-delay has a trigger because if a ship comes in, that's the trigger. Event-true-delay doesn't really have the sort of trigger to say that "now, this has become possible". I'm not 100% sure, but if you did something like, has-arrived-delay (Rak) AND is-event-true delay. That I think would display the directive. But I haven't fredded in ages so I could be wrong
-
Off the top of my head -
1. The Ulysses isn't a stealth ship
2. Hard to explain...The second event doesn't detect the Rakshasa when it arrives, it only detects when the first event becomes true
(Not sure about the Advanced ones, being just a n00b FREDder)
3. The distance to the closest ship of Cancer wing triggers the event?
4. turret01 is the default turret, but not the one you want to destroy?
-
I'll post the answers to the first 4 questions tomorrow so that everyone has a chance to post.
In the meanwhile here are a couple of new ones for you.
Question 5 - Intermediate
In mission 2 of my campaign the time an enemy cruiser appears is dependent on how the player did in the first mission. Here is my arrival cue for the cruiser.
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question05a.jpg)
And here is the event that should send a message when the cruiser appears.
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question05b.jpg)
If I fail to complete the 1st mission properly the message is sent. But if I succeed I get no message. What's gone wrong? (If that's not enough info, here's a hint).
If I set the arrival cue to true it still doesn't work
Question 6 - Advanced
Early on in another mission a Fenris class cruiser is disabled. The player must then guard an Argo while it docks with and repairs the Fenris. They also must take out an enemy cruiser. Here's the repair event (Which does send the message).
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question06a.jpg)
The event which shows the mission is over isn't triggering though.
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question06b.jpg)
The Rakshasa is definitely dead and if I target the Fenris its engines are at 40%. Why isn't my SEXP working?
-
five
Assuming by "fail to complete the mission" you mean mission one:
You might want to be doing
or
|
|--and
| |
| |-mission 1 complete
| |
| |-arbitrary time elapsed
|
|--50 time elapsed
Past that, FS2 might not like sending messages immediately on mission start, which is the case for the issue. I'd conjecture that a possible solution would be adding a few seconds of delay in there.
six
My guess is that FS gets confused with the name engine. What I'd do is just remove the subsystem argument and just chain the event to the repair engines event.
-
Insert an "I" between "if" and "target" and it all makes sense.
-
Fixed.
-
5-> Guessing on this one. Ship is in game at the beginning so there is no arrival in the log so has-arrived-delay doesn't know the ship is there?
6-> The subsystem was destroyed at one point so that will always evaluate to true so the not evaluates to false so no completion.
-
#5 could, among other things, be the fault of not covering all of your mission-end events, or a misfire in how you chained them all together to create your RTB directive event. Or if this is a reference back to the mission you were building in the first series of questions, the Rakshasa's not working properly because it's dead!
#6 is, I think, the weirdness in the way not's handled. It's evaluated immediately at mission start and doesn't work. You want an and-in-sequence for those two.
-
These are all really good questions. :) I give this thread a :yes:.
-
Five - Set an Event that evaluates whether you completed the mission properly. This will serve two purposes: your arrival cue for the Rakshasha by replacing "is-previous-event-true" with "is-event-true delay" and referencing this proposed event instead, and as a cue for the message event.
The message event should evaluate if the "you messed up in the previous mission" event returns true, or if the Rakshasha enters after the time delay. If either return true, the message is sent.
Six - This is confusing. If you want the Fenris engines to remain at 40%, then it's simple. Set an event to check whether the Rakshasha is dead, then chain an event to check the integrity of the engines. The "send-message" should be used in the second SEXP and should work if both are true.
Actually, it's simple the other way too: if the integrity of the subsystem means nothing to you as long as it's still functioning, have the second SEXP check whether the subsystem's integrity is above 0. The message should send if both are true.
-
These are all really good questions. :) I give this thread a :yes:.
Where's your answers then? :P
Seriously I actually find 2 of the intermediate ones harder then the advanced.
-
These are all really good questions. :) I give this thread a :yes:.
Where's your answers then? :P
Seriously I actually find 2 of the intermediate ones harder then the advanced.
maybe because you had the chance to use that kind of sexp in some mission you've made before, for my is just plain new stuff.
I actually used one of this sexps in a mission I was working on so.. tnks for that inspiration people ^^
-
1: Ulysses are not stealthy to begin with. (?)
2: Third operator "true" not set for "is-event-true-delay", game does not know when to show.
3: Distance to wing is measured from nearest ship. Use AND operator to make sure all individual ships are within range. (?)
4: (Random guess) hits-left-subsystem totals all subsystems?
5: If you complete the mission, the cruiser is present when the mission starts, and has-arrived-delay doesn't register as true. The same thing happens if you set the cruiser's arrival delay to true- if it is present at the beginning of the mission, has-arrived-delay will not recognize it as having "arrived".
6: (Guess) set-subsystem-strength does not repair the subsystem, use repair-subsystem instead. the engine may have its % restored, but the game thinks it's still dead.
-
5
When the Rakshasa is present from the beginning of the mission, it "doesn't arrive", so it doesn't trigger the has-arrived-delay event.
6 The engines have once been disabled, triggering the is-subsystem-destroyed-delay. Once it's triggered, it doesn't return.
-
I've edited my first post to reflect this but the events I've written (with the possible exception of the 3rd) are all for the most part correct. They all contain a single flaw which is breaking them. The goal is not to say how you'd solve the original problem but instead how you'd fix what is in front of you. (Or at least why it doesn't work as intended). :)
We FREDders often get to test our event creation skills but the event debugging skills in the community are rather poor in general. I'm sure each one of us can name an occasion where an event we thought would work hasn't and we've simply tinkered with it a little until it did never understanding why it failed the first time but works now. A coding book I once read referred to this practice as superstition and in many ways that's especially apt when it comes to FRED. I've often seen people say that you need to do really outlandish things to make a SEXP work because they had to do that for a mission.
More often than not we'll shrug and say it's a bug. :D But none of the questions I'm putting up will be based on a bug. In a few cases the SCP has improved the SEXP so you can make it work the way it would have been expected to work but in all cases the SEXPs are working as designed.
Anyway. Here are the answers to the first 4 questions.
Question 1 - Answer
This is a perfect snapshot of mission development and a good example of when superstition actually would give people the right answer (I didn't want to reveal the previous step cause I felt it would make things too easy). The mission development has gone like this.
I wanted to make the Ulysses stealthed so the first event I tried was this.
when
-true
-ship-stealthy
--Beta 1 etc
But in the mission the ships were still visible. I then replaced the ship-stealthy with friendly-stealth-invisible as shown in the question and got the same result. The next step for most people would be to do both. And this is the correct answer. Friendly-stealth-invisible does not make ships stealthy. It is a toggle that makes ships already stealthy invisible if they are friendly. Regardless of whether or not you use it enemy ships will still think the ship is stealthed.
Question 2 - Answer
This one confuses a lot of people when they first encounter it. The problem is that the 3rd optional argument to is-event-true-delay is missing. In the same way that is-destroyed-delay directives won't appear if the ships are not present in the mission, directives using is-event-true-delay won't appear unless the event is true (IIRC this is so chaining works since a chain is basically an is-event-true-delay SEXP). The optional parameter allows you say "Only use this SEXP to determine when the event is true, not when the directive should be displayed).
Question 3 - Answer
Again another snapshot of mission development. But this is a case of superstition leading the FREDder down the wrong path. To all those who suggested going from Not > to < sorry but that's not going to help. In fact in the hypothetical example that's actually what I did first. The point I was trying to make is that a superstitious FREDder might simply think that if less than doesn't work then Not Greater than might work. The problem here is that we read the SEXP from top to bottom and that's a dangerous mistake when the NOT SEXP is involved. Not Greater Than 3000m sounds perfectly reasonable but that's not actually what is being tested in this case.
The problem comes from the way the distance SEXP works with teams or wings. As several people spotted the distance SEXPs work out the distance between the closest ships when a group is involved. This will give you the right answer when you use >, < or = but as soon as you use NOT, all bets are off.
If we work our way from the bottom of the SEXP chain upwards the problem will become clearer.
when
>
-Distance
--Alpha 1
--Cancer
-3000
That SEXP returns true when the distance between Alpha and the member of Cancer wing closest to him is 3000m. The SEXP simply doesn't care where the other two are as long as it's further away. So when we NOT the SEXP the event returns true if the closest ship isn't more than 3000m away. Again we don't care where the other two are.
Question 4 - Answer
This one is just plain nasty. In fact it's even caught out the :v: FREDders. If you look at the mission objectives in Bearbaiting it's obvious that they've added an is-subsystem-destroyed-delay after hits-left-subsystem didn't work.
The basic problem is that hits-left-subsystem does something rather odd internally. When called for any subsystem you have multiples of it will take the average of their hit points. So in the case of the rakshasa it is taking the average of all the turrets hitpoints rather than just those for Turret01. Since the other turrets aren't being destroyed before the Rakshasa is you'll never see the event trigger. There is a third optional argument in 3.6.10 that tells the SEXP not to be so silly and to give the actual hits-left of the subsystem.
This doesn't affect all subsystems BTW. Only subsystems containing the following words will display this odd behaviour. engine, radar, turret, navigation, communication, weapons, sensors, solar, gas or activator.
-
Okay guys, some new questions and the answer to the old ones. I added an easy(ish) one for those having problems with the harder ones. :)
Question 7 - (Easy) Intermediate
In my mission Cancer wing consists of 3 waves of 3 Maras. However when playing the mission I've noticed at one point I appear to have 4 Maras present instead of the 3 I want. I have Cancer 2, 7, 8 and 9 present. What have I set that I shouldn't have?
Question 8 - Intermediate
For this mission I wanted to have a fairly simple minefield. Which I created by planting crates and blowing them up with an explosion effect SEXP (not shown since it takes up half the screen! You can assume that I did nothing wrong there). The mines work exactly as planned. However I wanted a message to trigger when the first mine goes off so I chained the second event (with a chain delay of 1 second).
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question08.jpg)
The message is never sent though. Why isn't it being sent?
Question 9 - Advanced
In the same mission I decided to give the player a debriefing if he managed to get through the entire mission without triggering any of the mines. This seemed simple. Here's the debriefing stage.
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question09.jpg)
If none of the mines go off during the mission the message is played. However if the mines do go off the debriefing stage is still played. Why?
And now for the answers.
Question 5 - Answer
The cruiser has two possible arrival cues. It may arrive after 50 seconds resulting in the message being sent. However the is-previous-event-x is evaluated at time = 0. If the event is true the cruiser arrives at t=0. In this case the game regards the ship as not having arrived as it was already present at mission start.
Question 6 - Answer
The problem here is the is-subsystem-destroyed-delay SEXP. Most people expect it to check the status of the subsystem and report back with an answer but in fact it doesn't do that at all. is-subsystem-destroyed-delay works by checking if the mission log contains a report of the destruction of the subsystem in question. When the engines were destroyed a log entry was posted. From that point on is-subsystem-destroyed-delay will always report that the subsystem is destroyed no matter what you do to it or the ship it is attached to.
-
Haven't touched FRED2 for about a year, but I'll give Question 7 a go.
You set Wave Threshold to 1 for wing Cancer.
-
7. Curses. I've seen this but never actually bothered to figure it out since it's very rare that I do see it. It's either wave threshold or negative wing delay.
8. I'm going to assume the non-expanded portions of the SEXP are irrevelant. I think it's the every-time-argument, which implies it's designed to trigger more than once. Thus, it resets. The event is never fully completed.
9. Same as above; the event never fully completes so it's always false.
-
7- it happened to me but never figured it out, Ill wait for the resolution :D
8- you use a every-time which is a constant loop, it will never become true permanently so the chained event will never happen.
-
seven
Wing threshold stuff.
eight
It's a chain event. The evaluation thingy should just be set to true.
nine
I remember someone mentioning about every-time conditionals that it flushes the events or something like that. I'm willing to bet that it can't remember that the event is true, whether it's because the event keeps on reevaluating or some crazy FRED cache is flushed..
-
Just number 9 for me, I'm looking forward to the FRED quiz you might pull on the HLP Pub day :nod:
DON'T READ THE LINK IF YOU'RE NOT KARAJOMRA :p
As much as it seems simple, always asume FRED is fickle and if you give it an opening it will take it. Ensure there's no room for error. I'd do it like this...
see link >> http://img137.imageshack.us/my.php?image=q9zu0.png
In answer to your question "Why?????" If FRED expects it to be false, then it will play when it believes nothing has triggered? :nervous: ity just makes sense in my head. I can't express it. TEN years of FREDDING has muddled my brain..
[spoiler/]
-
7- You have the threshold set above 0
8- Everytime events are immediate set back to incomplete so the chained event will not fire. Was really expecting the special explosion taking too long do to lack of kamikaze scenario when you said explosion takes half the screen.
9- Same reason as 8. If a mines does go off the event fires then goes back to incomplete. Incomplete events are changed to false at mission end.
-
7.
The treshold
8. No idea.
9. An event is not "true" or "false" at the end of a mission, it is either "complete" or "incomplete".
-
Q. 7
You propably set a wing threshold to 1
Q. 8 and 9
I think, that in both these cases the problem is with the "every-time-argument" conditionals. You only have to trigger the minefield once, and when you set up every-time conditionals it turns incomplete right after it gets true. You also don`t have to set "event-true-delay" cause it`s already chained.
-
DON'T READ THE LINK IF YOU'RE NOT KARAJOMRA :p
Uh, Colonel, just disable the URL, then. :wtf:
-
Just ignore it...... :p
-
so?? how did it go??
It's friday yeahhh! I wanna know the answers (specially the one on easy)! ^^
-
I've been rather busy this week and I didn't want to post the answers till I had the next set of questions ready. But since it's taken so long. :)
Question 7 - Answer
I've accidentally set the wave threshold above 0 (In this case it's set to 1). The game checks the wave threshold to know when to send in the next wing. By default the threshold is set to 0 meaning that there must be 0 ships left in the current wave before the next one will arrive (i.e the wave must have been destroyed).
In this case the threshold was set to 1. Wave 2 appeared as soon as only Cancer 2 was left. When that happened a second time (Taking out Cancer 4,5 and 6) Wave 3 appeared leaving me with the ships I finally noticed.
Question 8 - Answer
As most of you guessed every-time and every-time-argument will never evaluate to true or false during a mission. The SEXP executes normally but the last thing it does is to flush the SEXP tree clean. That means it is always incomplete during a mission. Since a chain is basically the same as is-event-true-delay the chained event will never occur.
The is-event-true-delay in the second event was a complete red herring BTW. :D
Question 9 - Answer
Closely related to question 8. At the end of a mission the game marks any events which are incomplete as false. So no matter how many times an event using every-time repeats the debriefing will always be marked false.
I'll try to post the next set of questions later tonight or tomorrow.
-
Question 10 - (Easy) Intermediate
In my mission I want the player to destroy a Shivan Cain class cruiser while protecting a Fenris. I created this event for it but it never plays the message. What have I done wrong?
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question10.jpg)
Question 11 - Advanced
In a mission I'm making I wanted to simulate a repair crew running around the halls of an abandoned Fenris bringing the systems online one by one. The idea was that the crew would repair each subsystem and then move on to the next. I damaged all the subsystems of the Fenris initially and then added this event (Lots of repeats on the event and a delay between repeats of 1 second)
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question11a.jpg)
Here's the repair bit in more detail
(http://homepage.ntlworld.com/karajorma/FAQ/Fred-Quiz/Question11b.jpg)
But it's not working. Only one of the turrets is being repaired. When it reaches 100% nothing happens. I decided that most likely in-sequence is to blame for the problem and I swapped that to random-of (keeping everything else the same). While not as good I figured I could pass this off as several crews working at the same time. I loaded up Freespace, ran the mission and I saw the same turret being repaired (and none of the others were). After swearing a lot I logged onto HLP to ask people what i did wrong both times.
So why are both events failing?
-
All too easy........
10-First theres the use of that dang and-in-sequence (being the evil monster that it is). The actual culprit is that second part is true as soon as the mission stats (assuming the Fenris is there) so it will never happen in sequence.
11-You never invalidate argument or whatever it's called so it never moves to the next one.
-
I think I got the first one.... the problem seems to be that is-destroyed-delay will never work in an AND just because it only turns true or false if the cruiser gets destroyed or it departs. (well if the cruiser departs after destroying the Cain it might work i guess)
-
Question 10: Why use "and-in-sequence"? Maybe you should just use "and" instead.
-
ten
Assuming the Fenris is present before the Cain is destroyed, that part will be true instantly, and thus not be in the correct sequence.
eleven
Not too much of an idea, so I'm going to have to make some 'educated conjectures'. Noting how sneaky "every-time" and "is-event-true" work together, I'm going to guess that there's something weird with the repeats here as well. Furthermore, I'm going to assume that the <arguments> are like variables, with semi-permanent values. Given my previous coding "experience", I'm going to guess that you need to tell FRED to stop using a specific argument, because you only have one actual "argument" to evaluate. Why FRED wouldn't do that automatically at the end of the SEXP doesn't really make sense, though.
-
Question 10: Why use "and-in-sequence"? Maybe you should just use "and" instead.
That'd return the Fenris true instantly rather than checking the Cain was dead first.
10. I have a feeling there's a stage missing here, and the not needs to be preceded by something...but I'm not sure what.
11. As I would never handle that set of circumstances in that fashion, I haven't got a damn clue.
-
10:
and-in-sequence breaks horribly if the sequence is broken. And as many people know, not is-destroyed-delay likes to fire off at arrival of your ship. :p
11:
Well in-sequence needs an invalidate-argument in order to actually move on to the next one.
However, random-of sounds like it would work, except that if its anything like the rand function in FRED, it will return the same random result even if its called multiple times. You need to use the random-multiple-of (like you would use rand-multiple if you needed truely random results)
-
10
The 'not' on the Fenris triggers before the is-destroyed-delay on the Cain.
11 Dunno.
-
10.
I think you need a AND argument insted of And-in-sequnce. I remember that working for me with the exact same SEXP.
Alternatively, you can have the Fenris jump out if the Cain is destroyed and simply check if he jumped out.[/spolier]
11.
dunno really.
-
10.
[spolier]
I think you need a AND argument insted of And-in-sequnce. I remember that working for me with the exact same SEXP.
Alternatively, you can have the Fenris jump out if the Cain is destroyed and simply check if he jumped out.[/spolier]
11.
dunno really.
Are the italicised bolded sections deliberate? :nervous:
-
friggin typo...fixed..Fix your post and remove that too.
-
I was thinking, "Man, a mod sure could fix that...
OH WAIT!"
And the I dunnos for 11 show that people need to learn to use arguments. :p C'mon if you can use variables, conditional arguments aren't that much harder.
-
Question 10 - Answer
This one is a classic that's popped up a few times on this board. In fact I got the idea for this question when I looked through some very old posts and saw Trashman having almost the exact same problem. :)
The answer is that at the start of the mission the Fenris isn't destroyed so that part of the SEXP comes true instantly. Using And instead of And-in-sequence is the correct answer here.
And-in-sequence is a powerful SEXP but most people have made mistakes like the above and become wary of using it. But that's one more reason I said it's good to get rid of superstition. Better to know why your attempt to use and-in-sequence didn't work than to avoid using the "cursed" SEXP. :D
Question 11 - Answer
I was a little nasty with this one as it's actually two questions in one. Quite a few got it correct as to why the use of in-sequence wasn't working but less people understood why random-of hadn't worked and thought it was the same issue.
The in-sequence SEXP won't move onto the next argument in the list until the one it is currently dealing with has been invalidated. Since this wasn't happening the event would keep repairing turret01 forever. What you need is something like this
(http://homepage.ntlworld.com/karajorma/Misc-Pics/Invalidate-In-When.jpg)
Unfortunately that crashes almost any build of FS2_Open since they don't have the fix I added to SVN last night (It's in this build (http://www.hard-light.net/forums/index.php/topic,55838.0.html)). But since there is a more complicated way to make that work with even 3.6.9 (using variables to pass the argument to the inner when) I considered it a fair question.
As for using Random-of I'll give everyone an extra day to go back and see if they can figure out what's wrong there. :)
-
No new questions? :P
-
Not until I get a few more people trying to puzzle out the second half of the last one. :p
Seriously though, I should have some new ones later this week.
-
Couldn't it also break due to hits-left-subsystem and turrets?
random-of returns the same argument every time it's called. You would need to use random-multiple-of and something to check that the turret hasn't been repaired once in case it could be damaged again.
-
Couldn't it also break due to hits-left-subsystem and turrets?
It's got the optional 3rd argument to prevent that. :D After warning people of that gotcha I'd look rather silly if I did it myself in the same thread. :D
-
Yea I remember seeing that when you first posted the question now. My beer level must be low.
-
And the I dunnos for 11 show that people need to learn to use arguments. :p C'mon if you can use variables, conditional arguments aren't that much harder.
Pfffft, like I said, I wouldn't ever handle it that way. :p
-
Bah i'm on my phone i can't see the questions. I'll try in the morning.
Fubar, what's the BDHR for? Another acronym or old squad tags? Dunno why i'm asking, just curious.
-
Dunno why i'm asking, just curious.
I believe that's the reason why you're asking.
-
Fubar, what's the BDHR for? Another acronym or old squad tags? Dunno why i'm asking, just curious.
Way off topic but since it already got a Goober response it stands for Beer Drinking Hell Raisers. Yes it's a Squadwar squad and were still around although most don't play anymore. Trying to fix that.
http://www.165thbdhr.com/
-
Cool, *it must be nice to still have an active squad :sigh:*
I hope Big-K has got a load more questions coming soon. For this, and the London meet. I love spying eavesdroppers thinking wtfbbq? when the earhole in on us :lol:
-
I hope Big-K has got a load more questions coming soon. For this, and the London meet.
Damn you and your far away meetings. :fistshake:
Drink one (or ten) for me.