Page 1 of 1

CHanging unit stats through scripting

Posted: 24 Apr 2019, 16:01
by Serchant
Since there are no triggers present like EE1, is it possible to change for example a maceman's hp and attack? I want to create a co op map in which the ai is a bit OP in which the players must compete together against the AI.

Re: CHanging unit stats through scripting

Posted: 24 Apr 2019, 22:12
by Sat42
Hi Serchant!

Someone else with more experience will give you the detailed answer soon, if not today then in the coming days - all I can say is YES it is totally possible, that much I know, and I am interested in learning how to do these kinds of modifications myself so will follow this thread!


Re: CHanging unit stats through scripting

Posted: 25 Apr 2019, 00:03
by Dr.MonaLisa

Check my "pirates" scenario .ies file.

I'm pretty sure I added more health and power to ships using the Crown Effect.
I know there are functions like AttachEffectToUnit (not sure if wrote it correctly), and that's the thing that would be most useful. You can spam the same line of code like 20 times to get more and more health.

Re: CHanging unit stats through scripting

Posted: 05 May 2019, 11:13
by Loewenherz
A little bit you can change over your .ies scripts. Besides that, you have 2 ways, to change the unit stats in a scenario.

Over AttachEffectToUnit, AttachEffectToGroup or AttachEffectToPlayer you can attach a effect in a scenario. A effect can chanche stats like attack, speed, live or fervor. The weather is also an effect and the crowns. Based on this, you can use a existing effect or create a own in the .ddf file for that. A effect adds his values to existing stats.

The second way is the unit update. Add the data to the appropriate files (.ddf and .csv). Than use SetTechEnabled and AwardTech in the ies script. Over this way, you can chanche everthing like the name from units, the description, the 3d Model, the icon, build time... This trick is used in the russian campaign for the city center and the uni in a mission from the russian campaign. You can test the russian city center and uni trick in a own mission.

Principle also in the german Mission from Kursk (Tanks from Germany are stronger) and in the maasai campaign this trick is used. In this missions from africa campaign, you cant send units in the uni and the temple. But it seems, for that has used the developer own commands in the script.