Author Topic: First Attempt at FREDing  (Read 6489 times)

0 Members and 1 Guest are viewing this topic.

Offline AV8R

  • 28
First Attempt at FREDing
So I finally got up the gumption to create a simple scenario in FRED - and I found how un-simple it really is. It seemed like it would be easy but there are so many variables in the SEXP language that you'd have to be a C++ programmer to get things to happen the way you want.

The Scene: A Sathanas is trying to escape to a jump node but a coalition of Terran and Vasudan corvettes intercepts it and attempts to destroy the juggernaut before it reaches the jump node (while I watch in a stealth fighter).

The problem: I can't get the Sathanas to move toward the jump node, even though I set the speed at 10 in the editor - it starts at 0 and stays at 0. If I give it an initial command to warp out after 900 seconds (15 minutes) it either jumps out immediately or never jumps.

What am I doing wrong?   :banghead:

 

Offline Axem

  • 211
Re: First Attempt at FREDing
Have you tried the FRED2 walk-through? It should explain the concepts you're trying to execute here.

 

Offline redsniper

  • 211
  • Aim for the Top!
Re: First Attempt at FREDing
Do the FRED walkthrough.
Use waypoints.
beam-free-all
"Think about nice things not unhappy things.
The future makes happy, if you make it yourself.
No war; think about happy things."   -WouterSmitssm

Hard Light Productions:
"...this conversation is pointlessly confrontational."

 

Offline AV8R

  • 28
Re: First Attempt at FREDing
If you're talking about the web-based walk-through in the Help menu, it was little help to the layman. Talk of SEXP dependencies with little or no examples and most of the variables greyed-out in the menu make it difficult to comprehend. Based on the information in the Advanced Walk-Though, I still can't figure out how to make/construct a waypoint or series of waypoints.

There has to be an easier way.   :confused:

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: First Attempt at FREDing
Select way point from the drop down menu, drop it on the grid the same way you'd put down a ship (aka, holding down ctrl). Any nav point you drop after you have one selected will create a path. Then in the ship editor, give your sathanas the order to follow a nav point once.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline AV8R

  • 28
Re: First Attempt at FREDing
So I would have to create 2 waypoints? One by the Sathanas and another in the Jump Node so the Sathanas will follow it? I saw in the documentation something about using the Jump Node as a waypoint but couldn't figure out how to do that. I tried to find it, but there was no easy way to tell the Sathanas "Go to the Jump Node and warp out".  :D

The problem with the design I chose is the Sathanas is 7500m away pointing at 90 degrees from the player's entry point. The Jump Node is 7500m Z and 10,000m X from the player. This means the Sathanas has to travel 10,000 on a perpendicular course from the player to reach it's goal. And while I can drop a waypoint close to the player's entry point, I found no way to edit it once it's on the grid so it is within the Jump Node - unlike editing ship locations which is quite easy.

I'm just not getting it with these waypoints.  :sigh:

 

Offline niffiwan

  • 211
  • Eluder Class
Re: First Attempt at FREDing
I think you just need a single waypoint located at the jump node. Then give the Sathanas initial orders of "ai-waypoints-once" with the waypoint as the argument

(ps, I'm not sure how to move a waypoint after its been placed either.. but I've hardly used FRED and have done most of my mission "creation" with a text editor)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: First Attempt at FREDing
You don't need to move the waypoint for this. All you need to do is this.

1. Place a waypoint in or near the jump node.
2. Give the sathanas ai-waypoints-once orders
3. Create a SEXP that measures the distance between the waypoint (or the jump node) and the Sathanas, and tells it to ai-warpout once it gets that close. (Or you could ignore the ai-warpout and simply make that the departure cue for the sathanas).

That should be all you need to do in order to make the Sathanas move towards the jump node and jump out once it gets there.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline AV8R

  • 28
