Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Redstreblo on June 11, 2010, 01:18:22 am
-
Hello, I have a question about AI Player Orders. Basically what happens is the player is playing as Aries 2 (custom wing names) and Aries 1 gets destroyed in a scripted event. At the start of the mission the player has no control over any ship and can only call support. I want him to be able to take control of the other ships and be able to tell them "attack my target" "cover me" "warp out" etc, durring the middle of the mission.
Is this possible? :confused: If it is how would I go about doing this?
-
There is a SEXP under status called 'time-elapsed-last-order'. This SEXP detects when Aries 2 (player) is trying to send orders to other AI. You could use this sexp to detect when Aries 2(player) is trying to send orders to his/her wingmen. Stop the player's orders from taking effect by using 'clear-ai orders', followed by a chained event which reissues the current mission's orders (whatever the orders were before). you can use trigger count or repeat count to make sure this happens more than once. That's kind of complicated though.
Another thing you can do is make the priority of the default orders over 100 until Aries 1 dies. You can have the players' orders trigger messages using 'time-elapsed-last-order' such as: "Who do you think you are? squadleader?" to give the player the idea that his wingmen won't follow his orders. When Aries 1 dies, lower the priority of the initial orders below 89 so the players orders take effect. You can do this using 'clear-ai orders' followed by a chained event that re-issues the same orders at a lower priority.
I hope this was helpful, sounds like an interesting idea.
-
Hmm. This doesn't address the problem with the orders being available/unavailable on the comms menu. The first one has them never available, the second one has them always available but ignored.
I simply love the concept of a field promotion, though, and I'd like to hear what some of the advanced FREDders can do with it.
-
There is no way that I know of to carry this out directly, unless the player can be assigned to a new ship (rather than changing the player's ship class, the player's POV is literally moved to a new vessel.)
There are lots of roundabout hacks to kind of imitate this behavior, but no way to genuinely cause greyed out orders to suddenly appear.
-
Hm. Could there be a way to swap out ships in-mission, that are not allowed player orders, with new ones that are? Since it's mission 1, the team loadout is fixed, so there shouldn't really be any difference between two ships with the same hull strength.
-
Hm. Could there be a way to swap out ships in-mission, that are not allowed player orders, with new ones that are? Since it's mission 1, the team loadout is fixed, so there shouldn't really be any difference between two ships with the same hull strength.
Wouldn't that mean I would need to create a hundred different events? I would need the event to have lines and lines of SEXPs to make sure that the swapped model will have the same hit-points, be in the same position and appear instantaneously with player orders turned on on top of all of that stuff.
-
I've been meaning to make an Allow-Orders SEXP for a while now because as far as I know there is no way to change the allowed orders in-mission and that's rather dumb.
-
Aha. I suppose we can wait for that, then.
Here's what I would do in the mean time... make the player Aries 3. Then make sure both Aries 1 and Aries 2 bite the dust, and have Command promote the player to leader of Aries wing. There won't be any fighters left to command, so there's no problem. :)
In later missions the players is Aries 1 and has command of Aries wing's loadout and orders, but not of Virgo or Cancer. In a few more missions, he can be promoted to squad leader and have the full range of orders available to him for all friendly fighters and bombers in the mission.
-
@Karajorma: That would be awesome. And preferably not hackish.