Freedom Reborn

Freedom Force Forums => Scripting Forum => Topic started by: DoctorRuina on August 23, 2024, 01:25:20 PM

Title: Problems with the characters' AI
Post by: DoctorRuina on August 23, 2024, 01:25:20 PM
Hi friends! I always have problems with the characters' AI. For example, many times the characters stand there like fools or try to move away to throw a projectile and fail. How can I make them launch their projectiles at melee range?
Title: Re: Problems with the characters' AI
Post by: stumpy on August 24, 2024, 09:24:14 AM
Is this with FFvt3R? If so, my recollection is that IG made a change when they released the game that set a minimum distance for using ranged attacks. It was much complained about and we discovered a fix in scripting. The fix was setting
import ff
ff.RANGED_MIN = 0.5
in one of the startup files.

If you install FFX, this will be set up for you. (FFX does this in System/localinit.py, if you are looking to do this without FFX.)
Title: Re: Problems with the characters' AI
Post by: DoctorRuina on August 24, 2024, 09:56:24 AM
Thanks for the quick response, stumpy. Yes, I use FFvt3R. And I have installed FFX too. But I don't see this command in localinit.py. Should I write it there?
Title: Re: Problems with the characters' AI
Post by: oktokels on August 24, 2024, 02:38:26 PM
Quote from: DoctorRuina on August 23, 2024, 01:25:20 PMHi friends! I always have problems with the characters' AI. For example, many times the characters stand there like fools or try to move away to throw a projectile and fail. How can I make them launch their projectiles at melee range?
Can you post the AI code of the character here to take a look at it?
Title: Re: Problems with the characters' AI
Post by: stumpy on August 24, 2024, 09:40:40 PM
Doc, maybe open the localinit.py you are using and post the contents? That will help determine what it needs. Also, post the full path of that file. It's possible it's not in the right spot or it's being ignored for some reason. Mine has those two lines I posted, though it has other lines between them. I don't recall if mine is the default that we included with FFX or if I customized it.
Title: Re: Problems with the characters' AI
Post by: DoctorRuina on August 25, 2024, 07:55:43 PM
Quote from: oktokels on August 24, 2024, 02:38:26 PM
Quote from: DoctorRuina on August 23, 2024, 01:25:20 PMHi friends! I always have problems with the characters' AI. For example, many times the characters stand there like fools or try to move away to throw a projectile and fail. How can I make them launch their projectiles at melee range?
Can you post the AI code of the character here to take a look at it?
Thanks oktokels! These problems usually happen to me with all characters.. I want to learn how to do AI well to solve all these problems.
Title: Re: Problems with the characters' AI
Post by: DoctorRuina on August 25, 2024, 07:56:54 PM
This is my localinit.py

#
# IGA system initialisation file
#
import js
import ff
ff.Language = 'English'
ff.AI_STEADY_EP_THRESHOLD = -1.0
# Startup Plugins Importer; info in the StartupPlugins folder
try:
    import startupplugins
except:
    pass
Title: Re: Problems with the characters' AI
Post by: stumpy on August 27, 2024, 01:09:54 AM
I would try adding
ff.RANGED_MIN = 0.5right below the "THRESHOLD" line.
Title: Re: Problems with the characters' AI
Post by: DoctorRuina on August 31, 2024, 02:31:19 PM
Thanks a lot, stumpy. I think that with this the way the game works has changed.