Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Snail on May 19, 2007, 06:29:47 pm

Title: Complicated SEXP Strings
Post by: Snail on May 19, 2007, 06:29:47 pm
I was playing around in FRED with your stupid (yet useful) little when-arguments and your idiotic (yet useful) string variables... And I found myself with quite a long SEXP string.

So then I sat and wondered... What's the most complicated SEXP string that you've ever made? I'd like to know since I like looking at SEXP strings... Especially when I didn't do them and someone already did it for me.

I thought it might make for an interesting thread... :D
Title: Re: Complicated SEXP Strings
Post by: Mobius on May 19, 2007, 06:42:46 pm
So then I sat and wondered... What's the most complicated SEXP string that you've ever made? I'd like to know since I like looking at SEXP strings... Especially when I didn't do them and someone already did it for me.

Corrected :)

The are no "complicate" SEXPs once you learn how to use them. Try to combine string-variables with when-argument conditionals in the most strange way and you shall see. You can find an example in Steadfast Ep1M1, with that take off string-variable system :)
Title: Re: Complicated SEXP Strings
Post by: Snail on May 19, 2007, 06:45:22 pm
Well even if you know how to use it and how it works it's still complicated.

I thought you were going to post something *really* freaky, LGM. ;)
Title: Re: Complicated SEXP Strings
Post by: Mobius on May 19, 2007, 06:54:13 pm
Like that thread in the INFA Internal? No. I posted my secrets there :nod:

The point is that when-argument is a key. With it, you can do so many things and significantly reduce the number of events of a mission.
Title: Re: Complicated SEXP Strings
Post by: Axem on May 19, 2007, 08:10:17 pm
This is the best one I can find. It's from my mission in the BtRL demo.

