Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: Trafalgar on July 09, 2007, 12:32:30 PM

Title: "Invalid procedure call or argument"
Post by: Trafalgar on July 09, 2007, 12:32:30 PM
I have a test bot script which has a problem in it somewhere, which I know because when I try to start a new simulation with it, DB says "Invalid procedure call or argument. Path: (the path to that bot) is not a valid robot."

My question is this: Why doesn't it say what's invalid, and what line it's on?

Edit: Wait... What the hell? If I remove all the comments in the .txt, DB accepts the robot. O_o

Edit #2: Seems to be caused by having lines which start with '#, e.g.:
Code: [Select]
'# This foos the bar when it's zorting.
Edit #3: From digging in the source, I tracked the cause to a bit of code which explicitly checks for lines starting with '# and tries to load stuff from them. I seem to have unintentionally ran into an undocumented (at least, it isn't mentioned in the readme (http://www.darwinbots.com/WikiManual/index.php?title=Readme) anywhere) feature which was going bonkers over my comments.

The reason I had comments starting with '# is because I've made a python script/program which converts semi-python-like robot DNA into DB robot DNA, and when it converted a comment (#) in the pythonish DNA, it wrote out the entire comment (including the #) with a ' before it. (Once I figured out that the '# was causing the error, I changed it to not write out the leading #s)
Title: "Invalid procedure call or argument"
Post by: Numsgil on July 09, 2007, 04:17:20 PM
The # are for hashes.  When you save the DNA of a bot a certain way, it'll save information about the bot (number of generations, etc.) as a hash.