Author Topic: Fred help!  (Read 3848 times)

0 Members and 1 Guest are viewing this topic.

Offline bolero

  • 23
hey guys, im fairly new to fred but not completly lost.  Its alot of fun.  However i have a few questions as i am stuck.
Im creating a mission where you have 2 friendly ships disabled and must protect them.  After a while command warps in 2 repair ships, for which you must protect those as well.  How ever, if any one of those ships (the 2 friendlies and the 2 repair) get destroyed, mission is over and you must return to base.  How would i go about scripting that?  im going to fiddle with it now but any help would be great!

-Bolero

 

Offline Shade

  • 211
Something like this should work (Requires SCP for new sexps):

op when-argument
     op any-of
          ship_1
          ship_2
          ship_3
          ship_4
     op is-destroyed-delay
          0
          <argument>
     op do-nothing (or whatever you might want to happen such as messages etc.)

[chained, with RTB directive text]
op when
     op has-departed-delay
          0
          player_ship
     op do-nothing
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 Petrarch of the VBB

  • Koala-monkey
  • 211
There's an any-of sexp now?

*punches the air*
Woo!

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
:welcome:

Can't belive no one did this...


Ok, the little paragraph I think is like this:

Welcome to the HLP station. There are exits to the left and right. THere are flamethrowers under the seats, but we ran out of napalm so they are filled with water instead. There are also plasma cannons in a locker, but only some people can get them.
I forget the rest...



 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Shade's solution is correct but personally I probably wouldn't use any-of for this one. I'd do it like this

When
-Percentage-ships-destroyed
--1
--ship_1
--ship_2
--ship_3
--ship_4
-do-nothing

There's nothing actually wrong with Shade's solution and I'm pleased as hell to see people using the new conditionals but this one doesn't use as many SEXP nodes. :D

It also has the advantage of working in retail :)


@Petrarch : There are also every-of, number-of and random-of SEXPs and I added a new one to the set today called in-sequence which allows you to work your way down a list.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline bolero

  • 23
Wow thanks guys. I tried shades way and it worked great.
-Bolero

 

Offline Nuclear1

  • 211
When
-Percentage-ships-destroyed
--1
--ship_1
--ship_2
--ship_3
--ship_4
-do-nothing

That works, too, but when I saw this initially I thought of using variables. Your answer's the quickest and easiest though. :)
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!

 

Offline bolero

  • 23
another question guys, hopefully this gets noticed.  Its a question with the compaign editor.  Anyways ill basicaly sum up what i want to do with one o the missions im doing.  Basicaly, you get thrown out of subspace and end up lost in a nebulea and find two disabled ships that require your help, so this wasnt really part of commands orders, but you help them anyways and then return to command.  However since this wasnot a missionfrom command, and not critical if you fail i want two possible paths to go.  For instance, if you sucesfully defend the ships your next mission will have these ships in there. how ever if you fail to defend those ships, the next mission you go to will not have them in there.  Either way you cant fail the mission per say, you will always be able to go on, but the outcome will be different for the nextmission.  I know i would have to make 2 different versions of the same mission, but im just wondering if it is able to set this up in the compaign editor?
hopefully you all understand lol Thanks for your help!

-Bolero

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
First up there are several ways you can avoid making two different missions. You may find it easier to do things that way depending on how complex the mission is but that's your choice :)

You can

a) Set a persistant variable and then check it's value in the next mission. (Look in the FRED section of my FAQ if you don't know what a persistant variable is).
b) use the is-previous-event\goal-true\false SEXPs to check whether the ships in the previous mission were saved or not.

If you do decide to go with two different versions then that is fairly simple too. Simply do something like this.

is-previous-goal-true
-Mission 1
-Ships Saved
-Mission 2a

true
mission2b

Now if the ships are saved and the save ships goal comes true you go to mission 2a. Otherwise you go to mission 2b.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline bolero

  • 23
Thanks for the reply :)

However i seem to be confused how the is-previous-goal-true event will work for this situation.  Would i add this event in the mission where your saving the ships, or in the 2 possible missions after that?

thanks again :)

-Bolero

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
You could use the is-previous-goal-true in the campaign editor when connected the two missions together if you wanted to have two different missions.

 You could also use it in the second mission. If you set the arrival cue for the two cruisers to something using is-previous-goal-true then they will only appear in the mission if the were saved in the previous one.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline bolero

  • 23
whoa wow that is cool, ill try these methods out! Thanks alot!
-Bolero

 

Offline Shade

  • 211
For best effect, also store the hull integrity of the ships in a persistant variable just as the mission terminates and then set them to the proper value in the following mission. After all, ships don't magically mend all damage in the space of 10 minutes just because they made a subspace jump ;) Poor man's Red Alert really, just without the red alert.
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 bolero

  • 23
oh yeah i didnt know you could do that.  So You can take the Hull integrity of ships from a mission into the next? because i have a mission where you dont return to base at all, you just get dropped out of subspace to another mission so that would be cool having alpha wings last hull % into the next mission. Hmm ill have to try and figure that out too! Wow this is so cool.

-bolero

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
If you want to have Alpha 1 just drop out of subspace you should do it via a red alert mission so that the condition of the players subsystems and weapon quantities remain the same. Those things can all be set by SEXPs but it's a bit of a pain to do all of them.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline bolero

  • 23
Hey guys iv encouirted some weird bug in my campaign/missions.  Anyways, the one mission you play in, you are INSIDE subspace. Once you leave subspace it goes to the next mission which is checked off as a "red alert" mission, so it just drops you right out there so like Karajorma said; will have the condition of the player brought to the red alert mission.  Once you start the mission though, The player and Alpha wing are suddenly different class ships with different weapons and im not sure why? Any ideas?
Thanks!

-Bolero

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Did you tick the red alert carry status box in the first mission for any ships you want to appear in both missions? If not that's my bad. Should have warned you to do that :) You'll find it in ships editor >> Misc.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline bolero

  • 23
Hey thanks, that worked, however, now the players status doesnt carry over.   I set "red alert carry status" on my alpha wing and the players ship in the mission before the red alert mission, however the status doesnt get carried over.  Not sure whats going on

-Bolero