Author Topic: Where have you been all my life?  (Read 4241 times)

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Where have you been all my life?
« on: November 24, 2005, 05:40:10 AM »
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
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Light

  • Bot Destroyer
  • ***
  • Posts: 245
    • View Profile
Where have you been all my life?
« Reply #1 on: November 24, 2005, 06:32:25 AM »
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

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Where have you been all my life?
« Reply #2 on: November 24, 2005, 06:39:29 AM »
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.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Where have you been all my life?
« Reply #3 on: November 24, 2005, 06:51:39 AM »
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.
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Where have you been all my life?
« Reply #4 on: November 24, 2005, 06:56:45 AM »
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: [Select]
'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

Any suggesttions?
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Where have you been all my life?
« Reply #5 on: November 24, 2005, 09:48:10 AM »
Version 2.1 doesn't have alot of the sysvars you're using.

No one really uses 2.1, it's just the only installer we ever managed to make.  2.37.6 (or whichever is the latest 2.37) I would say is the standard at the moment.  2.4 acts weirdly in comparison (alot of differences bots have a hard time adjusting to) but you should still check it out sometime.

And welcome aboard.  ;)

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Where have you been all my life?
« Reply #6 on: November 24, 2005, 10:32:33 AM »
Hi Numsgil.

I do have 2.4 but as you say it does behave differently.
The bot I've posted works okay in 2.1 but not 2.4.  Will try in 2.37 ans see if that helps.

Forgot to mention a bit about myself in my intro.  I used to be a programmer for a number of years, mainly VB and VB script.  For fun during our lunch breaks we used to design small fun apps and try to add a hint of intelligence. Some of our greatest achievments were an artificial person who would talk to you and learn better english from your response (written in VB and SQL) and a version of top trumps which I wrote using excel!

Hope to be of some use to you in the future but for now will stick to building interesting plants.
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!

Offline Boris of Quirm

  • Bot Neophyte
  • *
  • Posts: 45
    • View Profile
Where have you been all my life?
« Reply #7 on: November 24, 2005, 10:49:33 AM »
Just tried 2.37 and everything seems ok.

Cheers
Why do computer programmers celebrate Christmas at Halloween?

Because Dec 25 is equal to Oct 31!!