Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
This issue will be fixed in 2.1.2
Bad example, but if the player (or AI) builds a Vineyard:
If Sonneneve then enable "Drunken Elf"
If Elidon then enable "Wobbly Guard"
etc.
First step is to create the unit in the editor - set it to be non-purchasable.
If you register for the "BuildingConstructed" event, you will be notified when any building gets built - you can then check to see if it is the first time for that realm, and use Realm.Restrictions.AllowUnits.Add("UnitName") to add the unit to the list of allowed units.
Defined the class and registered the event. Below is what I have so far:
Thanks again for your help!
private void evBldgConstructed(string EventName, params object[] Args)
{
BuildingEffect Building = Args[0] as BuildingEffect;
//do stuff with Building
}
For context, here is what I have:
Edit:
I was able to determine if the player builds the building as Iron Barony, but not sure how to determine if AI builds the building as Iron Barony.
Thanks again for all of your help!
When I try to add new game text in the editor, it creates lines in data.xml that appear to only want to update existing keys. Example below:
This crashes the editor when I try to reload the mod until I manually remove the updates. I assume because it can't find an existing key to update. I tried playing around with tables and the <Additions> tags to no avail. Known issue?
Edit update:
The game plays fine, just the mod editor crashes. I will paste the error below.
<----Like the concept!
Creating the flag wouldn't be too hard.. having it correctly apply the effect to the province where the unit is located would be harder.
If i were creating this flag, i would track the Unit.OnStackChanged which takes 2 Stacks as parameters - the new one and the old one.
Using the Stacks I would then determine which province the unit was in and which unit it is now in - removing the effect from one and applying it to the other.
The hardest part would be preventing the effect from stacking if more than one unit is in the province - assuming you don't want the effect to stack of course. I can't think of an easy way to do that currently.