Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: General Battuta on September 16, 2010, 01:40:03 pm
-
Support ship swarms. There's a loophole in the code that can be exploited with some clever FREDding.
It's beautiful to see a while wing of gunships being rearmed in rapid succession.
-
The add-ship SEXP?
-
The add-ship SEXP?
Ship-create is the start, yeah, but then you have to get them to respond to rearm calls, which requires a bit of an unhappy kludge.
-
I thought any ship that had the "support" flag can be called. That's why Enter the Dragon needed a special table entry for the support ship.
-
I thought any ship that had the "support" flag can be called. That's why Enter the Dragon needed a special table entry for the support ship.
The thing is that the game only allows one support ship per team to be the REAL support ship, meaning it is the ship that will respond to all rearm calls. Every other support ship present will just float around.
-
Support ship swarms. There's a loophole in the code that can be exploited with some clever FREDding.
It's beautiful to see a while wing of gunships being rearmed in rapid succession.
Nice work! :yes:
I may be requiring this in short order, please share the secret :nod:
-
It's not so much a secret as a kludgy little kludge. You'll need to use some nested when-arguments to ship-create new support ships when the 'regular' support ships arrive. Give those ship-created ships orders to guard the 'real' support ship and they'll follow it around. As soon as the first support ship docks with a target, they'll abruptly start accepting any pending orders.
-
The thing is that the game only allows one support ship per team to be the REAL support ship, meaning it is the ship that will respond to all rearm calls. Every other support ship present will just float around.
Huh. I thought the game was specifically coded to rearm from the nearest support ship.
EDIT: And the thread title is misleading. I thought you'd be posting a list.
-
The thing is that the game only allows one support ship per team to be the REAL support ship, meaning it is the ship that will respond to all rearm calls. Every other support ship present will just float around.
Huh. I thought the game was specifically coded to rearm from the nearest support ship.
Oh, I believe it is, but only one ship at a time will accept calls. So if you call for a support ship, then the nearest support ship becomes THE REAL SUPPORT SHIP, and any further calls from your wingmen get added to that support ship's queue instead of being distributed amongst other nearby support ships.
Or, put more clearly, only one support ship will accept calls at a time, though exactly which support ship this is could change.
-
EDIT: And the thread title is misleading. I thought you'd be posting a list.
This is probably a thread for GENERAL BATTUTA's messings-around in FRED. I anticipate that it will be updated in a blog-like fashion.
-
Yeah, I can always post more wacky stuff.
People keep telling me to do a FRED cookbook to document the more nutty stuff we pulled off in War in Heaven. I would like to.
-
I'd suggest a tutorial in the same manner as the ones Cetanu and I posted.
-
I'd suggest a tutorial in the same manner as the ones Cetanu and I posted.
I doubt I have anything nearly as useful to say as you guys did, but I could give it a shot. Fury deserves credit for teaching me a lot of the engine behavior too.
-
The thing is that the game only allows one support ship per team to be the REAL support ship, meaning it is the ship that will respond to all rearm calls. Every other support ship present will just float around.
Huh. I thought the game was specifically coded to rearm from the nearest support ship.
It is.
Technical explanation follows:
FSO recognizes MAX_SUPPORT_SHIPS_PER_TEAM support ships for each team. A support ship (any ship with the "support" flag), is considered valid if it is not dying, departing, ordered to warp out, or actively repairing/rearming.
Where the problem comes in is MAX_SUPPORT_SHIPS_PER_TEAM is set to 1. This means that no others are even considered because once the code finds one, it figures it is done. Because the search is done starting with the first object, it also means that you get the same ship.
Why battua's solution works (most of the time) is that a large factor for an AI to determine when to call the support ship is if a support ship is present in the mission, and IIRC if the player is actively being repaired.
-
Why battua's solution works (most of the time) is that a large factor for an AI to determine when to call the support ship is if a support ship is present in the mission, and IIRC if the player is actively being repaired.
I believe what IssMneur is saying here is that if a support ship is conducting rearm/repair, it's not considered to be a support ship present in the mission, and so calls will temporarily go to another support ship, leaving you with two active support ships.
-
People keep telling me to do a FRED cookbook to document the more nutty stuff we pulled off in War in Heaven. I would like to.
I'd rather see one Cookbook where all FREDders can contribute by adding their own tricks/methods. I for one have quite a few things to show.
-
People keep telling me to do a FRED cookbook to document the more nutty stuff we pulled off in War in Heaven. I would like to.
I'd rather see one Cookbook where all FREDders can contribute by adding their own tricks/methods. I for one have quite a few things to show.
I think I've said before I've always wanted you to do that. I can edit stuff into a single post.
-
Sure, but I prefer to add content to an existing thread rather than creating the thread myself... at least until I release one or more campaigns.
-
People keep telling me to do a FRED cookbook to document the more nutty stuff we pulled off in War in Heaven. I would like to.
I'd rather see one Cookbook where all FREDders can contribute by adding their own tricks/methods. I for one have quite a few things to show.
I think I've said before I've always wanted you to do that. I can edit stuff into a single post.
Why not put it on the wiki instead, so it's more accessible for adding topics & comments?
-
My Wiki account is banned, so no. Would have been nice to add tricks to the wiki (pretty much like scripts), post the links here and then discuss them.
-
My Wiki account is banned, so no. Would have been nice to add tricks to the wiki (pretty much like scripts), post the links here and then discuss them.
Maybe we could appeal for an unbanning.
-
FSO recognizes MAX_SUPPORT_SHIPS_PER_TEAM support ships for each team. A support ship (any ship with the "support" flag), is considered valid if it is not dying, departing, ordered to warp out, or actively repairing/rearming.
This intrigues me also. Where would I find this "MAX_SUPPORT_SHIPS_PER_TEAM" thing? Is it a table, or a FRED thing?
I tried searching, but the wiki search sucks just as much as the forum search.
-
It's a hardcoded engine constant. Only way to change it is by editing the code.
-
So...why isn't it set higher? :o
Does increasing it have some unforseen consequences?
-
Well, according to other coders, getting one support ship to work reliably was hard enough.
-
I can see bumping it having serious issues in multiplayer. Especially in TvT where support ships didn't used to work reliably even in retail.
-
It's not so much a secret as a kludgy little kludge. You'll need to use some nested when-arguments to ship-create new support ships when the 'regular' support ships arrive. Give those ship-created ships orders to guard the 'real' support ship and they'll follow it around. As soon as the first support ship docks with a target, they'll abruptly start accepting any pending orders.
What happens if you have a bunch of support ships in the mission at the start and you try this?
-
It's not so much a secret as a kludgy little kludge. You'll need to use some nested when-arguments to ship-create new support ships when the 'regular' support ships arrive. Give those ship-created ships orders to guard the 'real' support ship and they'll follow it around. As soon as the first support ship docks with a target, they'll abruptly start accepting any pending orders.
What happens if you have a bunch of support ships in the mission at the start and you try this?
It shouldn't make a difference when the support ships are created, they are all considered equal to one that was called in.
-
Is it possible to actually use the support ship in ...But Hate the Traitor? If yes, has anyone timed it so that they're being rearmed when the IFF changes? How would that work?
-
Is it possible to actually use the support ship in ...But Hate the Traitor? If yes, has anyone timed it so that they're being rearmed when the IFF changes? How would that work?
IIRC you don't get a support ship on any of the SOC missions.
IFF is checked by the find support ship code (so you will only get a support ship of the same team). If you changed IFF after you called a support ship, I don't know, I don't recall the code checking again to see if you have changed teams, so I suppose the support ship would just repair you as if you where on the same team.
-
In the mission ...But Hate the Traitor, one of the NTF squadrons jumps in with a Hygeia support ship (the only place you can get the kill for one in retail). Question was:
1) is it possible to use said support ship?
2) if above is yes, what happens if it turns hostile while you're in the middle of rearming?
-
In the mission ...But Hate the Traitor, one of the NTF squadrons jumps in with a Hygeia support ship (the only place you can get the kill for one in retail). Question was:
1) is it possible to use said support ship?
2) if above is yes, what happens if it turns hostile while you're in the middle of rearming?
Try it? Personally, I never noticed that their was a support ship that jumped in with them.
To reiterate:
1) If you are on the same team as the support ship, then yes.
2) As far as I can tell and if I am recalling the code correctly, it will just rearm/repair as normal. The docking part of rearm/repair is no different than any other docking process in FSO.
-
I wonder if support ships are disabled in that mission. Retail had issues with a support ship arriving if one was already present in mission.
-
It's not so much a secret as a kludgy little kludge. You'll need to use some nested when-arguments to ship-create new support ships when the 'regular' support ships arrive. Give those ship-created ships orders to guard the 'real' support ship and they'll follow it around. As soon as the first support ship docks with a target, they'll abruptly start accepting any pending orders.
What happens if you have a bunch of support ships in the mission at the start and you try this?
Should also work fine.
-
2) if above is yes, what happens if it turns hostile while you're in the middle of rearming?
2) As far as I can tell and if I am recalling the code correctly, it will just rearm/repair as normal. The docking part of rearm/repair is no different than any other docking process in FSO.
I believe it will just rearm/repair you as normal, since I accidentally triggered this in JAD2 (unfortunately I didn't get to actually get rearmed as I died first).
EDIT: Managed to get rearmed by the turned-hostile support ship:
(http://img205.imageshack.us/img205/610/screen0066.png)
But, not unreasonably, I cannot call that or any other support ship after my IFF is changed:
(http://img535.imageshack.us/img535/325/screen0067.png)
-
So while we're on the topic of support ships, I wanted to give people some advice.
Have you ever been irritated because you can't perform FRED actions on support ships? Say you're setting up a tense, weapons-tight ceasefire, and if a single fighter shoots even once, the whole thing breaks. It's working like a charm except FFFFFFFFFFUUUUUUUUUUUUUU the enemy just wasted your support ship, which wasn't affected by the ship-protect you were using!
Similarly, what if you want to get the support ship to leave? Or make it stealth? Or give it armor?
Well, you can't select it as an argument for these SEXPs, because it's not on the mission ship list. But what you CAN do is create a when-argument using 'any-of', and then manually add the arguments 'Support 1', 'Support 2', 'Support 3' and so on.
Then set the event trigger as 'when has-arrived-delay <argument>', and perform whatever actions you like (stealth, armor, AI orders) on 'argument'.
You can also use this to perform FRED operations on ships created by Ship-Create, but that's a little more complex, and a topic for next time.
-
Useful! :yes:
-
Hmm... In that kind of situation I just put the support ship in the mission manually, and check "Disallow support ships" in Shift-N.
In tough battle missions, I put in another one in case the first one is destroyed.
But Battuta's way is definitely more elegant.
-
Man I have something I want to write about but I do feel it'd spoil WiH R2 to a degree. :( It's such a cool technique though and I'm guessing 79% of FREDders are not aware of it.
-
Feel free to send me a PM and I'll see if I can think of a similar example that doesn't have spoilers. :)
-
Feel free to send me a PM and I'll see if I can think of a similar example that doesn't have spoilers. :)
We've actually talked about it at some length. It's the applications I wanted to keep close to my chest since they have a fair amount of wow factor.
-
Ah.
I know what you mean. There is a big difference between teaching the basics of how to make a trick work and giving away something that you're basing an entire mission on. :D
I've had a few cases of that myself. Of course a post-release dissection is the perfect time to go over how these tricks worked. :)