CHanging unit stats through scripting

ImageImageTalking about Modding for EE2 and EE2 AOS. New maps, patches, programs and Multiplayer scenarios.
Post Reply
Posts: 1
Joined: 24 Apr 2019, 15:57

CHanging unit stats through scripting

Post 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.

Posts: 47
Joined: 03 Dec 2018, 18:01

Re: CHanging unit stats through scripting

Post 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!


User avatar
High Representative
Posts: 7790
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: CHanging unit stats through scripting

Post 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.
Best regards,
Ministry of Game Affairs
Department of Control and Complains

User avatar
Posts: 169
Joined: 23 Sep 2017, 17:26

Re: CHanging unit stats through scripting

Post 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.
List of tutorials, useful threads and utilities (look here before posting): Here

Add Pics to Map: viewtopic.php?f=54&p=25184#p25184

Loews Work: viewtopic.php?f=54&t=5160

Post Reply

Return to “EE2 files, modding, maps, testing, etc.”