Code center > Darwinbots Program Source Code

Questions on Sysvars File

<< < (2/3) > >>

PurpleYouko:
You can only define memory locations that are not already used by the sysvars list.

Numsgil:

--- 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...

Is that possible or can one only define undefined memlocs?

Henk  :help:
--- End quote ---
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.

PurpleYouko:

--- 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...

Is that possible or can one only define undefined memlocs?

Henk  :help:
--- End quote ---
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.
--- End quote ---
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: ---def testword 1

cond
start
10 .testword store
stop
end
--- End code ---

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: ---cond
start
10 .up store
stop
end
--- End code ---

Your custom variable has been translated back to the sysvar equivalent automatically.

Numsgil:
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.

PurpleYouko:
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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version