Hi all,
I have recently started FREDing again and after re-reading some great tutorials (particularly Axem's) I have become relatively more confident using Prompt Boxes, SEXPs like when-arguments, counting and using random variables, using dynamic waypoints (which are friggin awesome!) and other fun things like that. One mission aspect I want to incorporate more is random location arrivals. Thus I wanted to describe how I am creating that and ask if anyone else could provide some feedback or experience on doing something like this (especially since there are many very, very talented FREDers here!).
For an example, in one of my missions I have a space station with three hangars and I wanted to have three transports escaping from the hangars. I wanted each of the three transports to randomly pick a hangar to leave from then fly in a straight line for 300 m and then jump out. The way I did this was to make three ships in each hangar. For example, in Hangar A I added ships Transport 1#A, Transport 2#A, Transport 3#A and ect for Hangar B and C. To pick the location of Transport 1 I had a variable added to a random number between 1-3. If variable PickTransport1 was =1 then Transport 1#A would spawn. Then I set up a SEXP with a when-argument that stated when Transport 1#A, #B, or #C arrived that two waypoints from Transport Path 1 would be moved to be in front of the ship (with the get coordinates function) at 10 and 300 meters. Then the AI was told to follow the path, and with a similar when-argument told to jump out when one of the 3 (Transport 1#A, #B, or #C) ships had completed that path.
This method worked well, but one caveat is that for any future events with the ship, I would likely have to use a when-argument SEXP (which isn't really a big deal). I also thought of using three small objects like hyperspace buoys as a way to have three possible locations for a ship to jump in. I created a variable and added a random number between 1-3, and then made three events after that that triggered according to the new variables number where each number corresponds to one of the three hyperspace buoys. For example if the variable became a 1, then the buoy 1 event would trigger and change the ship's arrival cues to in front of the chosen buoy.
One method I thought would be completely random would be to literally randomly choose the x, y, z coordinates randomly. So for example I made three variables (RandomX, Y, and Z) that have random numbers chosen from a very large negative number to a very large positive number. The three numbers comprise the coordinates to move a hyperspace buoy with a chained event. The ship then jumps nearby buoy. This was a bit too random though...
What I mainly wanted to ask is if the community had any recommendations, tweaks to the methods I described, tricks they were willingly to share, and/or advice about which might be the overall most efficient and least cumbersome method for making a random ship arrival. Thus, any comments or criticisms would be greatly appreciated.
Thanks!