Bots and Simulations > Bot Tavern
Is there something wrong with this
Houshalter:
Look at this gene
--- Code: ---start
*.reffixed 0 =
*.refnrg 10000 > and
*.eye5 40 < or
*.refshell 0 > or
*.memval *.refmulti 100 mult add *.refkills 2 div add *.refpoison 1000 div add *.refshoot add *.refeye add *.reftie add *.avgfitness <= or
*.totalbots *.totalmyspecies sub 100 > and or
157 .aimdx store
not
*.refxpos *.refypos angle .setaim store
stop
--- End code ---
It <you>should</you> make the bot turn when theres nothing worth looking at and set its focus on the bot in focus otherwise. But no matter what I try it just wants to turn around endlessly . If your wondering what kind of bot this is for, its for a sheperd bot im creating. By the way, .avgfitness is a custom variable which refers to the average fitness of the last ten bots hes seen.
Edit: somethings wrong with the post system, I tell it to underline a word and it puts you's on both sides of it in <> signs then it auto spell checks the you's into you's.
bacillus:
The last and or statement could be your problem. The and counts the whole command stack, the or is then left with nothing.
Houshalter:
So how do you "or" two independent conditions together eg;
a 1 >
b 1 > and
c 1 >
d 1 > and
now I want it to activate when both or either of these two conditions are true? Is there any way to do that
<you>Now Im going to try to get it to under line these words</you>
bacillus:
the boolean operators take the top two booleans from the stack and add the result to the stack. So it would look like this:
[A]
and
[C]
[D] and or
to elaborate, the first and adds A and B; then, the second and adds B and C, those being on top of the stack. You can then or the two results together.
I'm getting the underline thing too...
Houshalter:
So you mean do something like this?
--- Code: ---start
*.reffixed 0 =
*.refnrg 10000 > and
*.memval *.refmulti 100 mult add *.refkills 2 div add *.refpoison 1000 div add *.refshoot add *.refeye add *.reftie add *.avgfitness <= or
*.totalbots *.totalmyspecies sub 100 > and or
*.eye5 40 < or
*.refshell 0 > or
157 .aimdx store
not
*.refxpos *.refypos angle .setaim store
stop
--- End code ---
Edit: Wait scratch that...
--- Code: ---start
*.reffixed 0 =
*.refnrg 10000 > and
*.memval *.refmulti 100 mult add *.refkills 2 div add *.refpoison 1000 div add *.refshoot add *.refeye add *.reftie add *.avgfitness <=
*.totalbots *.totalmyspecies sub 100 > and or
*.eye5 40 < or
*.refshell 0 > or
157 .aimdx store
not
*.refxpos *.refypos angle .setaim store
stop
--- End code ---
I mean this.
Navigation
[0] Message Index
[#] Next page
Go to full version