(http://img.photobucket.com/albums/v109/NarfPics/btrlsexp1.png)

Let's hope kara won't see this thread or I'm sure he'll post something that'll make our brains implode. :p
Title: Re: Complicated SEXP Strings
Post by: FUBAR-BDHR on May 19, 2007, 10:46:42 pm
Here's one I was working on with EtheralEntity back in the day.  Was one of out many attempts to find a workaround for self destruct in multi player.  Never did find one that would work every time due to the processing order of the events and respawns plus multi player lag being thrown in.  The idea was to make player ships self destruct (thus forcing a respawn) if they left the vicinity of a super station in a TvT and did not return within a specific amount of time. 

Quote
$Formula: ( when
   ( true )
   ( when
      ( or
         ( < ( hits-left "Alpha 1" ) 1 )
         ( > ( hits-left "Alpha 1" ) @A1H[100] )
      )
      ( modify-variable @A1[30] 33 )
   )
   ( modify-variable
      @A1H[100]
      ( hits-left "Alpha 1" )
   )
   ( when
      ( >
         ( distance "<any unknown>" "Alpha 1" )
         150
      )
      ( when
         ( > @A1[30] 0 )
         ( modify-variable
            @A1[30]
            ( - @A1[30] 1 )
         )
      )
      ( when
         ( = @A1[30] 0 )
         ( modify-variable @A1[30] 33 )
         ( self-destruct "Alpha 1" )
      )
   )
   ( when
      ( <
         ( distance "<any unknown>" "Alpha 1" )
         151
      )
      ( modify-variable @A1[30] 10 )
   )
)
+Name: Alpha 1
+Repeat Count: 999999999
+Interval: 1
+Team: 0
Title: Re: Complicated SEXP Strings
Post by: Roanoke on May 20, 2007, 05:21:30 am
This is the best one I can find. It's from my mission in the BtRL demo.

(http://img.photobucket.com/albums/v109/NarfPics/btrlsexp1.png)

Let's hope kara won't see this thread or I'm sure he'll post something that'll make our brains implode. :p

As someone who's stuck with Retail (for the moment) and hasn't used "arguments", what did that achieve exactly ? was to ensure a waypoint didn't appear untill previous points had been visited ?
Title: Re: Complicated SEXP Strings
Post by: Snail on May 20, 2007, 09:44:39 am
Dunno how to explain, but every time FS2 sees <argument> it replaces it with one of the waypoints.
Title: Re: Complicated SEXP Strings
Post by: Shade on May 20, 2007, 09:46:04 am
Is it a requirement that the events actually work as intended? :p

Roanoke:

Using <argument> is essentially a way to avoid repeating the same event over and over again for different targets. Instead, you can now use an argument list on a repeating event and have it automatically go through it until the operation has been performed on all targets in the list. The event shown above will in turn delete navpoints 1 through 5, and is basically the same as making 5 seperate events for each nav point, but takes far less effort for the mission designer. It does become a more complicated event as you need to invalidate used arguments etc., but with practise it becomes a good time saver when FREDding.
Title: Re: Complicated SEXP Strings
Post by: karajorma on May 20, 2007, 01:43:31 pm
Well this one from MindGames is still Top Secret

(http://homepage.ntlworld.com/karajorma/Misc-Pics/Big%20Event.jpg)

So I'll have to grab something from BtRL but unfortunately I don't have anything too complicated there (at least not in a single Event). My longest event in BtRL is this one IIRC.

Quote
$Formula: ( when
   ( and
      ( is-event-true-delay
         "Protect Scar And Everyone Else"
         5
      )
      ( not
         ( has-departed-delay 0 "Fractalÿ4" )
      )
      ( or
         ( and
            ( is-event-true-delay
               "Blue 2 Has Other Things To Do"
               0
            )
            ( >
               ( distance "Blue 2" "Monarch" )
               @CONST-DRADISMaxRange[4000]
            )
         )
         ( and
            ( is-event-true-delay
               "Blue 3 Has Other Things To Do"
               0
            )
            ( >
               ( distance "Blue 3" "Monarch" )
               @CONST-DRADISMaxRange[4000]
            )
         )
         ( and
            ( is-event-true-delay
               "Blue Has Other Things To Do"
               0
            )
            ( or
               ( >
                  ( distance "Blue 2" "Monarch" )
                  @CONST-DRADISMaxRange[4000]
               )
               ( >
                  ( distance "Blue 3" "Monarch" )
                  @CONST-DRADISMaxRange[4000]
               )
            )
         )
         ( and
            ( or
               ( order
                  "Blue 2"
                  "Destroy my target"
                  "Fractalÿ4"
               )
               ( order
                  "Blue 3"
                  "Destroy my target"
                  "Fractalÿ4"
               )
               ( order
                  "Blue"
                  "Destroy my target"
                  "Fractalÿ4"
               )
            )
            ( or
               ( >
                  ( distance "Blue 2" "Monarch" )
                  @CONST-DRADISMaxRange[4000]
               )
               ( >
                  ( distance "Blue 3" "Monarch" )
                  @CONST-DRADISMaxRange[4000]
               )
            )
         )
      )
   )
   ( do-nothing )
)
+Name: Fight Your Own Damned Battles

Which was basically the arrival trigger for Optic wing if the player tried to get one of his wingmen to abandon their escort and come help him fight Scar.


Title: Re: Complicated SEXP Strings
Post by: Dark Hunter on May 20, 2007, 02:25:08 pm
/me s brain implodes
Title: Re: Complicated SEXP Strings
Post by: Snail on May 20, 2007, 02:32:50 pm
's not that bad.
Title: Re: Complicated SEXP Strings
Post by: Dark Hunter on May 20, 2007, 02:50:51 pm
'twas a joke, Snail.  ;)
Title: Re: Complicated SEXP Strings
Post by: Snail on May 20, 2007, 03:16:00 pm
Well it would make a few people's head explode.

Hehe, LGM's helping me fix up my mission that I just don't seem to be able to get ;)
Title: Re: Complicated SEXP Strings
Post by: Roanoke on May 20, 2007, 03:49:48 pm
probably easier to read if it were a  FRED screencapture.  :doubt:

That Mindgames event looks ace  :D
Title: Re: Complicated SEXP Strings
Post by: Mobius on May 20, 2007, 06:49:43 pm
Hehe, LGM's helping me fix up my mission that I just don't seem to be able to get ;)

I can always copy and paste that system posted in the INFA Internal :nod:
Title: Re: Complicated SEXP Strings
Post by: Axem on May 20, 2007, 07:07:48 pm
(http://homepage.ntlworld.com/karajorma/Misc-Pics/Big%20Event.jpg)

I see part of a training message sexp. My god. It's the training mission from hell!
Title: Re: Complicated SEXP Strings
Post by: CP5670 on May 21, 2007, 04:12:19 pm
I have one mission (14c in PI) that doesn't have any truly complicated events, but is only one or two events away from the 150 limit. I only just realized that when I tried to make some adjustments to it. :p
Title: Re: Complicated SEXP Strings
Post by: karajorma on May 21, 2007, 04:28:17 pm
Pretty impressive. Closest I ever got to that is 120 in Birth of a Legend for BtRL.
Title: Re: Complicated SEXP Strings
Post by: Goober5000 on May 21, 2007, 10:24:25 pm
Well, it's not a sexp event, but I did come up with the masterpiece in the attached screencap...


Well this one from MindGames is still Top Secret
Ah, I think I know which one you mean. :D


I have one mission (14c in PI) that doesn't have any truly complicated events, but is only one or two events away from the 150 limit. I only just realized that when I tried to make some adjustments to it. :p
Mission 6 in STR is like that too. :)

[attachment deleted by admin]
Title: Re: Complicated SEXP Strings
Post by: karajorma on May 22, 2007, 07:20:21 am
Ah, I think I know which one you mean.

Yep. It's the one you're thinking about. :)