Bots and Simulations > DNA - General

help

<< < (3/4) > >>

MrMound:
is there a way to ref a costom sysvar in another bot? like using .type as and example would I be able to see if .type is 2?

Numsgil:
You mean from the console?  have you tried:

? .type

If that doesn't work, you probably need to use the actual memory location.

If you mean the bots themselves, you could use memloc and memval.  Are you familiar with them?

PurpleYouko:
yes there is a way to do this.

By using .memloc and *.memval, it is possible to read any memory location in a viewed bot.

Something like this would do it.

--- Code: ---def type 50
def readtype 51

cond
*.eye5 0 !=
start
.type .memloc store
*.memval .readtype store
stop
--- End code ---

this should save whatever value that the viewed robot has in memloc 50, into your own memloc 51. You can then read it in later genes as *.readtype.

Don't quote me on this. It has been a couple of years since I tried this last so I can't remember precisely how it works.

Memloc/memval are probably the least used sysvars in the whole genome. I have never seen a robot use them.

MrMound:
this gene should change .type's value to 3 if the nrg is < 10000 right?

--- Code: ---cond
*.type 3 =
*.nrg 10000 <
start
1 .type store
stop
--- End code ---

I use a gene like this and I think it works but not that one ^.

--- Code: ---cond
*.type 1 =
*.nrg 20000 >=
start
3 .type store
stop
--- End code ---

PurpleYouko:
The gene that you listed will change the type from type 3 to type 1 if energy is less than 10,000.

The second gene will change .type from 1 to 3 if energy is greater than/equal to 20,000

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version