Author Topic: First Attempt at FREDing Part 3  (Read 4209 times)

0 Members and 1 Guest are viewing this topic.

Offline AV8R

  • 28
First Attempt at FREDing Part 3
Ok, so I'm starting to get the hang of this FREDing thing and discovering SEXP is not so scary (provided that I'm using the built-in editors - other than that I'd be lost). Now I'm starting to add Events to my mission so I can add Comms and other stuff, but there is one thing that still eludes me.

There is only one waypoint in the mission and that is right in the middle of the jump node. The only ship that is using that waypoint is the Sathanas so it knows how to get to the jump node to escape. The other ships - 6 corvettes as well as bombers and fighters - do not use any way points. Their movements are governed by the Sathanas as it moves toward the jump node (although they all stay near the Sathanas since they are all ordered to destroy it).

The problem I have is this: since the attacking corvettes are not using any waypoints - how can I adjust their speed? It's easy when a ship is using a waypoint as you can use the "cap-waypoint-speed" command to make adjustments. I've tried to set the corvettes' speed in the Initial Status box in the Ship Editor, but that value gets ignored and they end up going "full speed ahead" (35) after jumping in. This eventually causes them to bunch up closely around the sides of the Sathanas (just behind the forward arms) where they can't use their forward beam cannons anymore. It's only at this point does the corvettes' AI slow the ships to match the Sathanas' speed.

I'd like the corvettes to kind of "hang back" behind the Sathanas while letting loose with their forward beam cannons - but to do this, I would have to find a way to either initially slow them down or get the corvettes to match speed with the Sathanas sooner than when it's too far ahead of the Sathanas to do any good.

Any suggestions?   :confused:

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: First Attempt at FREDing Part 3
Use waypoints for them. You really can't do this sort of thing with the ai.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline niffiwan

  • 211
  • Eluder Class
Re: First Attempt at FREDing Part 3
I think there's some way you can set a dynamic waypoint, so that each corvette follows a waypoint that's positioned relative to the Sathanas.   Unfortunately I don't know how to implement such a thing, maybe someone else has more experience with it?
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...

 
Re: First Attempt at FREDing Part 3
I think there's some way you can set a dynamic waypoint, so that each corvette follows a waypoint that's positioned relative to the Sathanas.   Unfortunately I don't know how to implement such a thing, maybe someone else has more experience with it?
The easiest way to do that is to use a waypoint path with a single waypoint, order a ship to follow it, then move the waypoint around using set-object-position, get-object-position and arithmetic operators (+, -) to set it where you want your ship to go relative to the target.

Here is a sample SEXP I'm using to update a waypoint's position every 5 seconds.
Code: [Select]
( when
    ( true )
    ( set-object-position
         "Apep path:1"
         ( get-object-x "Sathanas" )
         ( - ( get-object-y "Sathanas" ) 3500 )
         ( get-object-z "Sathanas" )
    )
)

 

Offline Lepanto

  • 210
  • Believes in Truth
    • Skype
Re: First Attempt at FREDing Part 3
But yeah, just give the attacking corvettes waypoints and use cap-waypoint-speed. When you want capships to move around, they should usually be following waypoints. There are some places you can get away with just giving them attack orders, like when you're sure a particular attacking capship will destroy its target or be destroyed before it reaches turning-fight range. Otherwise, the capship AI is too clumsy to do much on its own, so you need to hold its hand with waypoints.

Save the fancy waypoint tricks until you've got basic FREDding down, unless you really need them for a specific mission.

And keep at it! (Almost) all the greatest FREDders in this community probably had amateurish first missions.
"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 procdrone

  • Formerly TheHound
  • 29
  • Balance breaker! Thats me!
    • Steam
Re: First Attempt at FREDing Part 3
Have you read the tutorials, and such? Read what SEXP's do on the Wiki, read everything you can from the Wiki http://www.hard-light.net/wiki/index.php/Portal:FRED - It clears a lot, really, a lot.

If you are after more serious solutions, or any tricky examples... just take out some missions from ready campaigns, and look into their event chains, sexp, and all.

Yea. everybody starts a newbie, but only few persisted... keep at it, and eventually you will find that your campaigns are praised by HLP members!
--Did it! It's RELEASED! VeniceMirror Thread--

 

Offline AV8R

  • 28
Re: First Attempt at FREDing Part 3
The easiest way to do that is to use a waypoint path with a single waypoint, order a ship to follow it, then move the waypoint around using set-object-position, get-object-position and arithmetic operators (+, -) to set it where you want your ship to go relative to the target.

Here is a sample SEXP I'm using to update a waypoint's position every 5 seconds.
Code: [Select]
( when
    ( true )
    ( set-object-position
         "Apep path:1"
         ( get-object-x "Sathanas" )
         ( - ( get-object-y "Sathanas" ) 3500 )
         ( get-object-z "Sathanas" )
    )
)

