Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Trafalgar

Pages: 1 ... 7 8 [9]
121
DNA - General / "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)

122
Tips and Tricks / Hibernation
« on: July 09, 2007, 11:28:26 AM »
Quote from: abyaly
Convert all conditional operators as follows:
>   -> sub sqr dup div
I don't get this. Why wouldn't dup div always return 1 (unless the value was 0), since any number (except 0) divided by itself is 1?
(In other words, it looks to me like it would act like a != instead of a >)

Pages: 1 ... 7 8 [9]