Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Phoenova on June 23, 2008, 12:03:24 am

Title: Some questions
Post by: Phoenova on June 23, 2008, 12:03:24 am
Ok so, Im making a couple missions for a friend of mine, and I had a few questions on how to do some certain things.  Sorry if I have missed some of these, but my 56k browsing is getting annoying.

-If possible, how do you make capships attack another capships engines/subsystems?  Example, 2 cruisers attacking each of a Ravana's engine subsystem.

-Is there any way to edit the range or fire rate of weapons without editing tables?  I want to have a ship fire rapidly and far away at another with a beam, and for story purposes, overload and explode (or at least have a couple subsystems explode)

(If the above is possible, my next question is there any way to get the faint EM signature of an invisible far away target to completely disappear?  For planatery bombardments and the like)

-Has fred been changed in the way you can type stuff in?  I cant manage to type in different commands to replace true or do-nothing, but I can right click and select them just fine.

-Would a battle between 2 destroyers and 2 cruisers with like 4 wings of fighters each be too Battle of Endor-ish?  :lol:

Thanks in advance for the help, and sorry if I couldnt find the answers to these questions, but searching got me like 3 answers so far and 56k+hours of surfing=friend egg brain.
Title: Re: Some questions
Post by: FUBAR-BDHR on June 23, 2008, 12:15:17 am
Ok so, Im making a couple missions for a friend of mine, and I had a few questions on how to do some certain things.  Sorry if I have missed some of these, but my 56k browsing is getting annoying.

-If possible, how do you make capships attack another capships engines/subsystems?  Example, 2 cruisers attacking each of a Ravana's engine subsystem.

First you need to have the cruisers in position of one of the cruisers beams.  Turn on show ship models to see where the weapons fire some of them are a bit tricky.   Then you can use the fire-beam sexp to fire the beam at the specific subsystem. 

-Is there any way to edit the range or fire rate of weapons without editing tables?  I want to have a ship fire rapidly and far away at another with a beam, and for story purposes, overload and explode (or at least have a couple subsystems explode)

In the ship editor under weapons you can give it a longer range beam with more power.  Give more than one turret that can hit the target the same beam and alternate the firing between them.  Then when it fires the last shot self-destruct the ship or sabotage the subsystem.  Other than that not really.  See the multiplayer mission blockade run for a good example. 

(If the above is possible, my next question is there any way to get the faint EM signature of an invisible far away target to completely disappear?  For planatery bombardments and the like)

set-max-radar range sexp
 
-Has fred been changed in the way you can type stuff in?  I cant manage to type in different commands to replace true or do-nothing, but I can right click and select them just fine.

For a few things yes but for the most part you will just want to use the right click and select. 

-Would a battle between 2 destroyers and 2 cruisers with like 4 wings of fighters each be too Battle of Endor-ish?  :lol:

Heck no. 

Thanks in advance for the help, and sorry if I couldnt find the answers to these questions, but searching got me like 3 answers so far and 56k+hours of surfing=friend egg brain.

No prob. 
Title: Re: Some questions
Post by: Phoenova on June 23, 2008, 12:38:30 am
Hey cool, thanks for the quick reply, that helped out a lot.  For the fire-beam sexp, is there a way to make it repeatable, ie, have it continue until the specific subsystem is destroyed?  I didnt beam-free-all the ships, so them only firing once might be explained by that.  Also, for the weapons editor in ships, is replacing an sgreen with a bgreen the best I can do, or is there some range editor that Im missing?  :P

On a side note, is there something...wrong with the Ravana?  The bases of the engine glows are about 50 meters back from the ship, as well as the 2 engine subsystems.  Because of this, theres no way to shoot at the engine subsystems.  Might have to pull out the old Demon for this!
Title: Re: Some questions
Post by: FUBAR-BDHR on June 23, 2008, 01:25:22 pm
For the first part there is are repeat and delay fields in the event editor.  Just highlight the event you want to repeat and fill those in.  With beams you will either need to look at the tables or experiment as their ability to fire again is based on not only the fire time but the warm up and down times.  Distance is fixed so the best you can do is pick the longest range weapon.  Beams will actually draw farther then their distance so theoretically you could put a target ship closer along the same path, fire at it, and fake the damage but getting the beam to hit with any consistency would most likely be impossible. 

