[QUESTION] Promotions

Louis the XIV

Sun King
Joined
Jun 23, 2020
Messages
839
Location
Court of Versailles
I have a 2 simple questions concerning the Promotion xml file.

1. What is this supposed to mean, what is it used for, and how do I use it myself?
Code:
<LayerAnimationPath>NONE</LayerAnimationPath>

2. How do I add an effect at a promotion?

Thanks in advance for any help!
 
2. How do I add an effect at a promotion?

If you are talking about a "completely new effect" (in terms of new logic):
You add a new XML-tag (Schema and actual XML) and program DLL logic (to read and return the XML value) for it.
  1. Adjust CIV4UnitSchema.xml (you need to make the Schema accept your new XML tag in CIV4PromotionInfos.xml)
  2. Adjust CIV4PromotionInfos.xml (here you actually add the XML tags and define their XML values of the Promotions)
  3. Have the DLL (CvInfos.cpp, CvInfos.h) read the XML tag and its value (methods reading and returning the values from XML tag as variable)
  4. Make the methods that return the XML values as a variable accessible to Python (CyInfoInterface1.cpp, CyInfoInterface1.h) (generally a good idea)
  5. Code your actual logic using the XML values - either in DLL or in Python (or both)
  6. Compile your new DLL (Just writing it in the C++ files alone will not work.)
  7. Test if your logic works - fix it if it does not (and compile again every time if your logic is in DLL)
  8. Done :)
Do not worry. :thumbsup:
It may sound complicated at first, but it is actually really simple after you have done it the first time.
(Basically you can just use an existing XML value as an example and see how it is done with that one.)

The Points 1. to 4. usually take about 15min for an experienced modder.
(Meaning to add an XML attribute and make it accessible to logic.)

-----------

Reading XML values is really done best by DLL.
Python logic usually also gets all XML-values by asking DLL.
(I do not even know if it is possible otherwise - at least I never heard of it.)
 
Last edited:
:thanx:
Wow. I thought it was something about the Animation Path.
I'll try it out, but first I'll try to compile the dll and see if I succeed.

Wait a minute !

When you say effect do you mean "graphical effect"?
I thought you meant "feature effect".

If you talk about "graphical effects" my guide above will not be sufficient.
Unless you use existing graphical effects that DLL already knows.

Existing graphical effects can be triggered by DLL logic of course.
Completely new graphical effects first need a graphical modder to create them.
(And they also need to be setup in XML first.)
 
I want to create a graphical promotion effect that already exists in bts. The plague from Gods of Old
If it already exists in another mod, just check the XML (of Promotions) first and compare it - then from there you can continue following the path to DLL to XML setup of the graphical effect. :thumbsup:
Always first look how it is already done and learn from the existing examples.

I do not know that effect "Plague from Gods of Old". :dunno:

But why not ask the modders that created it?
They should know everything to explain to you. :)

If there is a new XML tag for it, it defnitely needs to be using DLL though.
(All sound and graphical effects I know somehow involve DLL logic to trigger it.)
 
The effect from gods of old comes with bts. But this effect wasnt created for unit effects, this is something im trying to do.
Also the modder is probably firaxis games though I'm not sure
 
The effect from gods of old comes with bts. But this effect wasnt created for unit effects, this is something im trying to do.

If it is in BTS already, you sould be able to configure it by using XML tag in Promotions and triggering it in DLL or Python for a Unit that has that Promotion. :thumbsup:
(But again, as written above, you must read it from XML by DLL. Then you can make it accessible to Python.)

My description above should work then.
(For creating completely new - not yet existing graphical effects - there needs to be done more of course.)

Just give it a try. :)
 
Ok, but where? Where should I define the tag?
In the XML Schema (CIV4UnitSchema.xml) and the actual XML (CIV4PromotionInfos.xml).
See Point 1 and Point 2 here.

Just compare with other XML tags already existing and it should be pretty easy to understand. :thumbsup:
(It is always easiest to look at what already exists and learn from that by just trying it.)
 
Ah, ok. But I might not try it for a while because I abandoned this small project about the plague. All my effort has to go into creating a new RFC mod.
But thanks for all your help, your explanations where very easy to follow and where very informative.
 
You can of course also "hardcode" in your logic by just checking the PromotionType.
(Then you will not have to add a new XML tag.)

It depends on your use case. :dunno:
If there is really only 1 Promotion using it, hardcoding might be ok.

Similar to your logic using gc.getInfoTypeForString in your other post.

Then you of course still need to figure out how you trigger that specific graphical effect.
(Search for it in DLL after you have found the XML value of that graphical effect first.)
 
Back
Top Bottom