Welcome To Darwinbots > Newbie
Hello, I'am new and I've got a virus question.
Peter:
Hello everybody, I'm new and I've got some questions.
I don't speak english everyday, so my grammar isn't that well, I hope you can understand it.
How can you use a virus to hurt an enemy, but how can you let the virus know when it's inside your own bot, and than to deactivate itself if it is.
This steals slowly the energy of a bot. I only want it to steal energy from the enemy's.
Now there's a second question if you stop the motherbot from firing the virus in this way, can you use another gen to create a virus with it.
--- Quote ---'Small but with increasing numbers inside a cell will steal more and more nrg.
cond
start
.vshoot inc
*.thisgene .mkvirus store
stop
--- End quote ---
I've got this virus out of the wiki, if you were asking. I just want to now how to properly use it.
Numsgil:
The idea is to use conditionless programming to multiply the destination of the store to make it 0 when you don't want it to activate. See this page on the wiki.
Peter:
--- Quote from: Numsgil ---The idea is to use conditionless programming to multiply the destination of the store to make it 0 when you don't want it to activate. See this page on the wiki.
--- End quote ---
Well, thanks I don't get completly how this can help me, but I found at the virus wiki something (very simple) to put into the bot. Simple and works.
--- Quote ---cond
*.robage 0 =
start
7 989 store
stop
--- End quote ---
bot
--- Quote ---cond
7 *989 !=
--- End quote ---
virus
Well, to say the truth, I don't get much from the conditionless bots section.
--- Quote ---20 .up *.hit mult store
.hit *.hit mult dec
--- End quote ---
All I see is a number some stars(or how do you call these(*) and some words. Store it is storing, hit it is hit, mult to multiply, up to go up I gues. Dec ?? no idea. Why would this, so says the explanation go up when it's hit. When up is in front, it looks to me kinda strange if he is only going up when hit is true, becouse up is in front of the code.
Numsgil:
If the asterisks (* aka stars ), dec, and other DNA bits throw you for a loop, it might be a good idea to read through the documentation of the DNA before starting with something like viruses. Walk before you run Check out this wiki page and look up any commands that you don't understand.
Jez:
20 .up *.hit mult store
.hit *.hit mult dec
Conditionless bots use maths to do stuff rather than conditions. It's up to you which method you choose in the end.
Asterisks (*) reads you the value of a location so *.hit gives you the value of the .hit location (sysvar 201) (sysvar = system variable)
The value of .hit, will be either 1 or 0 so the first line (20 .up *.hit mult store) will only move if *.hit returns the value of 1 (otherwise .up (sysvar 1) will be multiplied by 0 and return sysvar 0 which doesn't exist)
The second line uses dec (decrease) to subtract 1 from .hit but only if *.hit = 1, (otherwise multiply sysvar by 0 again)
As a maths equation it would read (20 (.up *.hit mult) store) and ((.hit *.hit mult) dec)
The maths is all done in Polish Reverse Notation by the way so instead of;
1 + 2
it's;
1 2 +
Bit strange to start with but you'll soon get used to it!
Neither dec (decrease) or inc (increase) need a store to change a sysvar unlike most other operations.
Hope that helps a bit.
sysvars can be found here
Navigation
[0] Message Index
[#] Next page
Go to full version