Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Looking for answers not in Terrarium FAQ
 

Looking for answers not in Terrarium FAQ

Hi,
I've been trying to find an answer to coule of questions about
Terrarium.  I was wondering if you would know.

I am getting this error when I try to compile for this line
[AnimalSkin(AnimalSkinFamilyEnum.Spider)]
No overload for method 'AnimalSkinAttribute' takes '0' arguments

Am I not including something I need to include?


Can I determine if a carnivore is one of my carnivores?  IE if I made
one named trapdoorspider can I determine if another carnivore it
sees is a trapdoorspider?

Can herbivores attack?  If not can they defend a target creature and deal damage without that creature attacking?
I've seen creature examples that have a call to BeginDefend and immediately call.BeginAttack.  What is the difference between the attacking and defending if they both do damage?  If I made a herbivore that detects if it is getting attacked what's the difference between having the herbivore BeginAttack vs. BeginDefend


Last, is camoflauge always on.  When a creature is moving is it more
likely to be seen?  (you can see why this would be important for a
trapdoorspider)


Thanks
Kevin Jonas  Monday, August 01, 2005 6:33 PM
It's been awhile since I've played with Terrarium, but I'll give your questions a shot...

Q: [AnimalSkin(AnimalSkinFamilyEnum.Spider)] causing compile error.
A: The enum was renamed to AnimalSkinFamily (without the Enum) a few versions ago. Try:
[AnimalSkin(AnimalSkinFamily.Spider)]

Q: Can I determine if a carnivore is one of my carnivores?
A: There is a method bool Animal.IsMySpecies(target).

Q: Can herbivores attack?
A: Yes, they can attack, but they are not as good at it as carnivores.

Q: What is the difference between BeginAttack() and BeginDefend()?
Defending reduces the amount of damage that you take. Attacking doles out damage.
http://www.windowsforms.net/Terrarium/docs/OrganismSDK/default.aspx?currentPanel=Chapter13GoingtoBattle

Q: Is camoflauge always on?
A: It is, but I'm not sure sighting is based strictly on camoflauge, distance, and eyesight, or if it also depends on movement.
James Kovacs  Monday, August 01, 2005 8:47 PM
It's been awhile since I've played with Terrarium, but I'll give your questions a shot...

Q: [AnimalSkin(AnimalSkinFamilyEnum.Spider)] causing compile error.
A: The enum was renamed to AnimalSkinFamily (without the Enum) a few versions ago. Try:
[AnimalSkin(AnimalSkinFamily.Spider)]

Q: Can I determine if a carnivore is one of my carnivores?
A: There is a method bool Animal.IsMySpecies(target).

Q: Can herbivores attack?
A: Yes, they can attack, but they are not as good at it as carnivores.

Q: What is the difference between BeginAttack() and BeginDefend()?
Defending reduces the amount of damage that you take. Attacking doles out damage.
http://www.windowsforms.net/Terrarium/docs/OrganismSDK/default.aspx?currentPanel=Chapter13GoingtoBattle

Q: Is camoflauge always on?
A: It is, but I'm not sure sighting is based strictly on camoflauge, distance, and eyesight, or if it also depends on movement.
James Kovacs  Monday, August 01, 2005 8:47 PM
Q: Can I determine if a carnivore is one of my carnivores?
A: There is a method bool Animal.IsMySpecies(target).

I saw this, but doesn't that just say if it is also a plant, herbivore, or carnivore?  Reading the docs it doesn't sound like it distinguishes my carnivore from other carnivores.  So if target is a carnivore, whether it be mine or someone else's, it will be true.  I want to know if I can detect my carnivores.
Kevin Jonas  Tuesday, August 02, 2005 6:06 PM
Animal.IsMySpecies(target) only returns true if the two creatures are instances of the same class. For example, if you had two carnivore types, GreatWhiteShark and ManEater:

// pseudo-code - Terrarium does the instantiation for you
GreatWhiteShark gws1 = new GreatWhiteShark();
GreatWhiteShark gws2 = new GreatWhiteShark();
ManEater me1 = new ManEater();

bool sameSpecies = gws1.IsMySpecies(gws2); // returns true
sameSpecies = gw1.IsMySpecies(me1); // returns false

You should always check:

if(!this.IsMySpecies(target)) {
   // attack code goes here
}
James Kovacs  Tuesday, August 02, 2005 6:59 PM
Not sure you care, but to further expand on the "can herbivores attack".  The answer is "it depends".

Herbivores can attack only if they are either hungry or they are attacking a bug that attacked them in the previous tick.  Note: If you were attacked in the previous tick, the "Attacked" event fires in the current tick.
dkocur2  Wednesday, August 03, 2005 8:39 PM
So, in otherwords, an herbivore can only attack a carnivore that has attacked it.  There's no way for a herbivore to attack another herbivore?
Kevin Jonas  Thursday, August 18, 2005 5:52 PM
No.  An herbivore is limited to a counter-attack only if they are not hungry.  If they are hungry they can attack to their hearts content.
dkocur2  Thursday, August 18, 2005 6:48 PM

You can use google to search for other answers

Custom Search

More Threads

• Naka and Mari - Is Terrarium fun over ?
• Error compiling
• Newbie...problem and questions
• Who's still using Terrarium?
• Reporting in Vb.Net
• Auto-Updating DataBindings
• Source Code
• cannot log in with jdoe & welcome
• Sounds interesting but looks dead
• Server Download?