[MODCOMP] - XML Cleanup & Expansion

Would it be possible to request an improvement tag in the XML like this:

<AddsCulture>
<CultureperTurn>x</CultureperTurn>
<CultureRange>x</CultureRange>
</AddsCulture>

So that it would be easy to claim territory with forts and other improvements? Doing it in python is possible but glacially slow.
 
That is possible, and a good idea. I've often hated how many Techs the Goody Huts are able to grant you (ought to be Tier 1 only, maybe a few Tier 2 as well though). Normally not an issue, but with Graveyards not being insta-popped by Culture Borders it means you can save up to hope for some of the more advanced techs free later in the game. Changing it to grant an amount of science instead would be a lovely modification. I'll probably have to add a field to GoodyInfos for that one.... hrm.

The Graveyard code is in Python, so at least that piece might be able to be rewritten without a DLL change - just don't use receiveGoody and instead add a certain amt of beakers to the team...
Code:
def spellRobGrave(caster):
	CyGame().changeGlobalCounter(1)
	pPlot = caster.plot()
	pPlot.setImprovementType(-1)
	pPlayer = gc.getPlayer(caster.getOwner())
	iRnd = CyGame().getSorenRandNum(100, "Rob Grave")
	if iRnd < 20:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_GRAVE_LOW_GOLD'), caster)
	if iRnd >= 20 and iRnd < 40:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_GRAVE_HIGH_GOLD'), caster)
	if iRnd >= 40 and iRnd < 60:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_GRAVE_TECH'), caster)
	if iRnd >= 60 and iRnd < 80:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_GRAVE_SKELETONS'), caster)
	if iRnd >= 80:
		pPlayer.receiveGoody(pPlot, gc.getInfoTypeForString('GOODY_GRAVE_SPECTRE'), caster)
 
So why don't you just merge that in? That looks like the useful kind of thing someone would have already suggested by now ;)



I believe this modcomp only added 2 new tags, <bSpreadCultureControl> and <iCultureBorderRange>. It doesn't actually produce culture, just controls borders.
 
Because it already exists for anyone who wants to use it as written, and, to be stuck-up about it, I can probably write something far better when a need for it arises that seems worth implementing. But without a specific in-game goal it'll be pretty boring code. I guess the MODCOMP doesn't do nearly what Mailbox is hoping for though.

Haven't actually posted that I did it, but I added the Science fields to Good Infos a while ago. Tons of changes since I last released this one because I am trying to get a large project done and I keep doing small things to clear my head. Haven't compared back to base FfH in quite some time, thus no release of an update for this thread since I do not know if it will be operational.


Mailbox: What do you want the range to do? Place a limit on how far out the culture of the Improvement can spread, or make it apply the culture to all of those tiles right off? Haven't looked at precisely how Culture is run, but I am assuming that it is applied to all tiles with a "fade" effect as you get farther from the City, and that the range of tiles you are able to hit expands when you reach certain pre-defined levels. As such, having a range means you hit all the tiles right away for a city, it just changes the range periodically. Might be good to have both a range (initial) and limit (final), but then you have to ask about when precisely it changes current range of application too.

Also would need to know what kind of range you had in mind. City-Style BFC (annoyingly bizare shapes), raw Squares, or Diamonds (1up+1over=2).
 
What I originally had in mind for such code would be an easy way for improvements to apply a cultural effect in the same way that a city does. Pretty much just a simple culture addition to each tile for whoever owns the improvement if it has the right tags. For the range I was thinking maybe a three part system with 1 only applying culture to the square of the improvement, 2 being the simple 9 tile square, and 3 being equivalent to the BFC.

Culture for the rings would be 100% to the original square, 50% to the second ring, and 25% to the third ring. So 8 culture would mean 8-4-2 being applied per turn to each ring.

If you wanted to make such a thing more general, I believe the Sprawling code would designate areas based on the number given correctly. That way you could continue to apply culture and just divide by 2 for each successive ring.
 
