gametechmods

Robot Arena => General Support => Topic started by: Urjak on July 14, 2011, 09:43:50 PM

Title: Some AIing Help
Post by: Urjak on July 14, 2011, 09:43:50 PM
I was curious as to whether or not there was a way to AI a bot (in my case a vertical spinner) to stop spinning one of the parts is knocked off it weapon (thus preventing it from vibrating erratically from an unbalanced disk or bar).


Any response would be appreciated. 
Title: Re: Some AIing Help
Post by: Clickbeetle on July 24, 2011, 05:15:57 PM
It's possible, but will require a small bit of python trickery.
 
You'd need to set some variable equal to len(self.weapons) in def Activate.  Then in def Tick, you tell it to spin if that variable == len(self.weapons), and if not, to stop.  Like so:
 
def Activate
 
self.initWepCount = len(self.weapons)
 
def Tick
 
if self.initWepCount == len(self.weapons):
    self.Input("Spin", 0, 100)
else:
    self.Input("Spin", 0, 0)
 
Also this needs to be wired with an analog control and you need to set all the weapon ID's on the VS in 'weapons' in Bindings.py.
Title: Re: Some AIing Help
Post by: cephalopod on July 24, 2011, 05:18:35 PM
Wow, that's a good idea. If someone coded that and released it, I'd be grateful o.o (: