HOW TO add/remove a special promotion for a cpecial unit (while in city)

Deon

Lt. of Mordor
Joined
Jan 13, 2008
Messages
2,956
Location
St.Petersburg, Russian Federation
The problem is that I want a promotion to be triggerable by a player when the unit is in system (final frontier city)..
The idea is to make changeble equipment. I.E. I have a gunship with base combat strength 10. I want to make an option for it to equip "gunners crew" while in city which makes it +2 str -1 movement, and then to equip "regular crew" (removes promotion) or "technicians crew" (-2 str heals 10% faster).
I saw this thing in the FFH mod, but it's a bit complicated there (a lot of things changed and I'm almost sure the dll code is changed).
I know the script, but it uses "caster" variable (maybe in dll?) also I don't see how do they invoke the python in game.

I was asking about a general way to activate a python script in vanilla game by an action. I can't get it yet. Just how to call a python function...

Also maybe some dll editing is needed here. But i'd like to go without it.
 
My advice would be to create separate missions for this (use Lopez's route pillage or something similar as an example of a custom mission)

Essentially you would have both missions require that the unit was in a city with whatever other building prereqs you might want and that the unit did not have the promotion the mission provided. Then activating the mission would remove the other promotion (if present) and add the one selected.

Adding new missions isn't that hard, it does require a lot of SDK stuff, but most of it is just declarations in header files that you can essentially take verbatim from an existing mission mod component with only minor changes.
 
Back
Top Bottom