This is the official forum for the free, fan-made Age of Empires III modification, Wars of Liberty.

Welcome to the New Forum

We hope you enjoy the official new forum of the Wars of Liberty mod for Age of Empires III! Visit this thread to get acquainted with the new forum, and let us know if there's anything we can fix. Feel free to dismiss this message at any time by clicking the "X" in the top right corner.

Thanks!
The Wars of Liberty Team

Forum rules

  • Welcome to The Library! This forum is for asking questions about modding, and sharing maps, mods, and other creations.
  • The official language in this forum is English.
  • Be nice to other members, don't spam comments or smilies, and don't do anything illegal.
  • Posts that don't fit this forum will be moved or deleted.
 
User avatar
PredatoR
Topic Author
VIP
VIP
Posts: 17
Joined: Sat Apr 29, 2017 7:23 am

Increasing build limit of a unit by building something

Sun Aug 13, 2017 1:18 pm

Hello Guys,

I am trying to implement this.

Sipahi has 0 buildlimit set at proto.

Each mill will add 25 buildlimit for Sipahis.

Here is the code I use and add it into age0ottoman.

Code: Select all

<Tech name ='Sipahifarm1' type ='Normal'>
		<DBID>9524</DBID>
		<ResearchPoints>0.0000</ResearchPoints>
		<Status>UNOBTAINABLE</Status>
		<Prereqs>
			<typecount unit="Mill" count="1.00" state="noneState aliveState buildingState " operator="gt"/>
		</Prereqs>
		<Effects>
			<Effect type ='Data' amount ='25.00' subtype ='BuildLimit' relativity ='Absolute'>
				<Target type ='ProtoUnit'>Spahi</Target></Effect>
		</Effects>
	</Tech>
It didn't work. Do I miss something?
 
Takatmo Yereoc
Wars of Liberty Team
Wars of Liberty Team
Posts: 194
Joined: Sun Mar 12, 2017 12:54 pm
Location: Brazil
Favorite Civilization: Habsburgs

Re: Increasing build limit of a unit by building something

Sun Aug 13, 2017 2:52 pm

I've made some tests using your code and the tech worked after I changed the value of the "operator" from "gt" to "gte".
Image
 
User avatar
PredatoR
Topic Author
VIP
VIP
Posts: 17
Joined: Sat Apr 29, 2017 7:23 am

Re: Increasing build limit of a unit by building something

Sun Aug 13, 2017 3:47 pm

Interesting. I can't make it work.

I am missing something it seems. Can you tell me the all steps that you applied?
 
Takatmo Yereoc
Wars of Liberty Team
Wars of Liberty Team
Posts: 194
Joined: Sun Mar 12, 2017 12:54 pm
Location: Brazil
Favorite Civilization: Habsburgs

Re: Increasing build limit of a unit by building something

Sun Aug 13, 2017 4:25 pm