Re: First Attempt at FREDing
Ok, I got step 1 down (I created a waypoint and now it magically allowed me to edit it's position which I made in the center of the jump node). Since the waypoint is now established, they became options to choose in the Initial Orders; "Behavior" and "Object" drop downs (there are obvious dependencies to unlock these options).

Step 3 is going to problematic - while I know the distance from the Sathanas' original position and the jump node (approx. 10,000m), I have no idea how to write that in a SEXP statement. In the Edit Ship dialog box, I'm surprised that the jump node is not an option in the Departure Cue target dropdown. Seems logical, no?

 

Offline AV8R

  • 28
Re: First Attempt at FREDing
Well that worked - sort of. The Sathanas now moves to the Jump Node but moves at its top speed (25). So it makes it to the jump node way before the 15 minutes is up. I imagine to slow it down is gonna take SEXP programming, right?

I just don't get SEXP from the walk-through. And why are most of the selections greyed-out? I know they are not all relevant at any given time but If I can't see the selections, how I can know what to choose?   :mad:

 

Offline niffiwan

  • 211
  • Eluder Class
Re: First Attempt at FREDing
You want to use "cap-waypoint-speed", and I think you need to create a separate event and use that as the Sathanas arrival cue. Probably something like:

( when
  ( has-arrived-delay "Sathanas" 0 )
  ( ai-waypoints-once "Sathanas" "Waypoint" 89 )  (89 is the order priority, higher values will be done before lower values)
  ( cap-waypoint-speed "Sathanas" 10 ) (10 is the speed you want to cap the ship to)
)

and the arrival cue becomes:

( is-event-true-delay "event name" 0 )

As for why most of the sections are greyed out? As you've guessed, probably because those sexps are not relevant at that time or in that place. If you go to the events editor, practically everything should be available there *somewhere*. i.e. only when or when-argument will be available for the 1st part of the event because that's practically all that's ever valid to put there.

If you want a (mostly) complete list of sexps, run FSO with the "-output_sexps" command line parameter.  This will drop a file (sexps.html) in your FSO directory that should have documentation on most of the available sexps.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: First Attempt at FREDing
ninja'd by Niffiwan but I might as well post. :)

when
- <=
-- distance
--- Sathanas
--- Waypoint 1
- add-ai-goal
-- ai-warpout
-- 89

That should work from the Event Editor. You could also use the first half as a departure cue from Ship Editor.

Slowing the ship down is pretty easy too. You need to use the cap-waypoints-speed SEXP (I think that's what it's called, I don't have FRED with me here). Simply set the maximum speed to 15 and the Sathans will respect that (initial speed is just that, the speed of the ship when the mission starts).

As for the greyed out SEXPs, FRED will automatically grey out SEXPs you can't use. So all the change SEXPs will stay greyed out until you right click on do-nothing. All the status SEXPs only work when you right click on true. After a while it becomes second nature actually, but if you want a list of SEXPs you can actually set an option in the launcher to output them to a html file. Look in the troubleshooting section.

You want to use "cap-waypoint-speed", and I think you need to create a separate event and use that as the Sathanas arrival cue. Probably something like:

( when
  ( has-arrived-delay "Sathanas" 0 )
  ( ai-waypoints-once "Sathanas" "Waypoint" 89 )  (89 is the order priority, higher values will be done before lower values)
  ( cap-waypoint-speed "Sathanas" 10 ) (10 is the speed you want to cap the ship to)
)

and the arrival cue becomes:

( is-event-true-delay "event name" 0 )

You could actually use
when
-true

if you want the Sathanas present at mission start. What you've got will make the Sathanas actually jump in (which may or may not be what AV8R wants).
« Last Edit: December 22, 2014, 09:34:15 pm by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline AV8R

  • 28
Re: First Attempt at FREDing
The way the mission is currently constructed, the Sathanas is already in system and heading for the jump node. 3 Vasudan Corvettes warp in 5 seconds after the mission starts and 3 Terran Corvettes jump in 10 seconds after mission starts - all ships are then beam free (all of this was somewhat simple to set up when I found where all of the options were by poking around in the various editors - and all without using SEXP).

It's just the frakkin' Event Editor - while being the most powerful part of FRED, it is in no way easy to understand/learn. I have written many complex DOS-based batch files in my life using many if/then dependencies and, while I get that the Event Editor kind of works in the same way, I just can't wrap my head around the construction of the statements.

Now I understand why Niffiwan may like to do this in a text editor - once you know the specific commands it's probably easy enough to string together a list of events without the Event Editor's UI getting in the way.  :ick:

 

Offline riomaki

  • Solrazor
  • 24
Re: First Attempt at FREDing
Take a step back and breathe.

The Event Editors is not that hard.  Any event basically boils down to:

when <- "If this happens..."
do-nothing <- "... do everything listed here."

You right-click and replace the "when" with whatever "if" conditions you want.  When a ship has arrived, when its waypoints are done, when it has undocked, etc.  Use operators like and/or/not the same way you'd use &&, || and ! when making an if statement.

Then, you right-click and replace the "do-nothing" with whatever you want to do as a result of the above conditions.  Send some messages, give some AI orders, change the waypoint speed, etc.  You can right-click "Add Operator" to do more than one thing.

The actual right-click menu is an exhaustive list of sexps.  Not everything is relevant, which is why it grays out what isn't.  As with programming language conditionals, you wouldn't put an assignment in the "when" statement.  For example, it makes no sense to say "if (sendmessage("hello world")) {i++;}"  :nod:
« Last Edit: December 23, 2014, 11:38:55 am by riomaki »

 

Offline niffiwan

  • 211
  • Eluder Class
Re: First Attempt at FREDing
You could actually use
when
-true

if you want the Sathanas present at mission start. What you've got will make the Sathanas actually jump in (which may or may not be what AV8R wants).

Good point, I'm still learning the intricacies of FREDing myself :)

Now I understand why Niffiwan may like to do this in a text editor - once you know the specific commands it's probably easy enough to string together a list of events without the Event Editor's UI getting in the way.  :ick:

Well, I use a text editor because I primarily run Linux and therefore have issues running FRED  ;)  Although when I recently acquired an old Windows laptop and tried some FREDing on it, the event editor did seem a bit awkward to use at first, especially when using an unfamiliar trackpad.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline riomaki

  • Solrazor
  • 24
Re: First Attempt at FREDing
Wine doesn't run FRED well?  I'd be surprised.  FRED doesn't strike me as a particularly complicated program, and Wine has certainly improved by leaps and bounds over the years.  Heck, the last time I was on Linux, I used Wine to play all the way through Borderlands 1.  In multiplayer.  With voice chat!  :D

 

Offline AV8R

  • 28
Re: First Attempt at FREDing
Take a step back and breathe.

The Event Editors is not that hard.  Any event basically boils down to:

when <- "If this happens..."
do-nothing <- "... do everything listed here."

You right-click and replace the "when" with whatever "if" conditions you want.  When a ship has arrived, when its waypoints are done, when it has undocked, etc.  Use operators like and/or/not the same way you'd use &&, || and ! when making an if statement.

Then, you right-click and replace the "do-nothing" with whatever you want to do as a result of the above conditions.  Send some messages, give some AI orders, change the waypoint speed, etc.  You can right-click "Add Operator" to do more than one thing.

The actual right-click menu is an exhaustive list of sexps.  Not everything is relevant, which is why it grays out what isn't.  As with programming language conditionals, you wouldn't put an assignment in the "when" statement.  For example, it makes no sense to say "if (sendmessage("hello world")) {i++;}"  :nod:

Thanks. I get the concept of how it's supposed to work, I just don't know what exactly to enter to make things happen the way I want. So here goes the FRED noob asking for how make proper statements that FRED can understand.

So when I create a new event in the Event Viewer it gives me:

New Event
    when
        true
        do-nothing

So I should replace that with:

New Event
    when
        Sathanas reaches Jump Node 0
        Jump out

It can't be that simple. The trouble is, I don't see those as choices anywhere in the right click menus. Just a lot a various operand choices.

The problem here is I don't know how to tell the Event Editor what I want it to do because I don't speak it's language. This is what I need help with. Once I learn this relatively simple task from this first try, it'll probably come easier next time. The first time is always going to be a leaning curve.

So to reiterate, what I'm trying to accomplish in this simple exercise is:

1) Have the Sathanas (which is already in system) travel to the jump node (waypoint) and jump out.
2) Reduce the speed of the Sathanas to 10 (because it defaults to 25)

