Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: bearded on November 05, 2014, 11:39:32 AM

Title: automatic fly to
Post by: bearded on November 05, 2014, 11:39:32 AM
I have a script that does a fly check and then assigns a random destination to fly to. would it be hard to assign nearest enemy instead?
Title: Re: automatic fly to
Post by: stumpy on November 07, 2014, 06:20:44 AM
It's a little hard to be sure what you mean. Is a fly check a test to determine that a character is currently flying (MLOG_IsFlying) or that just that the character can fly (maybe hasAttribute)? For either case, you can get the position of the target object and use Goal_AddMove to tell the NPC to fly there. Depending on the flyer's faction, you can use getNearestHero or getNearestBaddy to find the nearest target object for him to fly to.

BTW, some of the above is assuming FFvT3R with an FFX-enabled mod.