Author Topic: The Big FRED Quiz  (Read 12886 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
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.
Code: [Select]
[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?




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 ;) )




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?




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?


« Last Edit: August 09, 2008, 02:09:17 am by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Spoiler:
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. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Clarified question 4.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam



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 ;) )




Spoiler:
shouldnt the Kill Rakshasa also evaluate when the corvette arrives so it shows in the directive?
el hombre vicio...

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Spoiler:
shouldnt the Kill Rakshasa also evaluate when the corvette arrives so it shows in the directive?

Spoiler:
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.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Spoiler:

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??

el hombre vicio...

 

Offline Axem

  • 211
Spoiler:
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

 

Offline NGTM-1R

  • I reject your reality and substitute my own
  • 213
  • Syndral Active. 0410.
Spoiler:
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!
"Load sabot. Target Zaku, direct front!"

A Feddie Story

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
one

Spoiler:
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

Spoiler:
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

Spoiler:
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

Spoiler:
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

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Spoiler:
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. :)

Quote
Spoiler:
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)

Spoiler:
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.

Quote
Spoiler:
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).

Spoiler:
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. :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
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 ;) )



       
Spoiler:
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.
Spoiler:
The Ulysses isn't a stealth ship

2. Hard to explain...
Spoiler:
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.
Spoiler:
The distance to the closest ship of Cancer wing triggers the event?

4.
Spoiler:
turret01 is the default turret, but not the one you want to destroy?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
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.



And here is the event that should send a message when the cruiser appears.


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).

Spoiler:
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).


The event which shows the mission is over isn't triggering though. 


The Rakshasa is definitely dead and if I target the Fenris its engines are at 40%. Why isn't my SEXP working?
« Last Edit: August 08, 2008, 03:11:24 pm by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
five

Assuming by "fail to complete the mission" you mean mission one:
Spoiler:
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
Spoiler:
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.

« Last Edit: August 08, 2008, 07:28:30 pm by thesizzler »

 

Offline Shade

  • 211
Insert an "I" between "if" and "target" and it all makes sense.
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Fixed.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Spoiler:
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.
« Last Edit: August 08, 2008, 05:25:13 pm by FUBAR-BDHR »
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

  

Offline NGTM-1R

  • I reject your reality and substitute my own
  • 213
  • Syndral Active. 0410.
Spoiler:
#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.
"Load sabot. Target Zaku, direct front!"

A Feddie Story

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
These are all really good questions. :)  I give this thread a :yes:.

 

Offline Nuclear1

  • 211
Spoiler:
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.
Spoon - I stand in awe by your flawless fredding. Truely, never before have I witnessed such magnificant display of beamz.
Axem -  I don't know what I'll do with my life now. Maybe I'll become a Nun, or take up Macrame. But where ever I go... I will remember you!
Axem - Sorry to post again when I said I was leaving for good, but something was nagging me. I don't want to say it in a way that shames the campaign but I think we can all agree it is actually.. incomplete. It is missing... Voice Acting.
Quanto - I for one would love to lend my beautiful singing voice into this wholesome project.
Nuclear1 - I want a duet.
AndrewofDoom - Make it a trio!