Here it goes:
  1. I copied and pasted your code at the techtreey.xml and added this line to "Age0Ottoman":

    Code: Select all

    <Effect type ='TechStatus' status ='obtainable'>Sipahifarm1</Effect>
    Then I opened "protoy.xml", searched for Spahi's protounit entry and added this to his code to give him a build limit of zero:

    Code: Select all

    <BuildLimit>0</BuildLimit>
  2. After this, I went to test the code in the Editor. Set my civ as the Ottomans, placed a TC and a Spahi in the scenario and went to test in-game. I advanced up to Age III, built some houses, a Market and, after checking if I could send the "3 Spahis" card (I wasn't able to do that due to the build limit of zero, so everything was working), a Mill.
    Then I researched the "Seed Drill" tech at the Mill to make the game read the techtree again (techs that use "typecount" requires any tech to be researched after its prerequisite is met, in your case it's the construction of 1 Mill), but I couldn't send the "3 Spahis" card, as the build limit for Spahis wasn't increased. Checked the build limit at the Spahi I placed before and nothing changed.
  3. Closed the game and went back to check the code of your tech. Changed the value of the operator from "gt" to "gte", saved the changes and started the game again.
  4. Went to the Editor again and loaded the last scenario tested to save time. I did everything again (aging up to Age III, building stuff, etc.) and, after building a Mill and researching "Seed Drill" to make the game read the techtree again, I was able to send the "3 Spahis" card. Checked the build limit at the Spahi and it was capped at 25.
Image
 
User avatar
PredatoR
Topic Author
VIP
VIP
Posts: 17
Joined: Sat Apr 29, 2017 7:23 am

Re: Increasing build limit of a unit by building something

Sun Aug 13, 2017 5:31 pm

Well, that is very interesting... I exactly do the same stuff but buildlimit for Sipahis stays at 0.

By the way, they are recruitable at what I try to do in my mod.

I use SCP's modloader but I don't think that can be an issue with that.
 
Takatmo Yereoc
Wars of Liberty Team
Wars of Liberty Team
Posts: 194
Joined: Sun Mar 12, 2017 12:54 pm
Location: Brazil
Favorite Civilization: Habsburgs

Re: Increasing build limit of a unit by building something

Sun Aug 13, 2017 6:08 pm

With that info of having them recruitable, I've made them available at Town Centers. Once I reached Age III, built a Mill and researched a random tech at the Market, I managed to train up to 25 of them without problems.
I used the same code as yours with the change of the "operator" from "gt" to "gte", as you can see below:

Code: Select all

	<Tech name ='Sipahifarm1' type ='Normal'>
		<DBID>9524</DBID>
		<ResearchPoints>0.0000</ResearchPoints>
		<Status>UNOBTAINABLE</Status>
		<Prereqs>
			<typecount unit="Mill" count="1.00" state="noneState aliveState buildingState " operator="gte"/>
		</Prereqs>
		<Effects>
			<Effect type ='Data' amount ='25.00' subtype ='BuildLimit' relativity ='Absolute'>
				<Target type ='ProtoUnit'>Spahi</Target></Effect>
		</Effects>
	</Tech>

Try pasting the code above at your techtreey.xml.

I use SCP's modloader but I don't think that can be an issue with that.
I personally don't use this program, but I don't think it could be causing the problem.
Image
 
User avatar
PredatoR
Topic Author
VIP
VIP
Posts: 17
Joined: Sat Apr 29, 2017 7:23 am

Re: Increasing build limit of a unit by building something

Sun Aug 13, 2017 6:56 pm

Well, that is very surprising. It worked when I copied and pasted your code although it is exactly same!.

Now I have another challenge. It creates a train Icon at mill for Sipahis. And it creates Sipahis instantly and doesn't care the population limit as well. No idea how it appeared!


Image
 
User avatar
PredatoR
Topic Author
VIP
VIP
Posts: 17
Joined: Sat Apr 29, 2017 7:23 am

Re: Increasing build limit of a unit by building something

Sun Aug 13, 2017 7:01 pm

Ignore that. I wrongly activated something which I made at protounitcommands. All works fine. Finally solved. Spent 1 day...
 
User avatar
Rampo
Independentista
Independentista
Posts: 152
Joined: Sun Jul 02, 2017 2:33 pm
Location: Vung Tau City, Vietnam

Re: Increasing build limit of a unit by building something

Mon Aug 14, 2017 2:47 am

This is the first time I've posted this to the VIP member, PredatoR. looks like you, PredatoR forgot that Spahi can only available in Ottoman HC. Ah, about the limit increase, I want to talk to you about another problem, it's on The Habsburgs aging up to industrial age, there's a tech name "Dame of Athens", which is not only reach to industrial age, but also make Mills and Plantations hold twice as many Villagers. i think this is a bad idea because with a size of mill and plantation, maximum villagers to gather from these is always 10, not more. If you want to make this effect, mill and plantation must be bigger than original. you can take fazenda in brazil and olive plantation in Greeks as example. Do you have any idea of fixing this
ESP: Sin amor, el mundo se hundirá en la guerra
POR: Sem amor, o mundo afundará na guerra
ENG: Without love, the world will sink in war

BG Rampo
 
Takatmo Yereoc
Wars of Liberty Team
Wars of Liberty Team
Posts: 194
Joined: Sun Mar 12, 2017 12:54 pm
Location: Brazil
Favorite Civilization: Habsburgs

Re: Increasing build limit of a unit by building something

Mon Aug 14, 2017 3:07 am

Rampo, I think you haven't read the part of PredatoR's post where he says:
PredatoR wrote:By the way, they are recruitable at what I try to do in my mod.

That is, in the mod developed by him (the Ottoman Mod), Spahis can be trained once you build a Mill, so the Ottoman player is not limited to getting them only through HC cards.

Also, the Library is not the place to report WoL bugs, but I'll take a look at your problem.
Image

Who is online

Users browsing this forum: No registered users and 1 guest