SeanR
Skirmisher
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.
TwentyLemon
Skirmisher
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.
SeanR
Skirmisher
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.
BilboBeutlin
Skirmisher
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.
SeanR
Skirmisher
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.