Author Topic: Help  (Read 3395 times)

Offline Darwin226

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Help
« on: October 30, 2008, 04:53:26 PM »
cond
*1 0 =
start
40 .aimdx store
1 1 store
stop


When I run the sim, this gene is always active. How can that be? In the condition it says to activate if 0 is stored in 1.
When it activates, 1 is stored to 1 but is still activates.

I think it's because location 1 is used by .up.

If that is the problem then can someone tell me which numbers can I use from my own memory?

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Help
« Reply #1 on: October 30, 2008, 05:45:35 PM »
Yes, 1 is in use and is one of the sysvars that recet every cycle (So you don't need to store 0 in up to stop accelerating).
Some sysvars are always 32000 in the case where storing 0 should cause an action. (You can check this by double clicking a bot and looking at it's memmory.)

And there is a range the dev team promissed not to mess with, I think it's like 50-175 or something like that (I usualy stay around the midle of that range).
Also on the sysvars page you can see all memmory locations, anything not in use is free (But may get reserved with later updates, whereas the above mentioned won't be used any time soon).

Also a good tip, used defines instead of magic tweek values, atleast for locations and constants that you'll be using in several places or plan to spend time tweeking.

For example :

'constants
def shotBoost 10
def conspecKey 56789

'variables
def keyLocation 110
def turned 111

start
*.robage 0 =
.conspecKey .keyLocation store
.keyLocation .memloc store

*.eye5 0 =
*.memval .conspecKey = or
*.turned 0 = and
40 .aimdx store
1 .turned store

*.eye5 0 !=
*.memval .conspecKey != and
-1 .shoot store
.shotBoost .shootval store
stop
« Last Edit: October 30, 2008, 06:26:54 PM by Moonfisher »

Offline Darwin226

  • Bot Neophyte
  • *
  • Posts: 18
    • View Profile
Help
« Reply #2 on: October 30, 2008, 06:35:00 PM »
Does that mean I can make my own variables with names?

Like instead of using 1 40 store I could use 1 .myveryownvar store.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Help
« Reply #3 on: October 30, 2008, 10:13:06 PM »
yep.  You use "def" at the start of your DNA.  Something like this:

def myval 1 (or is it def 1 myval?  I can never remember).

Offline Shasta

  • Administrator
  • Bot Destroyer
  • *****
  • Posts: 231
    • View Profile
Help
« Reply #4 on: October 30, 2008, 10:56:16 PM »
Quote from: Numsgil
yep.  You use "def" at the start of your DNA.  Something like this:

def myval 1 (or is it def 1 myval?  I can never remember).

You have it right; it is def myval ___

Moonfisher is also correct:
Quote
Memory locations between 50 and 175 are the traditionally used custom variables, and have been guaranteed not to be replaced with a sysvar in the future.
From Here
« Last Edit: October 30, 2008, 10:57:33 PM by Shasta »