Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Lorric on January 30, 2012, 09:00:44 pm

Title: Can you change AI scripts mid-mission?
Post by: Lorric on January 30, 2012, 09:00:44 pm
This is just a curiosity I have. I don't even need an explanation on how to do it or anything. I just wonder if it's possible. It could be used in contexts such as...

*Reinforcements have arrived*

"Alright! The advantage is ours now! Attack!"
"Boot's on the other foot now!"

*Allied morale is soaring!*

*All allied units AI changes from "Captain" to "Colonel"*

Or maybe something like "The enemy have never lost a battle when the XXX has been involved. So we're going to destroy that ship and crush their morale."

*XXX destroyed*

"The enemy are panicking! Destroy them!"

*All enemy units have AI changed from "Captain" to "Lieutenant"

or "The Shivans are nothing without their commander. We take out XXX, and they will collapse, just like when we destroyed the Lucifer."

*XXX destroyed*

"Crush them!!!"

*All enemy units have AI changed from "Captain" to "Coward".

I have no intention of making such a mission, I've never made any mission (any proper mission anyway), but it would be a way for the player to effect meaningful change in a BOE mission. It would work for any mission, but I thought I'd mention that.
Title: Re: Can you change AI scripts mid-mission?
Post by: Sushi on January 30, 2012, 10:55:44 pm
There's a change-ai-class SEXP that should do what you're looking for (or maybe set-ai-class, one of the two).
Title: Re: Can you change AI scripts mid-mission?
Post by: Lorric on January 31, 2012, 09:01:53 am
There's a change-ai-class SEXP that should do what you're looking for (or maybe set-ai-class, one of the two).

So it can be done. Thanks.