Snarko is back! And he released a new Options Modmod. I haven't had time to play it yet, but it does some things that I've been wanting for quite some time. You should consider including it.


Edit: I noticed that Fall Further's DLL/schema seems to include quite a bit more than the download in this thread. When will this be updated?

Hopefully it will be out by tomorrow morning, so I can get it before I go home and not have to rely on a very weak intermittent connection to a neighbor's unsecured wireless network to download the SDK/schema for my modmod.
 
First of all, thanks for including my proposal in the wish list. Now I only have to wait... :mischief:

I really like many of the changes. I hope you would not mind if I will move orbi to use your dll? It will not be before 0.33, but I plan to do it a t some point.

Also, would you consider to include in the trait not only yeld changes for terrain, but also health changes from feature? That would allow Mazatl to just use normal jungles instead of deep ones and probably save some python...
While I am asking, is it possible to change goodyinfo to allow food be added to a city via goody? Currently the only way I can think of is an event.

Hmm... one more thing. I was thinking of adding the ability to lower damage from ranged attack to some buildings (to shield units in the city). I suppose you are not intertested in such addition as nor FfH nor FF use ranged attack, but just wanted to ask if it is really possible.
Anyway, both things are not that important.
 
I am all for removing Python lines. So consider that one added. I REALLY need to update this modcomp soon. Most likely I will be dropping WorkerMod completely so that I can just post Schema files, the DLL, and the GameOptions/Globals. Then keeping this updated will be quite a lot quicker/easier to manage.

Main reason I haven't touched Ranged stuff yet is simply that I haven't been in that area of the code so far, and I suspect it is quite a beast. Lots of information to update in numerous locations and whatnot. This tag would be the same one which is available on Improvements though, right? If that is the case it ought to be fairly simple to clone.
 
Tease, I can already see stacks off archers roaming around shooting at stuff from a couple tiles away as the warriors close on them. Or firing at the summoner that keeps throwing fireballs at them.
 
I did some tests and unfortunatelly air combat and ranged combat are completly different. That is the reason no xp is granted from ranged combat. I had to workaround this by giving siege engines free xp, just as mages. By the way, is it possible to change this?
Anyway, I tried both improvements and buildings. In fact buildings already have the same tag as improvements for air combat, it is just called <iAirModifier> and that is why I did not found it at first.
Anyway, here are the results. Air damage protection from both improvements and buildings do not affect inflicted ranged damage at all. Bombard protection from buildings does not work, either.
However, normal city and improvements defences do work. Even normal defence from forests and hills works :crazyeye:
I did not spot it in the normal play as the effect is not big. Unprotected unit got 21% damage in one of the tests, while protected in the city (210% defence) got 14%. Also, the protection seems to have diminishing results as it goes up, as I got 16% with just 75% defence.
So, no need for a new tag, but if the damage protection could be improved, like 50% protection at 100% defence, it would be great. I think that lowering ranged damage from 21 to 11% at 100% defence would make more sense.
By the way, I discovered that units that ignore building defences ignore their protection from ranged attacks too. And that is exactly how I wanted it to work... :)
 
Sorry, double-posted while editing, but as I aleady did it...

Tease, I can already see stacks off archers roaming around shooting at stuff from a couple tiles away as the warriors close on them. Or firing at the summoner that keeps throwing fireballs at them.

That is exactly how it works in my modmod. But not couple tiles away, just one ;) (well, two for dwarven cannons and Man-o-wars, but that is it)
 
Coolness that it is already there/working. Balance and tweaking stuff isn't something which can really be done easily by someone who doesn't have a direct and immediate use for a feature sadly, so I'll just pluck it off the list. The good news is that once you know what the tag is in XML it is generally quite easy to find all references to it in the DLL and spot the location to tweak things :)
 
I have some questions about promotion tags:

iChanceMiscast:
As a positive modifier to a unit without a miscast chance does it act as a % the unit will fail to cast a spell? ie, you press the spell's button and use up the unit's casting ability for the turn, but nothing happens x % of the time? And if there's python defined in the unitinfo for mistcasting it takes effect?

Citybonuses:

How are these used... like this?

Code:
<CityBonuses>
    <bApplyRival>1</bApplyRival>
    <CityBonus>
    <fFood>-2</fFood>
    </CityBonus>
    <CityBonus>
    <fHappy>-1</fHappy>
    </CityBonus>
</CityBonuses>

And: A "Rivial" civ is all non-Team civs? An "Enemy" civ is a civ you're at war with?
 
iChanceMiscast works exactly like setting iMiscastChance on UnitInfos. So a large positive means they will fail their spellcasting and waste their chance to cast for the turn, it will also trigger anything entered as the Python call for the Miscast at that time.

CityBonuses would be used this way:
Code:
<CityBonuses>
	<CityBonus>
		<bApplyRival>1</bApplyRival>
		<fFood>-2<fFood>
		<fHappy>-1<fHappy>
	</CityBonus>
	<CityBonus>
		<bApplySelf>1</bApplySelf>
		<fFood>.25</fFood>
		<iBonusRange>2</iBonusRange>
	</CityBonus>
</CityBonuses>

The first setup does what yours seems to have been written to do. Removes 2 food and adds 1 Anger for each flagged unit on the same tile as a Rival city. The second would make this same promotion also grant each of your cities within 2 tiles .25 food, so with 4 units being within 2 tiles of the same city that you own, you gain 1 food.


Self = just you
Team = all teammates, but NOT you
Rival = all non-teammates, that are not at war with you
Enemy = all who are at war with you


Also note that in the current release of my sourcecode only Happy, Health, Defense, Free XP and Culture do anything. Working on making the others functional right now, some are a tad tricky. Mostly though I am trying to redo how Culture works so that instead of driving the city negative you start to infect some of your own culture into it.
 
Source updated for FF via the link in Vehem's thread. Now all CityBonuses fields work properly, though some display work was required in Python to accomplish it, so FULL proper working of the fields will have to wait for 042 most likely.


I have to sort out all of the BUG and Unitstats stuff I inherited from FF before I can post the MODCOMP for base FfH again, and that may take some time sadly. So it is unlikely I post 1.18 anytime before 0.42 of FF is out.
 
Source updated for FF via the link in Vehem's thread. Now all CityBonuses fields work properly,

And now I start trying to find excuses for Scions units to use them.. :)

I'm getting an XML error when the game loads using the promo. below. Error says something about expecting the age minimum/maximum fields and gives the line# of <CityBonuses>. I'm using the un-updated 041D code - expected? Something wrong with the Promotion's XML?


Spoiler :

Code:
          <PromotionInfo>
            <Type>PROMOTION_SCHEMER</Type>
	    <Description>TXT_KEY_PROMOTION_SCHEMER</Description>
            <Help></Help>
            <Sound>AS2D_IF_LEVELUP</Sound>
            <iPreReqLevel>-1</iPreReqLevel>
			<CityBonuses>
				<CityBonus>
					<bApplyRival>1</bApplyRival>
					<fCulture>-1</fCulture>
					<fGold>-1</Gold>
				</CityBonus>
			</CityBonuses>
            <UnitCombats>
                <UnitCombat>
                    <UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
                    <bUnitCombat>1</bUnitCombat>
                </UnitCombat>
            </UnitCombats>
            <Button>Modules/SOP/buttons/council.dds</Button>
        </PromotionInfo>
 
All my new fields are alphabetical. So after iPreReqLevel would come iPreReqMaxAge. Anytime you get things out of order it will mention what should come immediately next. Back to the alphabetical thing, CityBonuses would come before any of the i___ fields, but after all of the b___ fields.

And with Diplomacy working, almost any CityBonus which applies to Rivals ought to include a fDiplo value so that the AI will respond to it properly.
 
Back
Top Bottom