Bots and Simulations > DNA - General

Chameleon genes

<< < (2/2)

Jez:
Ok, think I've figured it out...

It takes two turns to store each value!

So the order of activations is:

1.Sees enemy:
Stores value of 0 in 51 (G4)

2.Next turn,
Stores value of 604 in 51 (G4)

3.Next turn,
Stores value of 604 in 52 (G2+3)

4.Next turn,
Stores value of 8741 in 52 (G2+3)

Continues with (G2+3) no change to values.

If I add the line *.reqmemval 0 = to gene 2 then it won't reach step 4 leaving me with 604 in both 51 and 52. (604 in mem location 604)

If this is how it's meant to work, (memval reads the location stored in memloc last turn) then I think I can work around it and will update Wiki syvars.  

PurpleYouko:
Yes I believe that is how it works.

It's been a long long time since I tinkered with that bit of code. As I recall I had a hell of a lot of trouble trying to get it to work on one cycel. The problem is that all sysvar senses are loaded at the beginning of the cycle, before the DNA is parsed in the main loop so by the time the main loop knows it has to look for a value in a specific memory location, it's too late to do so immediately so it has to do it next itme around.

You should be able to do it in 3 steps tho instead of 4. You can change the value in .memloc on the same cycle that you read the value in the old memory location. Might save you a bit of time.

Numsgil:
Yes memloc loads the memory value into memval the next cycle.  memloc is more like a request to read the value of a mem location than a way to immediately read it.

Navigation

[0] Message Index

[*] Previous page

Go to full version