Author Topic: carnivore gene  (Read 1395 times)

Offline Ispettore

  • Bot Neophyte
  • *
  • Posts: 32
    • View Profile
carnivore gene
« on: October 24, 2007, 12:43:06 PM »
Hello... I don't know if I can post here this request...
I'd like just to have a carnivore gene... so that the bot with it can't eat veggies... and I also would like to have the gente from T preseverant that avoid killing veggies... can you help me?

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
    • http://www.franontanaya.com/blog/
carnivore gene
« Reply #1 on: October 24, 2007, 01:27:21 PM »
The old and most common way of checking if a target is a veggie is checking its number of eyes. Veggies usually doesn't have them:

*.eye5 0 >
*.refeye 0 =

Then you use that condition (or negate it *.refeye 0 !=) in the targetting and hunting eyes to avoid them.

To avoid killing the target, check it's energy, like:

*.refnrg 500 >
Sometimes you win, and sometimes you lose...

Offline Ispettore

  • Bot Neophyte
  • *
  • Posts: 32
    • View Profile
carnivore gene
« Reply #2 on: October 25, 2007, 12:15:45 PM »
could you please make me an example of where should I put it in the eat gene? I'm not very good ad bot programming  

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
carnivore gene
« Reply #3 on: October 25, 2007, 01:04:00 PM »
For example in the shooting gene.

Quote
cond
*.eye5 25 >
*.refeye 0 !=
start
-1 .shoot store
stop

explanation

cond:             start gene
*.eye5 25 >    check oponent close
*.refeye 0 !=   check is it a veggy if not go thru
start                go if conditions are true
-1 .shoot store  :shoot
stop                   :end gene


for just changing a bot behaviour to herbovore
put this in the shooting gene.Between cond and start.
Quote
*.refeye 0 !=

Hope this helps.
Oh my god, who the hell cares.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
carnivore gene
« Reply #4 on: October 25, 2007, 01:11:13 PM »
for the T-preservants
the gene

  *.refnrg  500  >

This one checks if the veggie has enough energy to survive. And this condition(between cond and start)
has then to be put in every shooting gene.
Just as the carnivoures gene.

The complete gene

cond
  *.eye5  49  >
  *.refdn  20  <
  *.refnrg  500  >(.......<---------the one it's about.)
  *.refshoot  0  =
start
  -1  .shoot  store
stop
Oh my god, who the hell cares.