Extending another bot

AI discussion, ideas, and SDK help.
Post Reply
User avatar
SunTzu
Lux Cartographer
Posts: 1586
Joined: Sat Jan 14, 2006 1:48 am
Location: Maryland

Extending another bot

Post by SunTzu » Tue Jul 31, 2007 9:39 am

If I wanted to create a new bot, but wanted to use some of the methods of Defender, is there a way I could just link to it? That way, if I make changes to Defender it would automatically update the new bot.

I noticed in the SDK that some bots extend other bots, and I noticed things called backer and super. Can anybody shed some light on this subject?

User avatar
Black Pope
Lux Exorcist
Posts: 3878
Joined: Tue Sep 06, 2005 5:36 pm
Location: God's Right Hand
Contact:

Post by Black Pope » Tue Jul 31, 2007 9:56 am

I think if you run a plum line through the spectrometer you should be able to recalibrate the sensors on the warp drive.

Hope this helps!

User avatar
guest
Luxer
Posts: 189
Joined: Fri Dec 17, 2004 9:17 pm
Location: Southern NH
Contact:

Post by guest » Tue Jul 31, 2007 3:17 pm

http://java.sun.com/docs/books/tutorial ... tance.html


Its not always about knowing. Sometimes its what to ask or were to look.

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10915
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Tue Jul 31, 2007 4:34 pm

It can be done, but due to the way Lux loads agents, you'd have to install a second copy of Defender just for the agent that subclasses it. So you wouldn't automatically get the new version when the installed Defender is updated.

BotOMatic extends BotOfDoom, and if you install BOM you'll notice it creates some folders in the Agents folder to keep another BOD.

User avatar
SunTzu
Lux Cartographer
Posts: 1586
Joined: Sat Jan 14, 2006 1:48 am
Location: Maryland

Post by SunTzu » Wed Aug 01, 2007 9:25 am

Black Pope wrote:I think if you run a plum line through the spectrometer you should be able to recalibrate the sensors on the warp drive.
Wow Pope, I never knew you were a trekkie! :wink:

Thanks for the info guest! That website was a big help for me when I started teaching myself Java. I just didn't know how Lux handled inheritance.
dustin wrote:It can be done, but due to the way Lux loads agents, you'd have to install a second copy of Defender just for the agent that subclasses it. So you wouldn't automatically get the new version when the installed Defender is updated.
So if I have a set of specialized methods that I want all of my bots to use, I should just include them in every agent class, rather than putting them in another class and referencing it?

User avatar
Black Pope
Lux Exorcist
Posts: 3878
Joined: Tue Sep 06, 2005 5:36 pm
Location: God's Right Hand
Contact:

Post by Black Pope » Wed Aug 01, 2007 11:56 am

Trek ROCKS. The best is SNG...all else bows before it.

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10915
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Wed Aug 01, 2007 2:49 pm

SunTzu wrote:So if I have a set of specialized methods that I want all of my bots to use, I should just include them in every agent class, rather than putting them in another class and referencing it?
You can do it that way, or you can do it the way BOM/BOD do it. Both have their pros and cons.

Post Reply