Not sure on part 2.  What build and media files are you using?
Title: Re: Some questions
Post by: Phoenova on June 23, 2008, 07:54:17 pm
Im using the 3.6.10 beta media VPs, and build fs2_open_3_6_10-Xt_0314 (copied and pasted :P)  And thanks for the info on the repeat thing, I seriously cant believe Ive never seen that.  Theoretically, would a has-time-elapsed and ship-vanish combo work and still be attackable by beams?
Title: Re: Some questions
Post by: FUBAR-BDHR on June 24, 2008, 01:13:18 pm
Not sure.  Try it.  I've played with putting a stelathy small ship at very large coordinates, moving it to the desired coordinates, firing, then moving it back to the coordinates that are out of radar range.  Seems to work. 
Title: Re: Some questions
Post by: tinfoil on June 24, 2008, 04:41:41 pm
Come to think about it are there any campaigns with planetary bombardment?
Title: Re: Some questions
Post by: Phoenova on June 24, 2008, 09:38:40 pm
I have yet to play one, but I think Ive seen a campaign with a planetary cannon.

Anyway, one more question:  How in the heck to do you add objectives for the in game menu?  I used to be able to, but I guess its not like riding a bike.  I tried

-when
--is-destroyed-delay
---0
---Destroyer
-validate-goal
--(goal name)

Anyway, I tried putting that in both the events and objectives manager, and no success in making the goal appear in mission.  Any suggestions?

Edit: I keep asking questions, and I think this might be the last one  :p  How do you make it so that a ship with the same name can appear twice in the same mission (warping out and appearing later on)?
Title: Re: Some questions
Post by: FUBAR-BDHR on June 25, 2008, 12:05:12 am
First one you is dependent on if you want the objective to show up in the mission objective in the briefing.  Either way you need to define it in the mission objectives.  If you want it to show up in the briefing then really all you need to do is base it on what you want to happen like is-destroyed-delay <ship>  or is-event-true-delay <event>  If you don't want it to show up in the briefing then you need to use the validate-goal sexp somewhere before the goal becomes true.  For instance if the goal is based on a ship being destroyed you would have one event with when->has-arrived-delay <ship> validate-goal <goal>  Then either have the event base on is-destroyed-delay <ship> or on is-event-true-delay <event that becomes true when the ship is killed>

The same name ship thing is done using special characters.  You need to add a character that can't be seen to the name of one of the ships.  I usually use notepad to find it in another mission the copy it because I can never remember what it is. 
Title: Re: Some questions
Post by: karajorma on June 25, 2008, 02:48:59 am
Here's the explanation from my FAQ on why you'd validate/invalidate a goal.

Quote
What is an invalid objective and how does that differ from a bonus objective?

When making objectives in the objective editor you may have noticed the little Objective Invalid tick box and wondered what it does. To explain let's take an example mission. Suppose you're FREDding a mission where you're going to destroy a Moloch corvette. When the mission starts however you find the Moloch taking on supplies from a Demon class destroyer. Command order you to ignore the Moloch for now and concentrate on the demon. Now look at your objectives. Having the destruction of the moloch as a primary goal while the destruction of the demon is a bonus seems ludicrous. In addition to this the Destroy Demon objective will only appear on the objectives list after you have destroyed it.

This is where invalid objectives come into their own. The game completely ignores the objective until an event using the validate-goal SEXP is triggered. After this the game treats the goal normally. So basically you've suddenly made a Destroy Demon primary goal appear as if by magic.

Goal validation doesn't end there though. Just as you can validate goals you can also invalidate them. For instance at the moment destroying the demon and the Moloch are both primary goals. If you fail to kill the Moloch you won't get the full victory music even though you did better than the mission briefing expected of you. What you can do in this case is use the invalidate-goal SEXP to make the Destroy Moloch goal invalid. The game will now ignore it.
If you're really sneaky you can even have an invalid Destroy Moloch secondary goal as well as a primary one. Invalidating the primary while making the secondary valid will make it look like the Moloch's destruction has changed from being a primary goal to being a secondary one.

It's worth noting that bonus goals can also be invalid too. You could have a Destroy Cain bonus which only becomes valid once the Moloch and Demon have been destroyed or have departed.



