You must be logged in to post messages.
Please login or register

Modding Discussions
Moderated by Alexastor, MosheLevi, Mister SCP

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Rice Paddy-like building
posted 10-15-08 11:24 PM EDT (US)   
Experienced modders, can you please help me with a problem I'm having.

I wanted to make a building that was similar to the Rice Paddy in that you could switch between gathering Food and gathering Gold, with the additional extra that you can also switch to gathering Wood... so one building from which to gather Food, Gold and Wood. However it seems that one of the new modding no-nos is that you can't make a building function like the Rice Paddy.

So my new concept was a building that starts out just for Food, then with an upgrade it becomes just for Gold, then with another upgrade it becomes just for Wood. But I'm not sure how I could make this work. Is there a way to turn off one resource and turn on another from a building? Alternatively, is there a way to replace a building with another one, so that the upgrade tech just switches buildings?

Any help or alternative suggestions would be appreciated.
Replies:
posted 10-15-08 11:51 PM EDT (US)     1 / 10  
Well... you could make it an autogatherer... so it starts out only gathering food.
The first techs does -100% to food... and +whatever to gold... same for the wood upgrade.

Not sure on if it'll work properly if you want to make it so vils have to work on it.
Just guessing here... just throwing some stuff out there.

Basically, take the mill proto... ditch the 'Food' UnitType

You'll have this...
CarryCapacity...
InitialResource...
Add wood and gold into that, but set both to '0' for each.

First tech sets food carry/initial-resource to '0', gold to x/y
Likewise for wood.
You may have to add the new building to the settler gather proto, not sure, I've never created a gatherable resource building.

The first idea will work for sure, try the second one though.
You cannot make a new mill/farm/plantation with proper animations. Villagers won't walk around it (only applies to TWC and TAD)
That's the only problem I see with it really....
Try it out.

edit... damn thing edits out me pointy brackets... lame.

[This message has been edited by TwentyLemon (edited 10-15-2008 @ 11:53 PM).]

posted 10-16-08 01:43 AM EDT (US)     2 / 10  
First tech sets food carry/initial-resource to '0', gold to x/y
Likewise for wood.
That's what I thought. Do you know the code that would set this though? I couldn't find an example anywhere else.
You cannot make a new mill/farm/plantation with proper animations. Villagers won't walk around it (only applies to TWC and TAD)
Hmm, I missed that. Though I can't remember my villagers not walking around it when I tested... I may need a new concept...

Thanks for your help so far.
posted 10-16-08 12:24 PM EDT (US)     3 / 10  
I'm guessing something like this.... I'm just gonna call your building 'Cheese'
Dunno why.
techtree
...
<Effects>
<Effect type ='Data' amount ='-1.00' subtype ='CarryCapacity' unittype ='Food' relativity ='BasePercent'>
<Target type ='ProtoUnit'>Cheese</Target></Effect>
{Another the same but subtype ='InitialResource'}

<Effect type ='Data' amount ='100.00' subtype ='CarryCapacity' unittype ='Gold' relativity ='Absolute'>
<Target type ='ProtoUnit'>Cheese</Target></Effect>
<Effect type ='Data' amount ='999.00' subtype ='InitialResource' unittype ='Gold' relativity ='Absolute'>
<Target type ='ProtoUnit'>Cheese</Target></Effect>
</Effects></Tech>
And, another similar tech for the wood upgrade.
Just looking at it... the 'unittype' might have to be 'resource'.
Also, 'relativity' might need to be 'assign'

Only thing you need to add to your building proto would be...
<CarryCapacity resourcetype ='Wood'>0.0000</CarryCapacity>
<InitialResource resourcetype ='Wood'>0.0000</InitialResource>
You get the drill. One for gold too.

I'd probably change the name of the building with each upgrade too, since it's doing different crap.

[This message has been edited by TwentyLemon (edited 10-16-2008 @ 12:50 PM).]

posted 10-18-08 08:20 PM EDT (US)     4 / 10  
You could replace the shrine sprite with a different type of building sprite, say a teakwood stand or walnut grove or some sort of hardwood-fruit orchard plantation, and remember to reconfigure the build limit accordingly.

Or you could replace the factory. Just remember to edit the proto to make it buildable by units, and take away the cannon ability and/or the industrial upgrades.

