Author Topic: "Invalid procedure call or argument"  (Read 2986 times)

Offline Trafalgar

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
"Invalid procedure call or argument"
« 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 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)
« Last Edit: July 09, 2007, 01:16:26 PM by Trafalgar »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
"Invalid procedure call or argument"
« Reply #1 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.