So what selections do I make in the Event Editor and what exactly to I type in the data fields to make this work?
« Last Edit: December 24, 2014, 12:51:11 pm by AV8R »

 

Offline AV8R

  • 28
Re: First Attempt at FREDing
Well, I got my mission working the way I wanted - and I didn't use a single line of SEXP.   :p

Seems you can do quite a bit just using the Ship Editor Initial Orders dialog box as well as the Wing Editor Initial Orders. You can make ships and wings do pretty much anything you want. Is it the best way to handle multiple dependencies or very complex scenarios? Well, probably not. But for a straight-forward, somewhat linear missions, it works quite well.

How I got around my 2 issues mentioned earlier were to start the Sathanas twice as far away from the jump node than I initially designed. This way it could travel at its default 25 and not get to the jump node too soon. The second issue was right in front of my face in the Ship Editor Initial Orders box. For the first order I simply told it to head for the waypoint using the Waypoint Once order with a high priority (80). I then used the second order to tell it to Warp with a lower priority (50) so it would jump when it reached the jump node. Piece of cake!   :yes:

The rest of the mission just took a little tweaking - and during gameplay, a little luck (I have 6 corvettes swarm the Sathanas from all directions at close range. But if any of the corvettes jump in facing the Sathanas they're toast - those 4 huge beams will destroy the corvette in seconds!) But that's ok, being a corvette down just makes it a little more challenging to stop the Sathanas before it reaches the jump node. Great fun!

Thanks everyone for your input. I'm sure that in the future if I want to create more complex missions I'll have to learn SEXP, but for now I just wanted to keep it simple. Mission accomplished.   ;)

So, is there a repository here (or elsewhere) where members can share single Fredded missions for others to try/enjoy? I'd like to try some of your standalone missions.

 

Offline Lepanto

  • 210
  • Believes in Truth
    • Skype
Re: First Attempt at FREDing
Single missions aren't very popular here, I'm afraid. You could post yours though, as an attachment or something.

Beginner FREDders often face headaches; don't get discouraged if FRED doesn't quite make sense yet! :D
"We have now reached the point where every goon with a grievance, every bitter bigot, merely has to place the prefix, 'I know this is not politically correct, but...' in front of the usual string of insults in order to be not just safe from criticism, but actually a card, a lad, even a hero. Conversely, to talk about poverty and inequality, to draw attention to the reality that discrimination and injustice are still facts of life, is to commit the sin of political correctness. Anti-PC has become the latest cover for creeps. It is a godsend for every curmudgeon and crank, from fascists to the merely smug."
Finian O'Toole, The Irish Times, 5 May 1994

Blue Planet: The Battle Captains: Missions starring the Admirals of BP: WiH
Frontlines 2334+2335: T-V War campaign
GVB Ammit: Vasudan strike bomber
Player-Controlled Capship Modding Tutorial

 

Offline niffiwan

  • 211
  • Eluder Class
Re: First Attempt at FREDing
Wine doesn't run FRED well?  I'd be surprised.  FRED doesn't strike me as a particularly complicated program, and Wine has certainly improved by leaps and bounds over the years.  Heck, the last time I was on Linux, I used Wine to play all the way through Borderlands 1.  In multiplayer.  With voice chat!  :D

When I've previously tried it (3.6.14 - 3.6.18) most things seemed to work except saving, which kinda makes it entirely useless :)   When I tried it just now (3.7.2 RC2 & RC4), the main window didn't even draw properly, just had random-seeming stuff from my other windows; so yeah, not sure exactly what's quirky about it but I haven't had much luck, even though (as you say) many other games & programs run well under Wine.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...