A third option is to find a way to use the mango grove to make food and/or coin.

The most likely structure that fits this description for the time period is a spice plantation or hardwood-fruit grove of some sort. It's odd that the mango grove doesn't give a food trickle, for that matter.

Crunkatog on ESO
Bart331 balance suggestion: aztec: remove civ
Voltiguer: Ender, Sioux in 1.04 will be a top civ, no matter how many layers of Sioux goggles you put on
schildpad on Elephants: ...their mansabdar unit sucks so hard it looks like a black hole
Crunkatog on Steam.
posted 10-19-08 11:38 PM EDT (US)     5 / 10  
TwentyLemon, I tried what you suggested but it didn't seem to work. I also tried just putting all three CarryCapacity values to 100 and InitialResource values to 999, to see if I could collect multiple resources at once, but it only collected Coin.

I might try As_Saffah's suggestion for the auto-gather, although I'd have to change it again to allow villies to work on it. I can live without the proper animations.

As for the structure I'm making, it is an Oasis for Middle Eastern civs. Sure, it doesn't make much sense that they can "build" an oasis, but it fits the culture all the same
posted 10-20-08 00:10 AM EDT (US)     6 / 10  
Well, I should have a lot of spare time this week.
I'll try making some quick things, see if I can get it to work out nice-like.
I'll post again Tuesday night, that's my short day.
posted 10-20-08 07:44 PM EDT (US)     7 / 10  
I tried the suggestions with the factory and shrine. The factory didn't work at all, even if I copy the proto exactly and just change the name it doesn't autogather. The shrine, however, worked fine. Hopefully I can mod it a bit more so that Settlers will at least do the gathering animation. The only downside is that switching the resource type changes it for all shrines... maybe I can change this though. I will probably want to make it not attract huntables too.
posted 10-21-08 06:52 AM EDT (US)     8 / 10  
I see no reason why auto-gathering shouldn't be possible by arbitrary buildings or units. It's neither hardcoded nor assigned to special unit IDs (at least it wasn't in vanilla AoE3).
But you must have enough modding practice and know about the coherences of the game files. You should take the files of auto-gathering/spawning objects as template (proto, tactics, anim), examine and compare it with 'normal' object files. Often it's only a minor change in proto or tactics which is of vital importance.
posted 10-27-08 08:43 PM EDT (US)     9 / 10  
The auto-gathering wasn't the problem, but I couldn't get the buildings to switch resources in the same way the Factory or Rice Paddy do. The Shrine worked only because the ability-switching seems reliant on the AbstractShrine entry.

In the end I sort of gave up and did a work-around. I just used a SetName function to change the name of the Rice Paddy, edited the strings to mention both Rice Paddies and Oases, and changed the Rice Paddy model for the different culture to resemble an Oasis. I added different techs, including one that adds a trickle of wood, which gets around the fact I can't switch to wood production. Finally I added the ability to train and fatten livestock to the Rice Paddy: this will also affect the Asian civs, but since Indians and Japanese have no use for fattened livestock and Chinese need to build villages anyway, it won't change gameplay at all or be exploitable. So underneath it is still a Rice Paddy, using the Rice Paddy entry in the proto file, but it looks and works quite differently.
posted 10-28-08 03:21 PM EDT (US)     10 / 10  
I made a few experiments with auto-gathering and got it working

Here the tactics file - a stripped factory.tactics (the default should do it also)
<?xml version="1.0" encoding="utf-8"?>

<tactics>
<action>
<name stringid="43294">AutoGatherCoin</name>
<type>AutoGather</type>
<persistent>1</persistent>
</action>
<action>
<name stringid="43295">AutoGatherFood</name>
<type>AutoGather</type>
<persistent>1</persistent>
</action>
<action>
<name stringid="43296">AutoGatherWood</name>
<type>AutoGather</type>
<persistent>1</persistent>
</action>
<tactic>
Normal
<action>AutoGatherCoin</action>
<transition>
<tactic>Food</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>Wood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
</tactic>
<tactic>
Food
<action>AutoGatherFood</action>
<transition>
<tactic>Normal</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>Wood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
</tactic>
<tactic>
Wood
<action>AutoGatherWood</action>
<transition>
<tactic>Normal</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>Food</tactic>
<length>2</length>
<exit>1</exit>
</transition>
</tactic>
</tactics>
And here the proto - a combination of factory and bank.
<Unit id ='714' name ='Warehouse'>
<DBID>103</DBID>
<DisplayNameID>23708</DisplayNameID>
<ObstructionRadiusX>3.0000</ObstructionRadiusX>
<ObstructionRadiusZ>3.0000</ObstructionRadiusZ>
<MaxVelocity>0.0000</MaxVelocity>
<MovementType>land</MovementType>
<AnimFile>buildings\bank\bank.xml</AnimFile>
<DeadReplacement>BuildingRubble4x4</DeadReplacement>
<DeadReplacementLifespan>15</DeadReplacementLifespan>
<ImpactType>Wood</ImpactType>
<PhysicsInfo>house</PhysicsInfo>
<PlacementFile>buildinglarge.xml</PlacementFile>
<Icon>buildings\bank\bank_icon</Icon>
<PortraitIcon>buildings\bank\bank_portrait</PortraitIcon>
<RolloverTextID>23709</RolloverTextID>
<ShortRolloverTextID>25609</ShortRolloverTextID>
<InitialHitpoints>4000.0000</InitialHitpoints>
<MaxHitpoints>4000.0000</MaxHitpoints>
<LOS>12.0000</LOS>
<BuildPoints>15.0000</BuildPoints>
<BuildLimit>4</BuildLimit>
<Bounty>280.0000</Bounty>
<BuildBounty>140.0000</BuildBounty>
<Cost resourcetype ='Food'>500.0000</Cost>
<Cost resourcetype ='Wood'>500.0000</Cost>
<AllowedAge>0</AllowedAge>
<Armor type ='Siege' value ='0.0000'></Armor>
<UnitType>LogicalTypeMinimapFilterEconomic</UnitType>
<UnitType>LogicalTypeHandUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeBuildingsNotWalls</UnitType>
<UnitType>LogicalTypeRangedUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeVillagersAttack</UnitType>
<UnitType>LogicalTypeHandUnitsAttack</UnitType>
<UnitType>LogicalTypeShipsAndBuildings</UnitType>
<UnitType>LogicalTypeRangedUnitsAttack</UnitType>
<UnitType>Building</UnitType>
<UnitType>BuildingClass</UnitType>
<UnitType>ColonyBuilding</UnitType>
<UnitType>HasBountyValue</UnitType>
<UnitType>ConvertsHerds</UnitType>
<UnitType>CountsTowardEconomicScore</UnitType>
<UnitType>Economic</UnitType>
<Flag>CollidesWithProjectiles</Flag>
<Flag>StartsAtFullEfficiency</Flag>
<Flag>Immoveable</Flag>
<Flag>NoBloodOnDeath</Flag>
<Flag>ObscuresUnits</Flag>
<Flag>NonAutoFormedUnit</Flag>
<Flag>Doppled</Flag>
<Flag>SelectWithObstruction</Flag>
<Flag>PaintTextureWhenPlacing</Flag>
<Flag>FlattenGround</Flag>
<Flag>ColonyBuilding</Flag>
<Flag>Tracked</Flag>
<Command page ='10' column ='0'>Tactic11</Command>
<Command page ='10' column ='1'>Tactic12</Command>
<Command page ='10' column ='2'>Tactic10</Command>
<Command page ='10' column ='3'>Delete</Command>
<Tactics>gatherer.tactics</Tactics>
<ProtoAction>
<Name>AutoGatherCoin</Name>
<Rate type ='Gold'>7.500000</Rate>
</ProtoAction>
<ProtoAction>
<Name>AutoGatherFood</Name>
<Rate type ='Food'>7.500000</Rate>
</ProtoAction>
<ProtoAction>

<Name>AutoGatherWood</Name>
<Rate type ='Wood'>7.500000</Rate>
</ProtoAction>
</Unit>
A problem was to display the resource icons - none of the usual 'command page=' did work - so I used the page=10. The other pages seem to be assigned in exe? But try out yourself ..
Age of Empires III Heaven » Forums » Modding Discussions » Rice Paddy-like building
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Empires III Heaven | HeavenGames