Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Aardwolf on July 18, 2009, 03:32:35 pm
-
I'm wondering if it's possible. I had a guess that maybe it treats the replacement ship as the same when it parses the SEXP somehow, but otherwise it would require variables and string concatenation and ewwww.
If there isn't a clean way to do this, I propose a feature: a sexp to specify the nth fighter in a multi-wave wing. It might require a bit more specific logic for replacement wings that use the wave threshold setting though...
Edit: another consideration you might want to take into consideration is, the FRED'er might want to refer to a specific position in a specific wave other than the first. Like, maybe they want to specify the 4th pilot in the 2nd wave of a wing with a threshold of 2. So basically he'd be the 8th pilot to arrive, but would be the 6th pilot simultaneously in the field.
You might need to be able to specify a specific wave number, or to use condition for whether a wave qualifies or not.
-
OK that might have been one of the most confusing questions I've ever seen.
Are you trying just trying to have something happen when say the 11th ship in cancer arrives or dies or whatever? If so you can get around the not being able to specify Cancer 11 in an sexp by using when-argument and placing cancer 11 in the list.
-
No, I mean in general it is already possible to put "Cancer 3" somewhere, but you can't easily put "Whatever ship is occupying the 3rd slot in Cancer wing for the current wave". But then I had an idea for how to make a sexp like this:
(not yet implemented)
op member-of-wing
Cancer
3
which would be equivalent to "Whatever ship is occupying the 3rd slot in Cancer wing for the current wave". It might also be useful, if it isn't implemented yet, to have a sexp to query what wave a multi-wave wing is on. Possibly like this:
op wing-latest-wave
Cancer
which would return the number that the specified wing is currently up to, as far as waves (and the value it returns would increase every time the next wave arrives. It probably would start at zero up until the first wave arrived. Finally, it might also be necessary to have something like this:
op has-wave-arrived-delay
Cancer
2
10
where the 2 is the wave number and the 10 is the delay. This would be so that, in addition to being able to check what wave you're at, you could also use changes in that as cues for events.
Of course, if there's already an easy way to do it, this would be unnecessary (but might still make things more convenient, depending what it takes to do these things now).
Basically, it's a "sexp request"
-
well I think there is a workaround... but I dunno if it works for I did not need to use it yet (its from this list of "ideas how to screw with FRED, that exist in you mind even if you never need them at all")
If you are using when-argument or everytime-argument you can type anything as argument - even "Arjuna 9" if there is no Arjuna wing or Arjuna 9 at all
FRED has yet not complained at that (but that might be because FRED does not check the arguments....)
-
Well to determine what wing it's on you can do a check for each time the first ship in the next wave arrives. Doesn't work for wave threshold too well but I'm sure with a little bit of effort it would work. Same thing when-argument had-arrived-delay cancer 1, cancer 5, cancer 9 etc.
Wing latest wave is simple math except for the wave threshold as well.
Both of these really only become an issue if the ships get wiped out too quickly so the threshold is bypassed and a full wing arrives instead of say 3 of a wing of 4.
-
I'm not seeing why there would be a big enough need for these SEXPs as so far I think you can calculate the answers using existing SEXPs.
I don't particularly want to add niche use SEXPs if they're for something that can be done in another way.
-
Yeah, it's not so much of a "ADD THIS FEATURE NOW" as me commenting that the existing way of doing it seems like a bit of a hack, and possibly a nuisance in arbitrarily large wings.
-
Yea it can be a pain. Try subsystem guardian 99 waves of 6 ships. Not impossible but you have to split it into 3 events to fit all the ships in due to the character limit.
On the other hand I belive there is still a limit on the number of sexps you can have so if it can be done some other way then its better to save room.
-
You mean how many sexp's can be used in a single mission, or unique sexp's that can be defined before needing to make big changes to the game engine?
-
The second one.
-
On the other hand I belive there is still a limit on the number of sexps you can have so if it can be done some other way then its better to save room.
There is but I don't think we're anywhere near it yet. I've never really looked into this but IIRC the limit is 1024 SEXPs.
Still that does mean we should avoid the ones that will barely ever be used since there is a limit. More importantly though the more SEXPs we add the more confusing FRED becomes.
-
What is the limit based on? 10-bits per multiplayer packet or somesuch?
-
There's a define somewhere in sexp.h that sets it to 1024. No idea how easy that would be to bump though.