Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: headdie on July 22, 2009, 04:55:35 am

Title: Mine Field
Post by: headdie on July 22, 2009, 04:55:35 am
I was wondering if it would be possible for code to be set up to allow an event to be created along these lines.

Code: [Select]
Make Asteroids Explode
          Everytime
                    <
                       Distance
                                 <Any Friendly>
                                 <Any Asteroid Field Object>
                                 500
                    Self Destruct Nearest Object
then with one asteroid.tbl modification to set damage range and amount you would have a ready made minefield

any thoughts?
Title: Re: Mine Field
Post by: Echelon9 on July 22, 2009, 05:21:05 am
Are you aware of the Minefields (http://www.hard-light.net/wiki/index.php/Minefields) FRED example in the wiki?
Title: Re: Mine Field
Post by: Alan Bolte on July 22, 2009, 12:01:58 pm
Eh, that example is all well and good if you want a small number of stationary individual mines, but if you want the mines to move like asteroids, or you want a minefield with quite a lot of mines, etc., then it doesn't seem like an ideal solution.
Title: Re: Mine Field
Post by: FUBAR-BDHR on July 22, 2009, 12:54:23 pm
Yes this is easily done.  I have something like this (but a bit more complicated) working just fine.  All you need is something like this

Code: [Select]
$Formula: ( when-argument
   ( any-of
      "Streib Auto Turret 1-1"
      "Streib Auto Turret 1-2"
      "Streib Auto Turret 1-3"
      "Streib Auto Turret 1-4"
      "Streib Auto Turret 1-5"
      "Streib Auto Turret 1-6"
      "Streib Auto Turret 2-1"
      "Streib Auto Turret 2-2"
      "Streib Auto Turret 2-3"
      "Streib Auto Turret 2-4"
      "Streib Auto Turret 2-5"
      "Streib Auto Turret 2-6"
      "Streib Auto Turret 3-1"
      "Streib Auto Turret 3-2"
      "Streib Auto Turret 3-3"
      "Streib Auto Turret 3-4"
      "Streib Auto Turret 3-5"
      "Streib Auto Turret 3-6"
      "Streib Auto Turret 4-1"
      "Streib Auto Turret 4-2"
      "Streib Auto Turret 4-3"
      "Streib Auto Turret 4-4"
      "Streib Auto Turret 4-5"
      "Streib Auto Turret 4-6"
   )
   ( not
      ( <
         ( distance
            "<any friendly>"
            "<argument>"
         )
         1000
      )
   )
   ( ship-invisible "<argument>" )
   ( ship-stealthy "<argument>" )
)
+Name: Gun untargetable
+Repeat Count: 999999999
+Interval: 1
+Team: 0

Just change the invisible part to self-destruct.

Oops gave you the wrong one.  You will need to remove the not.  That would destroy all mines not close to any friendly ships. 


Title: Re: Mine Field
Post by: Aardwolf on July 22, 2009, 03:55:17 pm
Also easily doable with Lua scripting.
Title: Re: Mine Field
Post by: Trivial Psychic on July 24, 2009, 02:18:36 am
I'd much rather see a coded solution to minefields, as placing individual mines cuts into the ships-per-mission limit.
Title: Re: Mine Field
Post by: FUBAR-BDHR on July 24, 2009, 01:37:36 pm
Well that wouldn't really be a problem with 400 ships if you could have waves and place them.  For some reason SSGs seem to be the only things you can't have waves of. 

Although I guess you could make them invulnerable, use explosion-effect and move them while the explosion occurs.
Title: Re: Mine Field
Post by: Aardwolf on July 24, 2009, 07:39:04 pm
Escape pods, too.

Anyway, I think minefields are slated as part of an 'Advanced Hazard System' (AHS) for one of the next numbered releases.
Title: Re: Mine Field
Post by: chief1983 on July 26, 2009, 02:01:09 pm
Don't count on that.  I don't think anyone is working on AHS or has been for some time.
Title: Re: Mine Field
Post by: Tolwyn on July 26, 2009, 04:33:37 pm
Me thinks Kazan wanted to work on it and since he's no longer active...
Title: Re: Mine Field
Post by: chief1983 on July 26, 2009, 06:33:14 pm
Probably, and since half the coders in that roadmap are no longer active or working on the same projects as they were back then, it really doesn't serve much of a purpose anymore.
Title: Re: Mine Field
Post by: Nuke on July 27, 2009, 10:18:11 am
you could probibly just script asteroids to do the job, then use asteroids with a model that looks more like a mine.