Bots and Simulations > DNA - General
Using venom to make a bot shoot nrg
Testlund:
I'm trying to use venom to make a bot release all it's energy in random directions. How do I do that? I've tried this but it doesn't work:
--- Code: ---cond
100 *.venval <
start
100 .strvenom store
stop
cond
*.eyef 0 >
*.refshoot 0 =
start
-3 .shoot store
.aimsx rnd .shoot .vloc store
-2 .venval store
stop
--- End code ---
Testlund:
I found out myself. I have to use different eye distance values to be able to use more than one venom shot and to make it use feeding shots afterwards.
--- Code: ---'*********************
'* Venemous Predator *
'* *
'*********************
cond
*.robage 0 =
start
67 .memloc store
101 67 store
0 .fixpos store
stop
cond
*.venom 50 <
start
1 .strvenom store
stop
cond
*.nrg 32 >
start
16 rnd .aimsx store
16 rnd .aimdx store
.up inc
stop
cond
*.eye5 0 >
*.memval *67 !=
*.refeye 0 >
*.reftie 0 =
*.reffixed 0 =
*.venom 16 >
start
*.refxpos *.refypos angle .setaim store
*.refvelup .up inc
stop
cond
*.eyef 5 >
*.eyef 20 <
*.memval *67 !=
start
-3 .shoot store
.aimsx .vloc store
314 .venval store
stop
cond
*.eyef 20 >
*.eyef 30 <
*.memval *67 !=
start
.fdbody .vloc store
128 .venval store
stop
cond
*.eyef 30 >
*.memval *67 !=
*.venom 100 <
start
128 .shootval store
-1 .shoot store
stop
cond
*.eye5 0 >
*.memval *67 =
start
314 rnd .aimright store
stop
cond
*.eye5 0 >
*.refeye 0 =
*.reftie 0 > or
start
-314 rnd .aimright store
stop
cond
*.shflav -1 =
*.shflav -6 = or
start
*.refxpos *.refypos angle .setaim store
.fixpos .vloc store
1 .venval store
-3 .shoot store
32 .dn 314 rnd .aimright store
stop
cond
*.body 16000 <
*.nrg 8000 >
start
2 .strbody store
stop
cond
*.body 16000 >
*.nrg 8000 >
start
50 .repro store
314 rnd .aimright store
stop
end
--- End code ---
It would be nice if I also could make a bot explode into a cloud of nrg shots.
Shadowgod2:
first it will never store up venom with that because 100 will never be less than -2
cond
*.venom 100 <
start
100 .strvenom store
stop
now this here is a mess
cond
*.eyef 0 >
*.refeye *.myeye != '(or whatever you want to use as recognizing)
start
-3 .shoot store
1 rnd 6 add .vloc store
-2 *.vloc 2 add sgn -1 mult 1 add mult 314 rnd *.vloc 6 sub sgn 1 add mult add .venval store
stop
random turn and a random -2 shot
i hope you have a good targeting system
...well fine then post while i'm posting lol
Testlund:
Actually ".strvenom" is correct.
http://wiki.darwinbots.com/w/.strvenom
Thanks for the code though. I will check it out.
Shadowgod2:
oop sorry i kinda got use to mk and forgot str
edit: the cond was a bit off though
Navigation
[0] Message Index
[#] Next page
Go to full version