Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Lucika on March 06, 2011, 06:59:51 am
-
I remember something like that being done in FS1 where either the Hope or the Pinnacle would show up, depending if the former survived an earlier engagement or not. However, if I am not mistaken, that mission was neither the follow-up one nor the red alert.
The situation is this: depending if a cruiser survived an engagement in a mission or not, it will show up three or four missions later. Is that possible? Am I supposed to set this up in the campaign editor later on or what is the correct method of doing this?
-
You don't need the campaign editor for this.
Just go to Ship Editor --> Arrival Cues and use is-previous-goal-true or -is-previous-event-true (or *-false). Say, you have a "GTC Polaski destroyed" event in mission 1. If you want the Polaski to appear in mission 3, then the GTC Polaski's arrival cue in mission 3 should look like this:
is-previous-event-false
-mission 1.fs2
-GTC Polaski destroyed
Plus add No Warp Effect and No Arrival Music.
-
Campaign persistent variables. Create a variable called "cruiser_died" or whatever you want, and set it's default value to 0. Make sure the variable is marked as campaign persistent. Create an event that, if the cruiser is destroyed, sets the variable to 1. For example
Cruiser Check
-when
--is-destroyed-delay
---0
---*cruiser name*
--modify-variable
---cruiser_died(0)
---1
Now, in the later mission where you want the cruiser to reappear, create a variable with the same name as the first and mark it as campaign persistent also. Default value can be anything, doesnt matter, because the value will carry over from whatever it was set to in the first mission, but just set default value to 0 anyway to be safe. Then, create the cruiser, and in its arrival cue, add
-=
--cruiser_died(0)
--0
That way, the ship will only arrive if the variable is equal to zero (plus whatever additional conditions you have set for it). You can use additional variables if you want to store hull integrity and such. Hope this helps.
-
A waste of campaign persistent variable slots if you're not going to store the HP or something. Don't bother.
Just use is-previous-event-true/false. Much quicker to set up and less prone to **** up.
-
Yep. DJ's solution is worth it if you want to actually pass some information over using the variable. But if you're only passing a true/false then it's a waste of a variable (and you only have 100 to play with for each mission remember!).
-
but then it easy to use a HP variable in this manner and it would allow you to carry over any hull damage as well, not only that but if it is an optional ship you can set the arrival que to say that if this value is below say 30%then the cruiser still don't arrive
-
Yes, if you're actually passing info over, it's worth it.
-
:yes: Thank you all.
While we're at it:
Mission 1 -> red-alert -> Mission 2 -> normal -> Mission 3 (which carries over variables)
is it possible to allow the player to replay the previous mission despite this one not being a red-alert one?
-
Mission 1 -> red-alert -> Mission 2 -> normal -> Mission 3 (which carries over variables)
is it possible to allow the player to replay the previous mission despite this one not being a red-alert one?
:bump:
-
With a properly set up campaign file, yes. Note that you'll have to set up the campaign file manually, as the campaign editor UI isn't set up to support links going backwards.
-
...and how would the player see that? I presume there is no special pop-up saying "You can replay the mission before the last mission".
-
If I understand you correctly, you want the player to have the option of replaying the mission labeled "2", right?
Basically, what you do is this. If the player is restarting Mission 3 (which you can track through clever use of campaign-persistant variables), you can pop up a training message saying something like "Do you want to replay the mission leading up to this?" If the player answers in the affirmative, you can then set a hidden goal to true, and end-mission right there. Write a debrief saying "To play mission 2, hit the accept button".
Behind the scenes, what you do is to set up the campaign file so that you have one of mission 3's branches go to mission 2 if said hidden goal is true.
(Be aware that this is just something I _think_ should work, not something I have tested. Implement at your own risk)
-
I see. Thank you, I will test it soon.
-
You could also use the loop option in the campaign editor to do it. I think that one is probably a little more professional looking.
-
Can I use that without the missions actually being part of a loop?
-
You should be able to. Not 100% certain. It's something you'd have to look into.