Author Topic: Some AIing Help  (Read 758 times)

Offline Urjak

  • *
  • Posts: 2753
  • Rep: 6
  • Shell Spinner King
    • http://www.youtube.com/wa
    • View Profile
    • Awards
Some AIing Help
« 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. 
Any comments would be appreciated. :D

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: Some AIing Help
« Reply #1 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.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings

Offline cephalopod

Re: Some AIing Help
« Reply #2 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 (:
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15