Why would you want to move the waypoint constantly? It seems a little counter-productive. Yet, there has to be a good reason why you're doing this though.

 

Offline AV8R

  • 28
Re: First Attempt at FREDing Part 3
But yeah, just give the attacking corvettes waypoints and use cap-waypoint-speed. When you want capships to move around, they should usually be following waypoints. There are some places you can get away with just giving them attack orders, like when you're sure a particular attacking capship will destroy its target or be destroyed before it reaches turning-fight range. Otherwise, the capship AI is too clumsy to do much on its own, so you need to hold its hand with waypoints.

This may be difficult since the corvettes come in at random jump points. They come in anywhere around the Sathanas and move in from there (I don't have jump points programmed in - I just tell them to jump in 6000m from the Sathanas and the game just does the rest). That's why I really can't set waypoints for each ship - I don't know where they're gonna jump in. I'd have to set jump-in coordinates for each of the 6 corvettes if I want to have them follow a specific waypoint that won't cross over or intersect with the Sathanas.


 

Offline AV8R

  • 28
Re: First Attempt at FREDing Part 3
Have you read the tutorials, and such? Read what SEXP's do on the Wiki, read everything you can from the Wiki http://www.hard-light.net/wiki/index.php/Portal:FRED - It clears a lot, really, a lot.

If you are after more serious solutions, or any tricky examples... just take out some missions from ready campaigns, and look into their event chains, sexp, and all.

Yea. everybody starts a newbie, but only few persisted... keep at it, and eventually you will find that your campaigns are praised by HLP members!

I'm really trying to learn - although the finer points of this exercise are still difficult to absorb. I'm not trying to build a fabulous campaign - I'm just trying to build a fun single-mission time-waster that makes me feel good.

 

Offline Lorric

  • 212
Re: First Attempt at FREDing Part 3
Why would you want to move the waypoint constantly? It seems a little counter-productive. Yet, there has to be a good reason why you're doing this though.
The idea there is that the waypoint moves with the Sathanas, so the ships you want to follow the Sathanas will follow the Sathanas.

 

Offline AV8R

  • 28
Re: First Attempt at FREDing Part 3
I get that, but why not just set a waypoint way far away (like I already have in my mission - 10,000m away) and have all ships follow that? The only issue I see is the eventual convergence of all ships toward the waypoint (thus mashing them all together as they reach the waypoint).

 

Offline Lorric

  • 212
Re: First Attempt at FREDing Part 3
Well if it keeps them following behind the Sathanas where you want them, then it's fine. And if the waypoint is far enough away, then you should have no issue with the ships all crushing together.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: First Attempt at FREDing Part 3
Depending on what ships you have following the Sath, you may need to cap-waypoint-speed so they don't pass up the Sath while they are trying desperately (like all good AI pilots) to reach the waypoint.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 
Re: First Attempt at FREDing Part 3
I get that, but why not just set a waypoint way far away (like I already have in my mission - 10,000m away) and have all ships follow that? The only issue I see is the eventual convergence of all ships toward the waypoint (thus mashing them all together as they reach the waypoint).
Well, that way you are sure that any ship will be going towards the Sathanas wherever he is from whatever angle. A bit overkill for your mission perhaps, but my answer was more of a followup on niffi's post anyway.

And in any case, mjn is right, you might want to have your capships match the Sathanas' speed once they get in range.

 

Offline AV8R

  • 28
Re: First Attempt at FREDing Part 3
How about this: I create a second waypoint (waypoint2) just behind the Sath and have the 6 corvettes head toward it. But before they all meet at waypoint2 and crash head-on, I can have an event occur a couple of minutes into the battle that changes the corvettes' direction from waypoint2 behind the Sath to waypoint1 in the jump node ahead of the Sath. This way the corvettes will turn around and head in the same direction as the Sath after they've all made some progress toward the rear of the Sath. I can then cap their speed to keep them there.

What do you all think? Is this idea feasible? Can you change a ship's waypoint before it actually reaches it by using an event? Like "if-whatever-occurs" then have each corvette "head-to-waypoint1".

Thanks for all of your input.   :yes:

 

Offline crizza

  • 210
Re: First Attempt at FREDing Part 3
Honestly? Do X3nos suggestion... It looks easy and will do the job way more efficently...

  

Offline niffiwan

  • 211
  • Eluder Class
Re: First Attempt at FREDing Part 3
Can you change a ship's waypoint before it actually reaches it by using an event? Like "if-whatever-occurs" then have each corvette "head-to-waypoint1".

Yes, that's possible, for instance you could use something like "when distance from waypoint 1 < 1000 metres, clear orders, set orders to fly to waypoint 2"
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...