[PYTHON] zPromotions

Zebra 9

Emperor
Joined
May 17, 2006
Messages
1,554
Location
Middle of Cyberspace
zPromotions MOD COMP v1.1

Type: PYTHON MOD COMP
Version: 1.1
Langages Used: Python
By: Zebra 9
Multiplayer Compatible: Shouldn't affect MP games
DB File: Download Here

Description:
This allows any person with a basic knowledge of python to give or remove promotions from a unit after combat, when a unit moves, or when the unit is built. To do this I have created 15 "Events", these events are listed below:
PROMO_COMBAT: gives/removes the unit fights a battle
PROMO_PLOT: gives/removes the promotion if the plot the unit moved to matches certain criteria
PROMO_LOSER_COMBAT: gives/removes the promotion if the unit that lost the battle already had the promotion to be given
PROMO_COMBAT_PLOT: gives/removes the promotion if the plot the unit just battled on matches certain criteria
PROMO_HOMELAND: gives/removes the promotion if the unit moves into it's cultural borders
PROMO_NEUTRAL: gives/removes the promotion if the unit moves out of it's cultural borders
PROMO_CITY_BUILDING: gives/removes the promotion if the city the unit moved into has a certain building
PROMO_BUILT: gives/removes the promotion the unit is built
PROMO_CITY_BUILDING: This event checks each list. It checks the or prerequisite list for building types only. This allows you to give a promotion to a unit when it moves into a city with at least one of the set buildings.
PROMO_BUILT: This event checks each list. It checks the or prerequisite list for terrain types, feature types, improvement types, building types, and bonus types. This is called when a unit is built.
PROMO_BARBARIAN: This event is the opposite of PROMO_HOMELAND, it gives the promo if the unit leaves it's home land. Contrary to what it's name implies it doesn't only give the promotion if you move into a plot that is un owned, instead it gives the promotion if the unit moves to a plot that it's owner doesn't own.
PROMO_VASSAL: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a vassal.
PROMO_MASTER: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of the master.
PROMO_FRIENDLY: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a player who has open borders with the unit's owner.
PROMO_ENEMY
: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a player who is at war with the units owner.
PROMO_HOSTILE: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a player who is not at war with, have open borders with, is not the vassal of, and is not the master of the units owner. Designed for units that ignore open borders agreements.
PROMO_AIR_CARRIER: This event gives a promotion to an Aircraft Carrier if it has a SPECIALUNIT_FIGHTER (Fighter or Jet Fighter) on board.​
Some cool things you can do include giving archer units a special promotion when they move into a city with walls.
Give units homeland promotions.
Give unhealth promotions when your unit moves into jungle.
Now you guys are more creative then I am so I'm shore I'm going to see some realy cool stuff done with this.:goodjob:

Oh, it also comes with a big HTML document telling how to use this MOD COMP.;)

Installation:
1) Unzip into "My Documents\My Games\Warlords\MODS".
2) Load the game.
3) Click on "Advanced"-->"Load A MOD"-->"zPromotions"-->"OK", the Game will restart.
4) Now you can play as normal

Enjoy! :goodjob:
 
This sounds very useful.

I may have a need for these events in my mod.

Good job :goodjob:
 
Hello,

I am curious if any of your modifications will accomplish this:

For every plane I load on a carrier I want the defense to increase a certain percentage of the carriers original strength. For example every plane increases the carriers strength by 10%
 
I'm getting more and more impressed with all your modcomps, Zebra 9. Here are a few suggestions I have:

-Change "PROMO_NEUTRAL" to give the promotion if the unit moves into neutral territory.

-Create something new called "PROMO_ENEMY_LAND" (or something like that) to give the promotion if the unit moves into enemy territory.

-Add some more information about what you mean by "if the plot the unit xxxx matches certain criteria." What kind of criteria? Can you give examples?

Also, "PROMO_LOSER_COMBAT" seems redundant to me. Can you further explain its use? If a unit loses combat, it will most likely die, so why bother adding a promotion that it already has?

This modcomp is very useful, and I can't wait for you to expand it.
 
I'm getting more and more impressed with all your modcomps, Zebra 9. Here are a few suggestions I have:

-Change "PROMO_NEUTRAL" to give the promotion if the unit moves into neutral territory.
Yea, when I first made this MOD COMP I had no clue how to check that. I'll get it over the next week.

-Create something new called "PROMO_ENEMY_LAND" (or something like that) to give the promotion if the unit moves into enemy territory.
Sure enough, it'll be in the next version.

