Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: kage on April 14, 2007, 10:16:47 PM

Title: Would this work?
Post by: kage on April 14, 2007, 10:16:47 PM
Could I use this if I wanted my bot to shoot nrg towards fellow bots when it was full of nrg anyways, to serve as a kind of medic?

Code: [Select]
' Medic Gene
cond
 *.eye5 0 =
  *.nrg 32000 >
  *.refeye *.myeye = or
start
-2 .shoot store
 *.refvelup .up store
stop
Title: Would this work?
Post by: abyaly on April 14, 2007, 11:13:19 PM
This gene would execute
If [(eye5 > 0) && [(nrg > 32000) || (refeye = myeye)]]

So the *.nrg 32000 > part will always be false since you cant have more than 32000 energy.
But the gene would still execute every time the bot sees a conspec, reguardless of how much energy it has.
Title: Would this work?
Post by: kage on April 15, 2007, 09:52:28 AM
So then maybe set it down to like 25000?
Title: Would this work?
Post by: Numsgil on April 15, 2007, 08:12:15 PM
Probably, though the conditions are still odd.  The way it works now, the bot would fire nrg out only after[/ the conspec it saw is no longer visible.

I would change it to something like:

' Medic Gene
cond
  *.eye5 0 >
  *.refeye *.myeye =
  *.nrg 25000 >
start
-2 .shoot store
*.refvelup .up store
stop
Title: Would this work?
Post by: Light on April 19, 2007, 06:00:10 AM
maybe add in *.refnrg 1000 < to only shoot at bots that are low on energy