View previous topic :: View next topic |
|
Author |
Message |
Mongooser
Cadet 4th Class

Joined: 20 Aug 2006
Posts: 14

|
|
|

|
|
|
if self.NeedToAvoid( pShip, fPersonalSpaceRadius, pObject ):
This is an excerpt from the avoidobstacles preprocess. I want to know, where do i find out what exactly self.NeedToAvoid does? How does it choose whether to avoid pObject or not? Is there a massive list of these "functions" or whatever they are? (is self.NeedToAvoid a function or what is it?)
|
|
|
Back to top |
|
 |
Sim Rex
Moderator


Age: 26
Zodiac: 
Joined: 11 Apr 2002
Posts: 1714

|
|
|

|
|
|
Take a look in Scripts/AI/Preprocessors.py... That's where the code for the preprocesses is...
|
_________________ "Could it be it's the end of our world? All the things that we cherish and love
Nothing left but to face this all on my own, cause I am the chosen one!"
-- The Fallen Angel - Iron Maiden(Smith/Harris)
For beginner scripters - The BCU Mission Scripting Lessons
|
|
Back to top |
|
 |
Mongooser
Cadet 4th Class

Joined: 20 Aug 2006
Posts: 14

|
|
|

|
|
|
That line came from inside the .py file, it doesn't say how exactly it works or what it does. Anyways, i have another question:
" ***NOTE: The script for this preprocess is only used
# for setup. Once the AI containing it is created, it's
# replaced with an optimized version in the code."
What does this mean? Replaced with an optimized version in the code ... that means that no matter what i change in the preprocess it will end up working like the optimized version? I need to know how to either change the optimized version or stop it from going straight to the optimized version =/
|
|
|
Back to top |
|
 |
MLeo
Fleet Admiral

Age: 22
Zodiac: 
Joined: 26 Nov 2002
Posts: 11439
Location: Netherlands

|
|
|
|
Back to top |
|
 |
Sim Rex
Moderator


Age: 26
Zodiac: 
Joined: 11 Apr 2002
Posts: 1714

|
|
|

|
|
|
What is it that you're trying to do, anyway? Is this to do with the flying in formation project?
I really wouldn't recommend modifying preprocessors.py... The function you're looking for is defined on line 1769 of that file. I think MLeo's description explains what self.FunctionName is pretty well, so I'll leave that alone.
If you're looking to modify the AvoidObstacles AI, it would be a better idea to create a subclass of AvoidObstacles to include your changes... Then you can assign a new AI to ships flying in formation, which will include your modified AvoidObstacles AI. Let me know if that didn't make any sense to you 
|
_________________ "Could it be it's the end of our world? All the things that we cherish and love
Nothing left but to face this all on my own, cause I am the chosen one!"
-- The Fallen Angel - Iron Maiden(Smith/Harris)
For beginner scripters - The BCU Mission Scripting Lessons
|
|
Back to top |
|
 |
Mongooser
Cadet 4th Class

Joined: 20 Aug 2006
Posts: 14

|
|
|

|
|
|
Hey i finally figured it out. I have ships flying not in formation but at least they dont mind sticking close together, so quickbattle is looking much more like the fleet battles from DS9. Anyways, the avoid obstaceles preprocessor is replaced by an optimized version. The optimized version is part of the game code and i was not able to find where it is or how to modify it, so i had to make a subset avoidobstacles AI myself to get my changes to work. What a waste of time, for 2 weeks i was changing shit but having no effect on the game (except for the stuff that is carried over by the optimized version).
Anyways, its working now and i am on my way towards getting this fleet mod done for kobyashi maru. It is already looking very sweet and has a much more cinematic feel. Putting in actual formations is beyond my knowledge of python so unless one of the more experianced scripters wants to work on it, i don't forsee formations being added. However, after i have the basic mod completed im sure there will be some more interest in the project.
Screenshots to come as i get things balanced =).
|
|
|
Back to top |
|
 |
|