DLL coding thread

Houston, Orbital. I am entering professions now, attempting interface with connection with hammer!

So I move Alt Equipment entries to a new profession? does that mean the new professions has this as an alt equipment entry or as it's standard equipment? I am assuming the latter?

I am also assuming that I need to move the alt free promotions as well, and delete the alt tags as well, in other words completely remove all knowledge of their prior existence!!! [pissed]

I just checked the schema and it seems like a negatory on full extermination!
 
This is what I've coded so far in CIV4UnitInfos.xml.

I know I should have used github for this. I will have a deeper look to Nightinggale guides when I finish with the file.
Anyway, I attach what I've done in the file so far below.

I have included the subprofessions using Kailric naming scheme, but original professions tags in the file are unchanged. I include the tags I have used between []:

Heavy Knight [PROFESSION_KNIGHT_PLATE]
Knight [PROFESSION_KNIGHT_MAIL]
Pikeman (Chain) [PROFESSION_INFANTRY3]- Heavy Pikeman (Plate) [PROFESSION_PIKEMAN_PLATE]
Heavy Calvary (Scale) [PROFESSION_HEAVY_CALVARY]- Heavy Calvary (Chain) [PROFESSION_HEAVY_CALVARY_CHAIN]
Archer [PROFESSION_MISSLEMAN]- Archer (Leather) [PROFESSION_ARCHER_LEATHER]
Armed Peasant [PROFESSION_ARMED_PEASANT]- Armed Peasant (Leather) [PROFESSION_ARMED_PEASANT_LEATHER]
Crossbowman (Leather) [PROFESSION_SKIRMISHER3]- Crossbowman (Chain) [PROFESSION_CROSSBOWMAN_CHAIN]

Below I include my to-do list:
Longbowman - Longbowman (Leather) - Longbowman (Chain)
Horseman - Horseman (Leather) - Horseman (Scale)
Light Infantry - Infantry (Leather) - Heavy Infantry (Scale) - Heavy Infantry (Chain)
Light Skirmisher (Leather) - Skirmisher (Scale) - Skirmisher -(Chain) - Skirmisher (Plate)

The recent change affects professions, not units. However I certainly wouldn't mind if you do something useful with units ;)

Well, As you say, this file will probably not be used, but I don't mind. You are the designers. I'm happy to help just in case it might be used in the future.;)
 
So I move Alt Equipment entries to a new profession?
The simplest approach is as follows:
Find the line "<ProfessionSubTypes/>" (it's the last in a profession)
Replace it with
Spoiler :
Copy paste from XML instead because I suspect spacing is screwed up on the forum.
Code:
	<ProfessionSubTypes>
		<ProfessionSubType>
			<Type>PROFESSION_CALVARY_LEATHER</Type>
			<Description>Horseman(leather)</Description>
			<iPower>175</iPower>
			<ArrayEnable>022</ArrayEnable>
			<CombatGearTypes/>
			<YieldEquipedNums>
				<YieldEquipedNum>
				  <YieldType>YIELD_LEATHER_ARMOR</YieldType>
				  <iYieldAmount>25</iYieldAmount>
				</YieldEquipedNum>
			  </YieldEquipedNums>
			  <FreePromotions>
				<FreePromotion>
				  <PromotionType>PROMOTION_ATTACK_LEATHER</PromotionType>
				  <bFreePromotion>1</bFreePromotion>
				</FreePromotion>
			  </FreePromotions>
		</ProfessionSubType>
	  </ProfessionSubTypes>
Update type and description. Set something in iPower, which is how strong the AI views the profession. Presumably value of parent +25 would make sense.

If there are no negative values in AltEquipmentTypes:
copy content of AltEquipmentTypes into sub's YieldEquipedNums.

If there are negative values in AltEquipmentTypes:
Copy YieldEquipedNums from parent, then add AltEquipmentTypes. This mean if parent has 25 YIELD_LEATHER_ARMOR and AltEquipmentTypes has -25 YIELD_LEATHER_ARMOR, then the result is 0 and sub shouldn't mention YIELD_LEATHER_ARMOR.

Second digit in ArrayEnable should be changed to 1 as YieldEquipedNums now overwrites parent. (2 means adds to values written in parent)

Copy AltFreePromotions into FreePromotions.

Remove alt equipment from parent. Both AltEquipmentTypes and AltFreePromotions can be completely omitted.

does that mean the new professions has this as an alt equipment entry or as it's standard equipment? I am assuming the latter?
Alt equipment is doomed and will be removed from DLL once no profession uses it anymore. Sub professions will be added as a standalone profession, though the GUI treats them differently. Technically (AI point of view) they are unrelated professions.

I am also assuming that I need to move the alt free promotions as well, and delete the alt tags as well, in other words completely remove all knowledge of their prior existence!!! [pissed]
I don't think it is that much worse that promotions should be copied too.
 
ok so it looks like I completely misunderstood what was said...

there have been a lot of conflicting statements about it all.

So the new info is going into Profession Subtype, didn't notice that before.

So we are not changing the entry name of both Parent and Sub, Just the Sub.

So we have SKIRMISHER3 and CROSSBOWMAN_MAIL

Ok I will restart after lunch and do it all again
 
Yes the problem was that originally you said it was the unitinfo was the only one that should be changed, then Kail asked if you were correct, then everything got confusing :D
I went back, noticed I made a copy paste error with the filename, didn't notice Kailric's confusion about it and now I feel like such a jerk :aargh:[pissed]:hammer2::wallbash:

It is CIV4ProfessionInfos.xml which we need to modify.
 
Alt equipment is doomed and will be removed from DLL once no profession uses it anymore. Sub professions will be added as a standalone profession, though the GUI treats them differently. Technically (AI point of view) they are unrelated professions.
Good bye Alt equipment, :cry: while others thought of you as coding taboo, I thought of you as brilliant creative ingenuity. :D Life continues...


I went back, noticed I made a copy paste error with the filename, didn't notice Kailric's confusion about it and now I feel like such a jerk :aargh:[pissed]:hammer2::wallbash:

It is CIV4ProfessionInfos.xml which we need to modify.

Wow, a lot has went one while I was sleeping :) That's one issue Night and I have is we are on opposite sides of the planet and sometimes we don't reply back till the next morning.