As for special character, newer SVN builds will ignore everything after a # in a ships name. So if you want a duplicate of the GTCv Warspite you'd add a ship called the GTCv Warspite#Returns or something. This only works in newer 3.6.10 builds. The older trick is to use non-printing characters as FUBAR suggested. So you'd have the Warspite and the WarspiteƉ for instance. Problem is that if we ever add proper font support to the game that trick will stop working.
Title: Re: Some questions
Post by: FreeSpaceFreak on June 25, 2008, 04:16:26 am
But that last problem solves itself, since it will be in a newer build with # support :p
Title: Re: Some questions
Post by: karajorma on June 25, 2008, 05:09:56 am
No it doesn't. If you have used the old method you'll have to edit your missions to fix them before it works. And if you're planning on doing that you might as well simply do it the correct way now.
Title: Re: Some questions
Post by: Phoenova on June 25, 2008, 07:57:14 pm
Ok, sorry if Im bugging anyone, but I cant seem to get any objectives to show up in mission  :( In mission objectives, I made an is-destroyed-delay event for when the destroyer is gone, and as a second event I put

when
-has-time-elapsed
--0
-validate-goal
--(goal)

and when I go to save it, it says that when is an error.  I cant seem to find anything of help to creating objectives in the wiki (the invalid objectives was the closest I could get)
Title: Re: Some questions
Post by: Stormkeeper on June 25, 2008, 08:06:14 pm
Whats the error ? As in, what does the error screen tell you?
Title: Re: Some questions
Post by: Phoenova on June 25, 2008, 08:13:07 pm
Error in mission goal (goal2): Arguement type mismatch

In sexpression:(when
   (has-time-elapsed 0)
   (validate-goal "goal")
)
(Error appears to be: when)

Note: Those arent the actual names of the goals, but just to help identify where they are.

Edit: The original goal is:

is-destroyed-delay
-0
-Destroyer
Title: Re: Some questions
Post by: FUBAR-BDHR on June 25, 2008, 09:18:43 pm
I think you might be mixing up goals which are defined in the mission objective editor and directive which are just events with directive text.  If you just want a directive to show up on the left hand side of the hud you would just have an event (lets call it destroyed dead)as follows:

when
-->is-destroyed-delay
---->0
---->destroyer

Add directive text Destroyer destroyer to that.

Now if you want an actual goal based on that event you would go into the mission objectives editor and create a goal with the following (lets call this one win)

-->is-event-true-delay
---->1
---->destroyer dead

If you don't want the player to see the goal in the briefing you check the objective invalid box.  Then you would have another event like this

when
-->has-arrived-delay
---->0
---->destroyer
-->validate-goal
-->win


Title: Re: Some questions
Post by: Phoenova on June 25, 2008, 10:51:59 pm
Hmmmm, I think I need to decrease the difficulty of my mission just a tad.  The goal shows up, but I havent gotten far enough into it to actually take down the destroyer  :nervous:

What would an escort goal look like?  I tried a percent lost event, but if you cant tell Im having trouble remembering how to make objectives.  I fear change!

Edit: Some questions turns into omgwtfbbq questions.  I got the escort goals to pop up and fail properly, but they dont turn red when they fail...is this normal?
Title: Re: Some questions
Post by: karajorma on June 26, 2008, 02:11:21 am
As Fubar said you seem to be confusing mission goals (objectives) and directives.

Mission goals are added using the Mission Objectives Editor. They never start with a conditional (like when) and they never use any of the action operators (not even do-nothing). All they are is a trigger.

Mission Directives are a slightly special kind of event. You add events in the Event Editor. Events always start with a conditional (When or Every-Time etc) and always must include an action operator (even if it's do-nothing).


In both cases the conditional part is much the same, you simply set up a trigger that will be true when the goal\directive is succeeds and false if it fails. So if you are making a mission where you must escort a ship until it jumps out you can simply have

has-departed-delay
-0
-Name of ship

If instead you're escorting it to a position in space you're probably using waypoints, in which case this will do.

are-waypoints-done-delay
-Ship's name
-waypoint path
-0
Title: Re: Some questions
Post by: Spicious on June 26, 2008, 08:34:18 am
-If possible, how do you make capships attack another capships engines/subsystems?  Example, 2 cruisers attacking each of a Ravana's engine subsystem.
I was thinking about implementing something to make this sort of thing easier to manage, but I couldn't decide which way to organise it for subsystem targeting.
Title: Re: Some questions
Post by: Phoenova on June 27, 2008, 02:02:14 pm
I was thinking about implementing something to make this sort of thing easier to manage, but I couldn't decide which way to organise it for subsystem targeting.

Perhaps something in initial orders?  There could be a dropdown menu, attack subsystem, then choose which one to attack.

Anyway, the ships that I am escorting arent there at the beginning of the mission, so whenever I make a goal to protect them, it immediately is completed at the beginning of the mission.  Ive tried has-arrived-delay stuff, but it only makes it so the objective is completed when the ships arrive.  I always put an is-event-true sexp in mission objectives, I just cant figure out exactly what event makes this work.  What I come up with either ends up with it completing at the beginning of the mission or not completing/failing at all.
Title: Re: Some questions
Post by: FUBAR-BDHR on June 27, 2008, 04:13:03 pm
What exactly are you trying to do.  It would make it much easier if you gave a series of events you want to happen.  Like ship x which isn't there at the beginning of the mission needs it's subsystems destroyed for goal y to become true and I want a directive z.
Title: Re: Some questions
Post by: karajorma on June 27, 2008, 04:47:26 pm
1) As I said before, for directives and objectives you have to pick a trigger which comes true only when the directive/objective comes true. Quite often you can't do that with a single SEXP and you have to use several AND/OR SEXPs to make it work.

2) For Directives there is a small gotcha you have to watch out for when using is-event-true-delay. You must use the Add Operator option to add the third argument. By default the directive code uses -is-event-true-delay to decide when it should show the directive as well as when it becomes true. This is probably NOT what you want. The third argument allows you to use it only for determining when the directive is completed/failed.
Title: Re: Some questions
Post by: Spicious on June 27, 2008, 11:07:49 pm
It was to be on a per turret basis. It's simple enough to get turrets to prioritise certain ships, but there were two sensible seeming ways of ordering if subsystem targeting were to be included: choose the ship with highest priority that can be hit, then choose the subsystem of highest priority that can be hit on that ship or have a list of pairs of ships and subsystems and do a straight traversal through them picking the first pair that can be hit.
Title: Re: Some questions
Post by: Phoenova on June 27, 2008, 11:13:03 pm
What exactly are you trying to do.  It would make it much easier if you gave a series of events you want to happen.  Like ship x which isn't there at the beginning of the mission needs it's subsystems destroyed for goal y to become true and I want a directive z.

