BCU main page Bridge Commander Universe
...welcome to the new world.
 
 FAQFAQ  RanksRanks  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  Staff SiteStaff Site    RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What is this??

 
Post new topic   Reply to topic    Bridge Commander Universe Forum Index -> BC Scripting
View previous topic :: View next topic  
Author Message

Mongooser

Cadet 4th Class
Cadet 4th Class




Joined: 20 Aug 2006
Posts: 14

Offline

 

 



Reply with quote

Post Posted: 09-05-2006 05:42 AM Post subject: What is this??

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
View user's profile Send private message

Sim Rex

Moderator
Moderator


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

Offline

 

 



Reply with quote

Post Posted: 09-05-2006 06:45 AM Post subject:

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
View user's profile Send private message Send e-mail

Mongooser

Cadet 4th Class
Cadet 4th Class




Joined: 20 Aug 2006
Posts: 14

Offline

 

 



Reply with quote

Post Posted: 09-05-2006 07:31 AM Post subject:

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
View user's profile Send private message

MLeo

Fleet Admiral
Fleet Admiral


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

 

 



Reply with quote

Post Posted: 09-05-2006 02:43 PM Post subject:

In addition to SimRex's post, self is usually the reference to the instance of the class that it's currently acting on.

So self.SomeFunction usually means that the function is included in the code, so you can see exactly what it does.


_________________

How to beat the Black Screen Of Death and Script problems Also handles Console/Screen/Error report/dump.
BC Technical FAQ [Last updated 26/12/2005]
"Trust me, I'm a con artist" - Moist von Lipwig, "Going Postal, Discworld"

Back to top
View user's profile Send private message Send e-mail MSN Messenger

Sim Rex

Moderator
Moderator


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

Offline

 

 



Reply with quote

Post Posted: 09-05-2006 04:27 PM Post subject:

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 Wink


_________________
"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
View user's profile Send private message Send e-mail

Mongooser

Cadet 4th Class
Cadet 4th Class




Joined: 20 Aug 2006
Posts: 14

Offline

 

 



Reply with quote

Post Posted: 09-05-2006 07:57 PM Post subject:

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic

All times are GMT

Page 1 of 1
   Bridge Commander Universe Forum Index -> BC Scripting
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group
Bridge Commander Universe is a Nightsoft company. All rights reserved.