# nose is "front" of bot- #Nose paradigm: All 360 rotational degrees for "math.pi" are represented by the factor '2'. #thus: '2'=360degrees, '1'=180degrees, '0.5'=90degrees, '0.25'=45degrees. #The direction of change(CW/CCW)is determined by the "-" or "+" before the statement. #thus: '+' causes rotation CCW, '-' causes rotation CW. #Format examples: # " 'nose':math.pi*0.25 " will rotate the bot 45degrees/CCW. # " 'nose':-math.pi*0.25 " will rotate the bot 45degrees/CW. # " 'nose':math.pi*0.5 " will rotate the bot 90degrees/CCW. # " 'nose':-math.pi*0.5 " will rotate the bot 90degrees/CW. # " 'nose':math.pi*0.75 " will rotate the bot 135degrees/CCW. # " 'nose':-math.pi*0.75 " will rotate the bot 135degrees/CW. # (Make sure there is a comma(,)after the the value # (to separate it from the next characteristic and its value). #(-----notes-----) # Note1: "math.pi" AND 'nose':math.pi*1.0 " AND " 'nose': -math.pi*1.0 " will rotate the bot 180 degrees. # (The first two are the same, and the last two just rotate different directions to get 180 degrees.} # Thus there is no real reason to have a factor greater than '1', # since after that you just move into the other half of the circle covered by the other '+' or '-' sign. # Note2: "math.pi*0" or "math.pi*2" = the same as no new heading.
Attaching Smart Zones ...
where '2' is the component sequential assembly number. Use Apanx's Exporter to find the motor's number, and add it here.
You got my vote for RA2 Wizard. Always and forever.
Nice work, Phil.
So to save you from dupping work, look at this AI.py that I wrote specifically for ACAMS Machine-gun mounted atop a self-aiming servo motor, and also has automatic repeating fire
...,'weapons':(1,2,3,4,5,6,7,8,9)}))
def Activate(self, active): if active: ... goon = 1 i = 0 self.weapons = [] while goon == 1: if i == self.GetNumComponents(): break # to verifiy if i == ... or i > ... currentType = self.GetComponentType(i) if currentType == "Weapon": self.weapons.append (i) i = i+ 1 return AI.SuperAI.Activate(self, active)
def __init__(self, **args): AI.SuperAI.__init__(self, **args) self.SpinTrigger = "Spin" self.ServoTrigger = "Servo" ... def LostComponent(self, id): # if we lose all our weapons, stop using the Engage tactic and switch to Shove if id in self.weapons: self.weapons.remove(id) if len(self.weapons) < 4 : # i have 2 motors mounted on a tri-bar extender. # the last bar contains a hammer. # my self.weapons list contains the Id of the weapons. # when only 3 weapons remains, i swith my controler # to make my servomotor spin much like a normal motor # so the AI that controls the servo become useless # my bot turn to a 'normal spinner' self.SpinTrigger = "Servo" self.ServoTrigger = "NOP" # does nothing self.SpinSpeed = 100 return AI.SuperAI.LostComponent(self, id)
Fields of investigation : does the lostcomponent function is called for each component lost or only for weapons ? What happens if one put Id of motors or other components in its self.weapons list ?