Basically, 2 friendly cruisers warp in mid mission, and the objective is to escort them.  However, how I made the mission is that one automatically gets destroyed.

Thanks for the help Kara and Fubar, and Im sorry I keep coming back here and asking for help  :sigh: So far I have come up with:

when
-has-arrived-delay
--0
--Cruiser1
-and
--has-departed-delay
---0
---Cruiser1
-not
--is-destroyed-delay
---Cruiser1

Which causes the primary directive to fail when put in the mission objectives editor (which is what I want, as I mentioned Cruiser1 gets destroyed).  However, when put in events editor with directive text Protect Cruisers, the text does not show up on my HUD.  I really thought I had it this time too  :rolleyes:  Any suggestions on what I have so far?

Note: Substituting percent-ships-destroyed for is-destroyed-delay does not change anything.
Title: Re: Some questions
Post by: FUBAR-BDHR on June 27, 2008, 11:25:30 pm
Try this:

Event1
When
-->has-arrived-delay
---->1
---->crusier1
-->send-message
---->#command
---->high
---->message1 (make a message name this with whatever just for testing

Event2 (chained to event1 with the directive Protect Cruisers)
When
-->has-departed-delay
---->1
---->crusier1
-->do-nothing

Now in the Mission Objectives editor your goal should be

is-event-true-delay
-->1
-->Event2

Make sure there is some kind of delay (at least one second) from when the cruisers arrive and when the one is destroyed. 


See what that does. 


Title: Re: Some questions
Post by: Stormkeeper on June 27, 2008, 11:40:56 pm
I have a question. What do the "chained" and "chain delay" options in the events editor do?
Title: Re: Some questions
Post by: FUBAR-BDHR on June 27, 2008, 11:57:24 pm
Chained means that the event will not be evaluated until the event it is chained to becomes true.  Chained delay is the delay before it is evaluated. 

Just try to avoid mixing chained and repeating events. 
Title: Re: Some questions
Post by: karajorma on June 28, 2008, 03:02:56 am
A chain is basically the same as

when
-is-event-true-delay
-Chain Delay
-Event Directly Above this one

The advantage of using a chain is that you can instantly see two events are chained together.
Title: Re: Some questions
Post by: Spicious on June 28, 2008, 05:36:20 am
Give this build (http://www.cse.unsw.edu.au/~smcn929/fs2_open.rar) a try. I've made a little sample mission (http://www.cse.unsw.edu.au/~smcn929/turret-subsys test.fs2) for it too. It's a bit clunky to use, but the sexp system doesn't seem very flexible.
Title: Re: Some questions
Post by: Phoenova on June 28, 2008, 05:41:46 pm
See what that does. 

Thought that did it, but the goal wont fail at all, though it shows up fine.  If it helps at all, the ship self destructs, if its been changed that self destructing isnt "destroyed" in a sense.

Downloading that new build now too.
Title: Re: Some questions
Post by: FUBAR-BDHR on June 28, 2008, 09:23:42 pm
Well if that is a problem it's the first I've heard of it.  Try sabotage subsystem hull 101 instead of self-destruct and see what happens.
Title: Re: Some questions
Post by: Phoenova on June 29, 2008, 03:07:27 am
That was no good either, but I figured it out.  The magic formula ended up being:

when
-and
--has-time-elapsed
---82 (this is a few seconds after the cruiser goes boom)
-not
--is-destroyed-delay
---Cruiser1
do-nothing

This is chained to the arrival event of the cruiser.  Happy that it works though  :D

This leads me to another dilemma though...is there a way to get directives to disappear?  Theres a time being in the mission that I want the player to ignore the primary objective, and with the directive still active, there are too many of them on the HUD.  Invalidating-goal doesnt work, or as far as Ive tried.