Darwinbots Forum
Code center => Darwinbots Program Source Code => Topic started by: Endy on April 04, 2005, 06:09:27 PM
-
I was goofing around with the sysvars file and found that I could add my own sysvar to the file and could latter reference it. Like def but no extra code required ;)
Example:
myvar
50
I was wondering what were the rules exactly for editing the file further.
Endy B)
-
Yep, you can do that. Of course that makes sharing your bot difficult.
The sysvars file currently can only hold 200 sysvars. Other than that, play around to your heart's content.
-
Like Num said, the problem is that your bot would be uncompatible with anyone else's sims unless you also share the sysvars file.
Just imagine how messy that would get :blink:
-
Cool. :) I was planning on just changing some of the main memvals I use. They're easy enough to change back with notepad's "replace" ability.
Endy B)
-
? It's possible to define specific memlocs in the DNA right? So if I want a dutch version of main sysvars I could do:
def voor 1
def achter 2
def schiet 7
Because these are translations... (http://dictionary.reference.com/translate/text.html)
Is that possible or can one only define undefined memlocs?
Henk :help:
-
You can only define memory locations that are not already used by the sysvars list.
-
? It's possible to define specific memlocs in the DNA right? So if I want a dutch version of main sysvars I could do:
def voor 1
def achter 2
def schiet 7
Because these are translations... (http://dictionary.reference.com/translate/text.html)
Is that possible or can one only define undefined memlocs?
Henk :help:
That should work actually. The sysvar defines what words are turned into what numbers. I don't think there's anything that would stop that from working.
-
? It's possible to define specific memlocs in the DNA right? So if I want a dutch version of main sysvars I could do:
def voor 1
def achter 2
def schiet 7
Because these are translations... (http://dictionary.reference.com/translate/text.html)
Is that possible or can one only define undefined memlocs?
Henk :help:
That should work actually. The sysvar defines what words are turned into what numbers. I don't think there's anything that would stop that from working.
It will work and it won't work!
What actually happens is that you will be allowed to define system variables in this way but when the program decodes it to display the DNA in the robot details window or saves the DNA file then all instances where you used your defined variable instead of the sysvars equivalent, will be shown as the sysvars version.
For example try running this simple little test bot.
def testword 1
cond
start
10 .testword store
stop
end
Run it and you will see the robot moves forward just as if you had stored the value into .up
Now double click a robot and look at its DNA. It looks like this now.
cond
start
10 .up store
stop
end
Your custom variable has been translated back to the sysvar equivalent automatically.
-
Imagine translating the actual sysvars file.
Doing that should work, because the words themselves are only referenced through the sysvars.
Open up sysvars and rename "up" as "ooglbat". Make a bot that uses "ooglbat" instead of "up".
It should work exactly as a bot that uses up would.
-
Right.
That would work perfectly until you try to share the bot with someone who has a normal sysvars file. Then the whole thing will just stop working and replace all the non-standard sysvars in the DNA file with "0"s
-
DB translated to other languages. :lol:
Just kidding.
Endy B)
-
Yeah, it would make sharing incredibly difficult. But I'm just saying you _can_ do it.
-
hmm , I have been searching for somthing like that:
Disassembly into vb, for a while, no luck yet...
-
You would be surprised at how much of it already is in more than one language. A whole bunch of the code and most of the forms are in Italian. They get translated to English by use of resource files containing all the form headings and text output messages.