gametechmods
Robot Arena => General Support => Topic started by: Resetti's Replicas on August 12, 2017, 10:06:02 PM
-
So I've been trying to AI a forklift-weapon bot using the Forklift.py (https://github.com/apanx/RA2_AI/blob/master/Forklift.py) but my bot won't drop the forks after the first time it raises them. I've tried setting linacuslength to various things with no success. 'm unsing the Medium2" length DSL servo piston. Any help is greatly appreciated.
-
Enable debug mode, tell me then what the forklift part is trying to do.
class SuperAI(plus.AI):
"Python base class of the C++ AI."
name = "No Name"
debugging = True #plus.isDebugMode()
-
Sorry, can you talk me through how to enter debug mode and use that? I'm not much of a coder.
-
Open __init__.py in AI and change the lines in the SuperAI class as shown in the last post. You should now get a debugwindow at the left upper side of the screen when running AI'd bots. You can check what the Forklift AI is trying to do, i.e lifting, or lowering forklift.
-
It says "Lift" whenever a bot touches its smartzone, and "Stop" when there isn't, and it doesn't lower the forks again. If I touch it again after the forks have been raised, it says "Lift."
(https://gametechmods.com/uploads/images/61360indef.png)
-
Did you put in ID for the servo pistons, LinAcus to control?
Like this:
list.append( ("ForkliftDemo", "Forklift", { 'LinAcus': [1], 'LinAcusLength': [-0.6],'weapons': (2,) }) )
-
Do I use the the [] brackets for those?
-
yeah, so if the servo/LinAcu ID is 8
you put
'LinAcus': [8]
-
Ok, now it says "Descend" but it still stays up. I've tried several 'LinAcusLength' settings, positive and negative. Am I supposed to wire it with a "Descend" button? I was using one analog control for it.
If it's not too much trouble, could I have the test-bot you made that has a working forklift?
-
Stock bot, Get it here (https://gametechmods.com/forums/index.php?action=downloads;sa=view;down=376)
-
Thanks for the help apanx, I've pinpointed what i was doing wrong. Specifically, the robot has to be in the smarzone area in order for the forks to drop - I had thought it worked like the crusher AI where it automatically releases when there's nothing in the smart zone.