Jump to content

Corral trickle food


Recommended Posts

Trying to enable the corral food trickle with an aura. This is what I have for the aura.

  <Auras>    <Aura1>      <Type>garrisonedUnits</Type>      <Affects>Animal</Affects>      <Modifications>        <ResourceTrickle.FoodRate>	  <Add>1</Add>	</ResourceTrickle.FoodRate>      </Modifications>      <AuraName>Corraling and Ranching</AuraName>      <AuraDescription>Garrison Domestic Animals within the Corral to enable a slow trickle of Food.</AuraDescription>    </Aura1>  </Auras>

The problem is I cannnot make the sheep garrison into the corral.

The corral's garrison code looks like this:

  <GarrisonHolder>    <Max>10</Max>    <EjectHealth>0.1</EjectHealth>    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>    <List datatype="tokens">Animal</List>    <BuffHeal>1</BuffHeal>    <LoadingRange>4</LoadingRange>  </GarrisonHolder>

And all fauna animals (including sheep) have "Animal" as a class. So, the corral should be able to garrison the sheep inside it for me to test the aura, but I cannot make the sheep go into the corral. What could be the cause here? I see nothing in the fauna templates that says they cannot garrison into something.

Link to comment
Share on other sites

Can you garrison other units in the corral? (To narrow the problem)

Good question.

When I change the corral's garrison class list from "Animal" to "Unit" I can garrison other units inside, but still not the sheep.

EDIT:

When I change the aura to a radius instead of garrisonedunit, the aura works. But we want to be able to garrison the animal inside the corral. The game is not letting me do that.

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

Just a random guess:

What would happen if you would put the sheep template in the Units folder and change its class to 'Unit' (and removing Animal)?

This is not a good solution. It should all be Class-based and should work just fine as it is. Also, the sheep already has the "Unit" class. lol. But just to try, I made a sheep in units/ and gave changed its civ from gaia to cart (the civ I am trying it on),and even that didn't work (so, the civ probably isn't the problem... probably, and its folder is not the problem).

Edit: what do you call work? For every sheep the food trickle speed increases?

Yes. When I change it to a ranged aura the nearby sheep start to give you a trickle of food. But we want it to be a garrisoned aura. I can't garrison a sheep inside the building regardless of what the aura is or even if there is no aura. And even if the code says I should be able to garrison a unit of 'Animal' class. :) Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

It wasn't meant as solution, it was meant to discover the error.

Yeah I know. I also tried removing the animal class from the sheep (didn't work). Removed the Domestic class (I couldn't move the sheep at all). I've tried all kinds of things.

So, I abandoned trying to make it work with a sheep and gave the war elephant the trickle code and garrisoned a war elephant into the corral. Did not work. The Wiki claims that all the tech effects should be usable as auras. This does not seem to be the case with all kinds of auras or every effect.

So, we have two issues:

  1. Sheep are not allowed to be garrisoned.
  2. The aura does not work with garrisoned units (but does if aura is changed to ranged). EDIT: It works (!) with garrisoned units, but only if I add a visible prop point. So, this aspect mostly works. So, now the issue is just #1. Cannot garrison Animal or Domestic class units into a Corral.
Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

  <GarrisonHolder>    <Max>10</Max>    <EjectHealth>0.1</EjectHealth>    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>    <List datatype="tokens">Animal</List>    <BuffHeal>1</BuffHeal>    <LoadingRange>4</LoadingRange>  </GarrisonHolder>

That is the <List datatype="tokens">Animal</List> line in the code.

Link to comment
Share on other sites

I had two patches fully functionnal, so you should find what you need there:

- either using the garrison approach (corral.diff patch)

- or using the corral and corralSupply component (corral-v4.diff patch)

Looking at the UnitAI file in corral.diff and comparing to the current file, it looks like UnitAI has changed quite a bit in 19 months. But I think UnitAI is where the problem of Animal garrisoning happens.

  • Like 1
Link to comment
Share on other sites

Animal garrisoning is just the beginning of the problems that static 0AD will encounter. Have one with structures.

Animal does have its own state in UnitAI. Haven't looked at the code, but if I remember correctly, then look for mimo's ANIMAL.* additions and add them.

A hack could be to add the UnitAI component to your sheep. Always works but it's a hack and 0AD team will kill you (and me for proposing).

Link to comment
Share on other sites

This was a success by inserting Mimo's UnitAI code by hand. However, there is now weird behavior of the sheep "wandering" in place and their selection circles wandering around the map. lol,

Aura and Animal garrisoning now work (see the extra food on the top left).

post-16580-0-27743500-1417318505_thumb.p

UnitAI.zip

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

I don't know if you already did something analoguous, but in my patch I also added <EjectHealth>0.7</EjectHealth> for the corral as corrals should not protect (too much) sheeps for enemy raids.

I actually saw what you did in your patch! Figured out why you did that and agreed. :) I lowered it to 0.5 in my mod. Would also make more sense too if the buildings caught fire when damaged, so the sheep would want to evacuate. loll

Another bad behavior: I cannot double-click and select all the sheep. This also happens with units propped on a Fortress or wall.

EDIT:

Okay, I tried in the sheep template to put roamdistance to 0 and this is what I get:

ERROR: CXeromyces: Parse error: (null):0: Extra element FeedTimeMax in interleaveERROR: CXeromyces: Parse error: gaia/fauna_sheep:1: Element UnitAI failed to validate contentERROR: RelaxNGValidator: Validation failedERROR: Failed to validate entity template 'gaia/fauna_sheep'ERROR: Failed to load entity template 'gaia/fauna_sheep'

So, I think the solution is to somehow flag the domestic animals to turn off roaming when garrisoned. I can't "hack" this behavior unfortunetly.

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...