-Add some more information about what you mean by "if the plot the unit xxxx matches certain criteria." What kind of criteria? Can you give examples?
Terrain, features, and a few other things (can't remember exactly what:blush:).

Also, "PROMO_LOSER_COMBAT" seems redundant to me. Can you further explain its use? If a unit loses combat, it will most likely die, so why bother adding a promotion that it already has?
Actually it checks to see if the loser has the promotion that is supposed to be given, and if the loser does it gives it to the winner (sort of like an Orthus Axe Promo, it was strategyonly's idea).

This modcomp is very useful, and I can't wait for you to expand it.
Thx.:goodjob::goodjob:
 
Yea, when I first made this MOD COMP I had no clue how to check that. I'll get it over the next week.
How about something like checking: if (not in homeland AND not in enemy land). If the unit isn't in its own territory or in a rival's territory, then it's got to be in neutral territory, right?

And regarding enemy land, what happens if the unit is in an ally's territory?

Actually it checks to see if the loser has the promotion that is supposed to be given, and if the loser does it gives it to the winner (sort of like an Orthus Axe Promo, it was strategyonly's idea).
Ohhhhh, now I get it. At first I understood that the losing unit would have the promotion regained/removed, not the winning unit.

I'll eagerly await your next release. :D
 
Just uploaded v1.1, it includes 7 new events and fixes PROMO_NUETRAL so it works correctly, also I updated the HTML readme.:thumbsup:
 
Looks cool. :goodjob: Now I will just have to figure out how to use it.
If my Naval Mod takes off I may even us it in it. :)

Is adding new tags to the promotion info XML file, a SDK or Python thing?

GM
 
This allows any person with a basic knowledge of python to give or remove promotions from a unit after combat, when a unit moves, or when the unit is built. To do this I have created 15 "Events", these events are listed below:
PROMO_COMBAT: gives/removes the unit fights a battle
PROMO_PLOT: gives/removes the promotion if the plot the unit moved to matches certain criteria
PROMO_LOSER_COMBAT: gives/removes the promotion if the unit that lost the battle already had the promotion to be given
PROMO_COMBAT_PLOT: gives/removes the promotion if the plot the unit just battled on matches certain criteria
PROMO_HOMELAND: gives/removes the promotion if the unit moves into it's cultural borders
PROMO_NEUTRAL: gives/removes the promotion if the unit moves out of it's cultural borders
PROMO_CITY_BUILDING: gives/removes the promotion if the city the unit moved into has a certain building
PROMO_BUILT: gives/removes the promotion the unit is built
PROMO_CITY_BUILDING: This event checks each list. It checks the or prerequisite list for building types only. This allows you to give a promotion to a unit when it moves into a city with at least one of the set buildings.
PROMO_BUILT: This event checks each list. It checks the or prerequisite list for terrain types, feature types, improvement types, building types, and bonus types. This is called when a unit is built.
PROMO_BARBARIAN: This event is the opposite of PROMO_HOMELAND, it gives the promo if the unit leaves it's home land. Contrary to what it's name implies it doesn't only give the promotion if you move into a plot that is un owned, instead it gives the promotion if the unit moves to a plot that it's owner doesn't own.
PROMO_VASSAL: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a vassal.
PROMO_MASTER: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of the master.
PROMO_FRIENDLY: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a player who has open borders with the unit's owner.
PROMO_ENEMY
: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a player who is at war with the units owner.
PROMO_HOSTILE: This event is the similar to the PROMO_HOMELAND, it gives the promo if the unit enters the cultural borders of a player who is not at war with, have open borders with, is not the vassal of, and is not the master of the units owner. Designed for units that ignore open borders agreements.
PROMO_AIR_CARRIER: This event gives a promotion to an Aircraft Carrier if it has a SPECIALUNIT_FIGHTER (Fighter or Jet Fighter) on board.​


Man does this look good!

The only change I would suggest right now is for the "PROMO_AIR_CARRIER." I feel it is a bit too specific. Perhaps you can broaden it to allow the user to set the parameters for the code through python? In other words, make it so that the unit that will gain the promotion must be entered, followed by the unit that is required to be on board in order for the promotion to be achieved.

This way, instead of restricting the promotion just to Aircraft carriers and fighters, we can perhaps add promotions to other sea vessels that contain certain units, like a Frigate with Cannons on board, etc.​
 
Back
Top Bottom