Darwinbots Forum

Code center => Darwinbots Program Source Code => Topic started by: Endy on April 04, 2005, 06:09:27 PM

Title: Questions on Sysvars File
Post 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)
Title: Questions on Sysvars File
Post by: Numsgil on April 04, 2005, 06:35:13 PM
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.
Title: Questions on Sysvars File
Post by: PurpleYouko on April 04, 2005, 07:17:27 PM
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:
Title: Questions on Sysvars File
Post by: Endy on April 04, 2005, 11:22:04 PM
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)
Title: Questions on Sysvars File
Post by: Old Henk on April 05, 2005, 09:55:40 AM
? 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:
Title: Questions on Sysvars File
Post by: PurpleYouko on April 05, 2005, 11:29:48 AM
You can only define memory locations that are not already used by the sysvars list.
Title: Questions on Sysvars File
Post by: Numsgil on April 05, 2005, 03:26:52 PM
Quote
? 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.
Title: Questions on Sysvars File
Post by: PurpleYouko on April 05, 2005, 05:12:43 PM
Quote
Quote
? 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.

Code: [Select]
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.

Code: [Select]
cond
start
10 .up store
stop
end

Your custom variable has been translated back to the sysvar equivalent automatically.
Title: Questions on Sysvars File
Post by: Numsgil on April 05, 2005, 06:11:02 PM
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.
Title: Questions on Sysvars File
Post by: PurpleYouko on April 05, 2005, 09:15:15 PM
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
Title: Questions on Sysvars File
Post by: Endy on April 05, 2005, 11:11:11 PM
DB translated to other languages. :lol:

Just kidding.

Endy B)
Title: Questions on Sysvars File
Post by: Numsgil on April 05, 2005, 11:51:02 PM
Yeah, it would make sharing incredibly difficult.  But I'm just saying you _can_ do it.
Title: Questions on Sysvars File
Post by: Botsareus on April 06, 2005, 02:33:05 PM
hmm , I have been searching for somthing like that:

Disassembly into vb, for a while, no luck yet...
Title: Questions on Sysvars File
Post by: PurpleYouko on April 06, 2005, 02:39:04 PM
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.