Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: bomb3rman on October 21, 2016, 06:07:49 am
-
Let's say a bonus goal was achieved in mission 1 and this means that the "bonus" is an additional ship in the next mission:
Do I have to use the branches in the campaign editor to make 2 missions (which are technically the same, but 2a has the ship in the hangar to choose from and 2b has not) or is there another way?
-
Nope. Use the allow-ship sexp.
-
Let's say a bonus goal was achieved in mission 1 and this means that the "bonus" is an additional ship in the next mission:
What do you mean with "an additional ship"? Is it an additional ship choice in the load-out or will an additional AI controlled ship arrive/be present in the mission?
Either way however you will not need a 2nd mission file...
-
(sry for double post)
In case A (additional ship choice in the loadout) you can follow the route which mjn.mixael was pointed out: In Mission 1 create an event that turns true when the bonus objective becomes true (e.g. with the "is-goal-true-delay"-operator found in the "events and goals"-category of the menu), as effect replace the "do-nothing" with "allow-ship" and enter the required data. In Mission 2 you can then add the ship to the load-out as normal. However when creating the campaign file in campaign editor do not add said ship to list of ships allowed by default.
When testing the missions file by file there will be no noticable change only once they are strung together as a campaign (which is one of the last things you should do, because as soon as there is a campaign file you can no longer test the missions one by one).
In case B (an additional NPC ship appears) you simply have to set said ships arrival cue in Mission 2 with "previous-goal-true-delay". That one is a bit tricky as you have to manually set the data for that SEXP and FRED will not warn you of input errors. On the bright side for the purposes of testing the optional 4th argument to that SEXP allows you to set a default state (true or false) that the game will reference unless the mission is played as part of campaign that includes Mission 1.
-
I just needed the case with an additional ship choice in the loadout, but the other one is good to know as well! Ask one, get one free :lol: :lol:
Thx guys, this helped a lot!
-
Make that two free. :D
There's also a Case C which is similar to Case A. You aren't limited to only allowing the ship to be available after the bonus goal. Suppose the player has already flown an Ares in the campaign at some point but can't fly them in the mission after the bonus goal unless they achieve the bonus. In this case you can't simply use allow-ship since that SEXP enables the ship to be used in any mission for the rest of the campaign so it must have already been used to enable the player to fly an Ares in the earlier mission.
What you can do is set a persistent variable called say NumberOfAres in mission 1 and then in mission 2 in the loadout editor you'd set the number of Ares in loadout to equal NumberOfAres. If the variable is set to 0, the Ares will not be available.
-
Semi-related: what's the purpose of the allow-ship sexp when you can just control what ships are available per-mission using the loadout editor? Why not make all ships available, but default to 0 unless configured in FRED?
-
So that you can dynamically add/remove ships from the loadout based on the events of previous missions.
-
Also so you can hide Easter Eggs in your campaigns :D
My Drums of War-campaigns for The Babylon Project each have an Easer Egg that allows you to fly the Shadow fighters in most missions once it is triggered. Shadow Fighters are by design hiddiculously overpowered for every single mission.
-
Semi-related: what's the purpose of the allow-ship sexp when you can just control what ships are available per-mission using the loadout editor? Why not make all ships available, but default to 0 unless configured in FRED?
The loadout variable stuff was added by me. So until I did it you only had the allow-ship SEXP. If you wanted to allow a bonus ship, it was your only option. You can see the way it was used in the main FS2 campaign to enable the Ares.
-
Man, there is so much good stuff in FSO I take for granted since I never reallty fredded on retail. Good to know - thanks for putting that in there! Super useful feature :)
-
Also so you can hide Easter Eggs in your campaigns :D
My Drums of War-campaigns for The Babylon Project each have an Easer Egg that allows you to fly the Shadow fighters in most missions once it is triggered. Shadow Fighters are by design hiddiculously overpowered for every single mission.
Yeah, kill all Centauri transports before they reach the station. I discovered it a while ago :D (And, to be honest, it inspired me to use something like this in my own campaign ;) ) Though my bonus ship won't be that overpowered, but it was fun to play with the shadow fighters :lol:
and @ karajorma/buff skeleton: the default to 0 way might also be interesting, thx! :)
-
Man, there is so much good stuff in FSO I take for granted since I never reallty fredded on retail. Good to know - thanks for putting that in there! Super useful feature :)
By this point about half of the features in FRED are SCP additions. A great example of how much has changed is the Misc Ship Properties dialog.
Retail
(http://fredzone.hard-light.net/freddocs/additional-ship-properties.gif)
SCP
(http://diaspora.fs2downloads.com/FREDDocs/editor_ships_flags.png)
And that's an old pic. There are probably a few new ones. You might also want to take a look at the ridiculously small number of SEXPs (http://fredzone.hard-light.net/freddocs/SEXP.html#operators) retail had to work with.
Conditional
There is only one operator in this group, when. It is the top-level operator in most events ("When this happens, do these things"), and returns a boolean value.
Imagine having to do everything with only the when operator!
-
No When-Argument?! SAY IT WASN'T SO!