Hard Light Productions Forums

Hosted Projects - Standalone => The Babylon Project => Topic started by: madaboutgames on April 27, 2006, 07:35:23 am

Title: Advanced fred question
Post by: madaboutgames on April 27, 2006, 07:35:23 am
In the EMW - Earth Minbari War campiagn the minbari ships use stealth tec, so the ea have trouble locking on.  I have currently set the minbari to be invisible to sensors, but what i would prefer to do if possible is - set all minbari ships so that when targeted by player, the target is lost after 1 or 2 seconds. I want to use this everytime a minbari is targeted.
For example when i target a minbari fighter, it would be targeted and show up i the target window, but after 1 or 2 seconds of targeting that fighter, the target resets and nothing is targeted.  This would happen every time the player would target a minbari ship.  This would give a better look and feel to just steeing the minbari as hidden from sensore.

Anyone have any ideas how to do this, or a variable that would do the trick?

Cheers in advance  ;)
Title: Re: Advanced fred question
Post by: Shade on April 27, 2006, 08:40:33 am
Yep, that is pretty advanced :p You need three things: two events and a variable. One event to make ships stealthy shortly after they've been targeted, one to unstealth them again afterwards, and the variable for timing the second event to go off a few seconds after the first instead of immediately, as otherwise the target won't be lost.

Make a variable called Mission_Time and initialize it to 0, then set up the events as follows.

Stealth Event:

-op every-time-argument
  -op any-of
    - <list of ships to be regularly untargeted>
  - op targeted
    - <argument>
    - 2
  - op ship-stealthy
    - <argument>
  - op modify-variable
    - Mission_Time(0)
    - op mission-time



Unstealth Event:

-op every-time-argument
  -op any-of
    - <list of ships to be regularly untargeted>
  - op and
    - op is-ship-stealthy
      - <argument>
    - op <
      - op +
        - Mission_Time(0)
        - 2
      - op mission-time
  - op ship-unstealthy
    - <argument>



That will do the trick. Here is a test mission (http://www.fileh.com/dkshade/targettest.zip) I made that shows it in action.
Title: Re: Advanced fred question
Post by: karajorma on April 27, 2006, 09:06:55 am
I was all happy when I saw a topic called Advanced FRED Question and then all unhappy that Shade got to it before me :p

Good answer. It's going straight into the FRED Cookbook next time I update the FAQ :)
Title: Re: Advanced fred question
Post by: madaboutgames on April 27, 2006, 09:18:46 am
Great stuff, cheers.  I will give it a try tonight.  You might even even earn yourself a place in the credits :)
Title: Re: Advanced fred question
Post by: Trivial Psychic on April 27, 2006, 04:01:47 pm
IIRC, ship-stealthy requires that the ship have $stealth: in its tables.  The Nial doesn't.  You may want to use ship-invisible instead, which results in it appearing as a flashing red dot on the radar, but can't be locked-on to.  BTW, Den5's ITB campaign, has Minbari ships untargettable ONLY at their first meeting.  I guess he found combat with that many untargettable Nials to be too difficult.
Title: Re: Advanced fred question
Post by: Shade on April 27, 2006, 04:11:12 pm
It works fine - I tested it with Dragons before posting. Or try the test mission and see for yourself :)
Title: Re: Advanced fred question
Post by: madaboutgames on April 28, 2006, 04:53:30 am
Started putting the 15th mission together last night so i decided to try the targeting in that mission using nials, sharlins and lintras.  Didnt seem to work right, I will try trivs suggestion tonight using ship invisible.  The solution should work though as the test mission supplied worked fine.  In dens campiagn he used untargetable in the first mission only then targetable in the rest.  I went by how ITB played out and the B5 epsiodes relating to the Earth Minbari war.  In the EMW campiagn, the first mission is targetable as in ITB, when they first meet the minbari they have trouble with scanners locking on.  They could target them in the first one until the Minbari went mad and put their stealth tech to good use.  After the first mission the minbari use the stealth tech wich makes them quite hard to locate and dogfight with which is why earth didnt do so well in the war.  I have adopted this idea in EMW as I want to keep it as close as possible to ITB and have some enjoyable gameplay at the same time.  Den probably took the opposite approach because it is quite difficult to takt out minbari fighters when you cant lock on.  This is why using this targeting system would be more realistic and like ITB.  It makes it easier for the player because they can target the minbari but only for a couple of seconds at a time.  At least the player will momentarily be able to locate minbari fighters which will point them in the right direction as well as seeing how much hull they have left, distance etc.  I think this approach would be better than targeting the minbari as this defeats the facts of the earth minbari war.
Title: Re: Advanced fred question
Post by: Dwin on April 28, 2006, 09:08:20 pm
I dont think that will be very good for gameplay. Personally, I'd find it fustrating to have to repeatedly lock on to the target. It's frustrating enough as it is trying to hit them, the last thing I need is difficult in simply maintaining a lock.
Title: Re: Advanced fred question
Post by: Trivial Psychic on April 29, 2006, 08:26:42 am
One could always have enemies untargettable (IE, ship-invisible) beyond a certain distance, say 500m.