Welcome To Darwinbots > Newbie
Where have you been all my life?
Boris of Quirm:
Hi guys,
Just stumbled across this a couple of days ago.
What a great concept!! :D
Can see this keeping me busy for quite a while to come yet.
As a starting question, can anyone tell me if there is a way of detecting if you are being shot at?
Thanks again,
Mark
Light:
Hi welcome
There are several sysvars that will record values when you are hit by a shot
shflav - returns the type of shot you have been hit with
shang - returns the angle that the shot hit you, with 0 being forwards
shup - returns a value when hit from the front
shdn - returns a value when hit from behind
shdx - returns a value when hit from the right
shsx - returns a value when hit from the left
hope that helps
Boris of Quirm:
Hi Light!
Thanks for that.
Trying to make a vegetable that will react when it is shot.
May try two versions. One which is passive and moves away then reproduces and another which is aggressive and will fire back before it too runs away and reproduces.
Ulciscor:
Hey Boris :D
Another thing which might help you is the pain sysvar, which returns the amount of energy lost during the last cycle.
I'm not sure but the sh- vars might persist their values even when they aren't being shot at; don't quote me on that though, check with some of the DB veterans.
Boris of Quirm:
I've just created a basic veg that does work but strangely only in Ver2.1. Can't get it to work in the latest version.
DNA for my bot is enclosed:-
--- Code: ---'Alga Preservus
'
'Vegetable
'
'This plant will react if it is shot.
cond
*.shup 0 !=
start
*.refvelup 25 add .up store
50 .repro store
stop
cond
*.shdn 0 !=
start
*.refvelup 25 add .up store
50 .repro store
stop
cond
*.shdx 0 !=
start
*.refvelup 25 add .up store
50 .repro store
stop
cond
*.shsx 0 !=
start
*.refvelup 25 add .up store
50 .repro store
stop
end
--- End code ---
Any suggesttions?
Navigation
[0] Message Index
[#] Next page
Go to full version