Well, As you say, this file will probably not be used, but I don't mind. You are the designers. I'm happy to help just in case it might be used in the future.;)

You rock, Trade Winds! Sorry for the confusion. We have a script that auto adds the required information to the UnitInfos.xml, but we know your willing and able to help out so that is very much appreciated. Hold up on any progress at the moment and lets get all on the same page again. Lib. Spi't has been working on the Professions.xml lets see what he gets done.

I added geartypes to sub professions and pushed this change. I also added ArrayEnable.

Code:
<ArrayEnable>012</ArrayEnable>
<CombatGearTypes/>
<YieldEquipedNums/>
<FreePromotions/>
The options are:
0: use parent settings
1: use sub profession settings
2: merge sub profession settings with parent

ArrayEnable has 3 digits, one for each array. In this case the settings are
0: <CombatGearTypes/>
1: <YieldEquipedNums/>
2: <FreePromotions/>

Awesome! I am a bit confused with the options and ArrayEnable. So, In ArrayEnable if we are adding all three then our number would be "012"? If we are adding just Combat Gears would the number just be "0"?

And on the "options" to use parent settings etc, exactly where are these options set?


Yes the problem was that originally you said it was the unitinfo was the only one that should be changed, then Kail asked if you were correct, then everything got confusing :D

I should have the file ready to upload in a couple of hours... but now I neeeds food!! :D

Ok, did you get this file complete? I see where you said you are still working on it. Are you using the latest version that Nightinggale pushed to git with CombatGears? If not, you can copy and paste your work (or I can) into the updated file and then add in the new XML tags, so no worries there.


PS, I am really excited about revisiting my Unit and Graphic workshop:) With these new subprofessions we have a bunch more options. I spent a bunch of hours getting all those Units into the Mod and I am proud of each one. I think they are what really give the mod its character and I am happy to give them more company:)
 
OK!

I THINK it is done.... :hammer2:

Please check and confirm I think I got it right but I is well confused!! :D

I think I am right between the two of you geographically :D

Hopefully if nothing else it will minimise the amount of extra work!

Ah ok looking at Kails explanation, it looks like I messed up some promos. I copied those over in the same way I did equipment...

So a 012 array will need to change to a 011 I think...

Also I did not change the Knight ones, although it looks like they could now have a gear setting change in the sub profession...
 
Awesome! I am a bit confused with the options and ArrayEnable. So, In ArrayEnable if we are adding all three then our number would be "012"? If we are adding just Combat Gears would the number just be "0"?

And on the "options" to use parent settings etc, exactly where are these options set?

