login
|
language
Български (Bulgarian)
čeština (Czech)
Dansk (Danish)
Nederlands (Dutch)
Suomi (Finnish)
Français (French)
Deutsch (German)
Ελληνικά (Greek)
Magyar (Hungarian)
Italiano (Italian)
日本語 (Japanese)
한국어 (Korean)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese)
Português-Brasil (Portuguese-Brazil)
Română (Romanian)
Русский (Russian)
简体中文 (Simplified Chinese)
Español (Spanish)
Svenska (Swedish)
繁體中文 (Traditional Chinese)
ไทย (Thai)
Türkçe (Turkish)
Українська (Ukrainian)
Help us translate Steam



Modding winter travel is more difficult, there aren't any default mechanics or numbers you can use. You can however create events that would only fire in winter; it requires some knowledge of our event system and lua scripting, but it IS possible. The lua function getseason() will return a number between 0 and 4. Numbers between 0 and 1 are winter; this means than an event that checks if getseason() < 1 would only fire in winter. From there, you can have the event add an effect to factions:
Of course, this will only add the attribute; you'll want to add a different event that checks if it's not winter and if we're still getting penalized for its being winter. Have the first event assign something to a variable (preferably in the _G table we set aside that gets saved and loaded, so this event works with save games); something like
In addition to this, you can have a different winter-only event take a brigade, check if it's inside a city with the isincontainer() command, and if it's not, kill off a unit by calling the brigade:addunits(-1). It would be impossible to make the AI aware of this event and avoid moving around in winter, so it might be preferable to also check that the brigade's player-controlled. Doing this by event is a bit clumsy, but should be functional.
Hope this helps!
As you described, when picking targets to attack the AI does do a value vs threat comparison but it also factors in a lot of other things like game difficulty, time since last attacks, faction hostility, resources of potential launching points for the attack, etc. While the AI technically knows the size and position of all of the players units, we specifically avoid factoring these into the scale of AI attacks so players aren't indirectly penalized for better defense.
All of that said, we have been expanding the scripted portions of the AI significantly in Hegemony III. In 3.1 all diplomacy, AI vs AI conquests, and all city rebellions are now determined by scripting that can be modded and many attacks such as those that occur after breaking/rejecting truces are triggered by scripts.
I definitely love the idea of having more personality to the AIs and more plot to the objectives and it is something we're actively trying to work on as we go forward.
If you have any savedgames where you think the AI could be making a better decision, please send them along to rob@longbowgames.com While improving some AI behaviours can be weeks of work, many times I can make significant improvements just by adjusting some of the decisions weights or introducing a new piece of info the AI was considering before.
Also, if you're interested in scripting any plot events we'd be more than happy to provide any support you'd need to get it working.
starvation.xml here:
<eventgroup>
<event name="General.Starvation" event="timed">
<pollingfrequency>1</pollingfrequency>
<scriptfile>resources/objectives/general/starvation.lua</scriptfile>
</event>
</eventgroup>
starvation.lua is here:
--how do I get a list of brigades? how are they uniquely IDe'd?
for brigade in listbrigades do
if (brigade:getfood()<1) then --how can I check food?
brigade:starvation=brigade:starvation+1;
else
brigade:starvation=0;--end starvation when food returns
if(brigade:starvation>0) then --avoid wasting cpu cycles if not starving
if(brigade:starvation>0) or if(brigade:starvation<3) then --start dying after 1 week of no food
brigade:setmorale(maxmorale*(starvation/2)); --after 2 days of no food, no combat ability left.
end
if(brigade:starvation>6) then --start dying after 1 week of no food
brigade:addunits(-(brigade:getsize()/10)); --all men dead at day 17. where are brigades destroyed?
end
end
end
-------------------------
I didn't even try to run this as I'm sure syntax is wrong and some functions I need don't exist. How do I turn on debug mode??
You actually came pretty close, here. What you would want is
*If you retrain the brigade, the old one is deleted and relevant stats like xp and custom names are ported to the new one. Technically, the old brigade's ID never changed, but the retrained brigade will have a different one. If you assigned the brigade a script tag through the brigade:settag() function that would persist though.
brigade:getresource("supplies") returns how much food a brigade has, but this would still return 0 even if they were standing in the supply range of a city. Luckily there's the brigade:isinsupply() function, which returns either true or false.
Hm, looks like you're trying to define your own variable in the brigade, I'm afraid you can't really do that; you CAN however create a table of brigade IDs to your new variable and look up the current one. What I'd suggest might look like this:
As you probably noticed, there is no setmorale or maxmorale function. The current morale of a brigade can't be set through script unfortunately (I'll see about adding that in a future patch), but the maximum can. The maximum morale of a brigade is controlled through the "maxmorale" attribute. If you call brigade:setattribute("maxmorale", -50, "add"), that'd add a 50 morale penalty to the maximum morale of the brigade and it would start fading towards that. Note that in the current system, this penalty will be applied twice for a total of -100, and unless you put a brigade:setattribute("maxmorale", +50, "add") somewhere, this will never be undone!
You'll want to call either brigade:getmaxunits() or brigade:getnumunits() here. I honestly have no idea how the game will react if you put a brigade at zero or fewer units via script, but I doubt it'd be anything good, so you should add checks that the number you're about to remove is less than brigade:getnumunits(), and if it's not, call the function that destroys brigades, which is brigade:disband().
No worries, we really ought to put together a list of useful functions sometime. Debug mode can be activated with debugmode(true)
All brigades that are attacked will be attributed to you. So if An AI brigade attacks another AI brigade you will get get the credit for attacking it (this will make diplomacy behave a little strangely)
The console will pop up a lot once you unpause the game telling you all sorts of things (there's a lot debug code).
to avoid seeing all our debug code you can use this:
pprint() can do some useful things like:
our print and pprint code is inside the code:
Taras hoplites. I want them to have a black armour. So normaly I have to open a .dds file and recolour the armour parts, then save it as ??? dxt5? dxt3??? after that I will save it to taras_hoplite_black.dds. Now I still need to bring the texture i made into the game, normaly by making a complete new unit i think?. Then I can follow the instructions of the other tutorials I suppose. But WE NEED TO KNOW how to edit and then take those textures in the game?!?!? Please make a tut for it :) thank you. Also would be cool to know if we can adjust the variants of a unit, I mean a hoplite unit got different crests, so basically i want to have a more organized look, which means the crests for a unit should be all the same. How can I do this?