Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Black Wolf on May 12, 2004, 05:05:17 am

Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: Black Wolf on May 12, 2004, 05:05:17 am
First of a few threads I'm going to make (don't worry, they're all on different topics). Anyway, quick example of what I'm talking about. You're flying in a highly volatile nebula. In order to make it into this nebula, the GTVA commissioned a shieldship - something that will project weak shields to a distance of, say, 2 kilometers. Now, you, the mission designer, want to make it so that if any GTVA ship, be it Player or AI, goes beyond this boundary, they are instantly destroyed. Initially, you want to use the "any-friendly" trigger:

Code: [Select]

when
  >
    distance
      any friendly
      Shieldship
    2000
Self Destruct
  err...


And then you realize that you can't go any further, and you have to delete your sexp. In fact, as far as I'm aware, there's no way to do this without individual sexping for every ship in the mission, and it is impossible to do it for ships from outside the first wave, as these can't be referenced by waves. What I was hoping for was some way by which we could trigger a single sexp to fire at any ship that violates our parameters. There are lots of places it could be useful, and could expand what we fredders can do in missions environmentally.

If we did this, it'd also be nice to expand the any ship sexps. Perhaps "any friendly/hostile/unknown/etc. except" sexps, or "any ship in wing" sexps.
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: Lightspeed on May 12, 2004, 06:40:33 am
I've mentioned this before, too.

I hope it's gonna get implemented because it's *very* useful.
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: Goober5000 on May 12, 2004, 08:49:13 am
Intriguing.  I might try my hand at this next.

I might be able to add a sexp like this:
Code: [Select]
for-sexp-object
   [x]
   when
      <
         distance
           
         2000
      self-destruct
         
where
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: Black Wolf on May 12, 2004, 12:00:47 pm
That would be ideal :) My idea was to "paint" the target of the sexp, and then have a second sexp that would affect ships as they were "painted" but this would be far more efficient.
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: Flipside on May 12, 2004, 12:08:32 pm
Would it be possible to pass which ship has activated the Sexp to a variable? So that you can set general 'triggers'?
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: Goober5000 on May 12, 2004, 02:12:38 pm
Code: [Select]
set-variable
   [your variable]
   
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: TopAce on May 12, 2004, 02:25:59 pm
In my opinion, the self-destruct operator should have a second part, which says the message to display in the events window. The default is 'Self destructed', but if you could change it, it would not become apparent you used this SEXP to destroy a ship immediatly. You could diversify your campaign a bit by adding 'Sabotaged', 'Destroyed by unknown reasons', 'Reactor overload', etc. etc.

I have never had any problems with the 'any friendly' thing, but that situation BW told must be tested. At least, I must see if FS is really unable to expound this 'any friendly' something.
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: karajorma on May 12, 2004, 04:22:38 pm
Quote
Originally posted by TopAce
In my opinion, the self-destruct operator should have a second part, which says the message to display in the events window. The default is 'Self destructed', but if you could change it, it would not become apparent you used this SEXP to destroy a ship immediatly. You could diversify your campaign a bit by adding 'Sabotaged', 'Destroyed by unknown reasons', 'Reactor overload', etc. etc.


That's a pretty good idea actually. By making the second part optional (i.e need to use Add Data)  you could do it without breaking existing missions too.

Quote
Originally posted by TopAce
I have never had any problems with the 'any friendly' thing, but that situation BW told must be tested. At least, I must see if FS is really unable to expound this 'any friendly' something.


No need to test. He's correct. You'd need an event for each ship.
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: Flipside on May 12, 2004, 04:24:28 pm
Thanks Goob, I'm not a Fredder so I don't know if that was obvious, but I just wanted to know for an idea I had ;)
Title: Post 3.6 request - Modifying the "any-XXXX" trigger
Post by: TopAce on May 13, 2004, 02:27:20 pm
Quote
Originally posted by karajorma
...No need to test. He's correct. You'd need an event for each ship.


But I prefer seeing how things work myself. The only obstacle is that I keep forgeting things. For example, I only realized that I had downloaded the Hi-res planet pack(By LightSpeed, I think)