Modding, Mission Design, and Coding > The FRED Workshop

Collecting FRED tricks

(1/2) > >>

xenocartographer:
It occurred to me recently that there doesn't seem to be a place to share simple FRED tricks - there's the wiki tutorial section, aye, but not everything warrants an entire tutorial page, and an easily-scrolled-through list can't hurt, either. With that in mind, here are a couple of mine. Post your own!




Un****ing support ships in escort missions

Ah, we've all had that experience - the NTF/Vasudans/Shivans/random anime bull****/whatever attack on the GTCv Primary Objective has slackened off, and it's a great time to rearm, except the support ship is 6432653464 kilometers in some useless direction because the AI doesn't know to follow you. Let's fix that.


--- Code: ---( when-argument
   ( any-of "Support 1" "Support 2" "Support 3" "Support 4" "Support 5" )
   ( is-in-mission "<argument>" )
   ( add-goal "<argument>" ( ai-guard "GTCv Primary Objective" 20 )  )
   ( invalidate-argument "<argument>" )
)
--- End code ---

As soon as a support ship hits the field, we give it a low priority guard order on the most important friendly ship. (This could also be an installation or the player, depending on the type of mission.) This guard order won't interfere with its ability to rearm things, as those are issued at a higher priority, and once its done rearming, the highest priority order will be the guard order once again.



script-eval-block and <argument>

This one's a little hypothetical, but, put simply, if one argument to script-eval-block is just <argument>, it'll be replaced like any other. This can be used quite nicely with Axem's in-mission jump script:


--- Code: ---( when-argument
  ( any-of "Alpha 1" "Alpha 2" "Alpha 3" "Alpha 4" "Support 1" )
  ( < ( hits-left "<argument>" ) 40 )
  ( script-eval-block ( "IMJump:To('" "<argument>" "', '" "<argument>" " runs away')" )
  ( invalidate-argument "<argument>" )
)
--- End code ---

Pay attention to the quotes!



Guardianing the player's comms

This isn't so much a trick as something I've been wishing would become standard practice ever since BtA did it. Guardianing the player's comm system at 1% is almost completely mechanically irrelevant (it does mean the player will eventually regain the ability to issue orders even without a support ship, but eh), and saves the frustration of arbitrarily missing out on plot points.

0rph3u5:
Randomly placed random props

Sometimes you just need an extra layer of props lying around in mission which is just nice to have but not essential to mission - abandoned cargo containers, adrift fighters, random sensor blips or maybe an odd discarded "warhead" (not a secondary but a "ship" with the model and stats of a torpedo; please consult your modeler if it works for you). Because it is always a pain to come up with a random distribution on your own and to handcraft it, how about letting the engine to do heavy lifting?

(You might want the player to face away from where this happening for the first second of the mission or block their view. Using this on large objects is not recommended as it will be quite noticeable.)

This takes care of the initial random distribution and orientation:


Taken from an acutal missions, the dimensions of the box in which you want to distribute the objects as well as the number of objects can be adjusted to your needs.

And this makes sure stuff doesn't crash into things right away or is placed into other ships:


The distance for the inital check should be scaled to your needs. Re-orienting an object isn't strictly neccessary.



ps. And now we wait how long it takes for karajorma to tell me that I am using the argument-part wrong :)

karajorma:
The argument part is fine. I'd suggest setting the interval time to zero though. It's unlikely but otherwise you could see an object bouncing about every second until it finally comes to rest in some empty space where it isn't near anything else. Setting it to zero means the event would be checked every frame rather than every second, which means that you might possibly get a tiny glitch in the first second of the mission at worst.

MitoPL:
And you can hide that glitch by starting a mission with a short fade-in effect. I've definitely saw something like that effect somewhere out there, it looked pretty nice.

Axem:
This looks like a good thread to sticky.

I wish I had some that came to mind. After using FRED for so long, things are less "tricks" and more "this is obviously how its done #humblebrag" :cool:

I'll have to go over my old missions and see if there's anything sort of generic enough that might apply to other people...

Navigation

[0] Message Index

[#] Next page

Go to full version