Code:
<ArrayEnable>[COLOR="Red"]0[/COLOR][COLOR="Blue"]1[/COLOR][COLOR="Green"]2[/COLOR]</ArrayEnable>
[COLOR="red"]<CombatGearTypes/>[/COLOR]
[COLOR="blue"]<YieldEquipedNums/>[/COLOR]
[COLOR="Green"]<FreePromotions/>[/COLOR]
Each digit works together with one array and the settings for the arrays can be set individually. This mean any 3 digit combo of 0, 1 and 2 can be used.

The options are:
0: use parent settings
1: use sub profession settings
2: merge sub profession settings with parent

Loading a sub profession mean loading the parent, then deal with sub settings. If the setting is 0, then nothing happens and the parent (already loaded) settings will be used. If the setting is 1, then the parent settings will be deleted and new data will be read. If the setting is 2, then the new data is read and added to the existing arrays.


Good bye Alt equipment, :cry: while others thought of you as coding taboo, I thought of you as brilliant creative ingenuity. :D Life continues...
It is creative and fundamentally not bad. However getting full professions to play with is superior to alt equipment and it will not confuse the AI. It's a good idea, which became obsolete by a better idea. Kind of like how steam ships were a great improvement, but aren't used anymore because something even better came along.


I just wrote a script to fix XML indents. I didn't use it on the files as it would mess up when other people work on them at the same time. However it does mean that once we take a break from XML, we can correct this. This mean we shouldn't bother to spend too long fixing this manually.
 
OK!

I THINK it is done.... :hammer2:

Please check and confirm I think I got it right but I is well confused!! :D
A brief look reveals no serious problems. There are a few like giving leather armour to peasants makes iPower go from 100 to 75 (should have been 125) and other small issues like that. I will look deeper into this later today. We might actually get rid of alt equipment a lot faster than I expected. Also we started to work together as a team rather than a group of individual with individual tasks and goals.
 
Ok Fixed the peasant typo and a couple others, will upload again in a moment.

Ok this should now be bug fixed and typo free!

Edit:

I was wondering, does Col have the ability to have unit maintenance costs per turn like Civ4?

With things like the tax income and sales per turn system, this might be a good thing to bring back for adv. units like knights? I know it would be good for World History.
 

Attachments

Also we started to work together as a team rather than a group of individual with individual tasks and goals.

Wizards and Monkeys Unite!!!


:w00t: :w00t:


Monkey puts down hammer, picks up pen and goes back to copying the tech tree into his design document!

EDIT:
Also I forgot to mention, there is a typo CALVARY instead of CAVALRY, I did not change it incase it messes up other stuff!
 
The file looks good. I edited civics to invent the subtype when the parent is invented (we can change that later). Then I ran the graphics script and all the subtypes appear like I expected. I committed and pushed this change. This mean Lib.Spi't is mentioned in the log, which is the first time that happened :)
https://github.com/Nightinggale/Medieval_Tech/commit/07f45c79ed7d3a663da1755779f95b1a1eeaada1

Also I forgot to mention, there is a typo CALVARY instead of CAVALRY, I did not change it incase it messes up other stuff!
I don't feel like touching that either. I know it will mess up when they are invented and graphics, but the dangers lie in all the places I'm unaware of.

In fact there is a task ahead of us with military professions. Some types are poorly named and we should consider how the different professions group together. iPower appears to have been set to 100 in many places regardless of unit strength.

Getting an overview of all military professions is likely a returning issue. I will look into making a script to read the XML and turn it into a txt file (specific details only). This txt file will then have a layout, which works well when read into a spreadsheet and we have the overview we are looking for (hopefully).

Once we have the overview we can rename/move/change professions like we want. However as a lot of places needs changing I need to come up with some automated approach (a new script). I also want a script where you go "I want those graphics for this profession". Looks like I will be doing quite some scripting in the near future.
 
I cleaned up XML, intended it correctly, solved a few newline issues and cut the 12k character long description of Canute the Great into two lines (git didn't like 10k characters in a single line)

I now removed all DLL code to handle alt equipment. The code is now much simpler and cleaner. I spotted one or two places where it might be a bit buggy, but I didn't bother to investigate code I was deleting anyway.

Now I would say that the transition to the new profession system is complete. There is still some work to be done with regrouping professions and stuff like that, but we are in a position now where the code change is done and the gameplay kept all the abilities we wanted to keep.
 
Back
Top Bottom