DLL - Various Mod Components

I was aiming to mimic the "teleport hostile units out of my territory on out-break of war" mechanism

Very good idea, this goes well together with the game mechanics!

Why not just use FireTuner to place an AI unit in the fort with you, and then declare war?

TBH I haven't thought of this and we wanted to play MP anyway, but just tried it with Firetuner in different situations/ unit constellations and it works like a charm!
 
Just a couple of v71 teasers ...
 

Attachments

  • TradeRouteViaPassableForts.jpg
    TradeRouteViaPassableForts.jpg
    76.6 KB · Views: 243
  • UI-Destination.jpg
    UI-Destination.jpg
    87.4 KB · Views: 217
That looks nice!
I already had some trade routes through passable forts, but it happened only every now and then on coincidence it seemed, and I couldn't figure out in which situations they would utilize the forts and when they'd just go around (most of the time).
Will those routes be relocated when the fort becomes unpassable due to plundering or the expansion of enemy territory?
The UI-Destination looks really helpful, but maybe I would only use 2 alternating colours like green + yellow. On the other side.. more colours are faster to count when you want to see the number of turns (like green is always the third turn, yellow the fourth and so on..). Hmm.. maybe an optional setting would be nice?! :D

Anyway these are some very good aditions!
 
I already had some trade routes through passable forts

either in your dreams or caravans (not cargo ships)

Will those routes be relocated when the fort becomes unpassable due to plundering or the expansion of enemy territory?
Trade routes can pass through enemy territory - they just have a habit of getting plundered!

And yes, I'm intending to fix the Firaxis bug ... where a sea trade route passing through a city that is razed (or a fort that is pillaged) will happily keep sailing through the (now) land tile
 
either in your dreams or caravans (not cargo ships)

I'm pretty sure it was a sea route.. maybe with the CP!

Trade routes can pass through enemy territory - they just have a habit of getting plundered!

And yes, I'm intending to fix the Firaxis bug ... where a sea trade route passing through a city that is razed (or a fort that is pillaged) will happily keep sailing through the (now) land tile

But forts in enemy territory cannot be passed by ships, right? :confused:
 
Small request: Could the City Forest Bonus be extended, so that it works for jungle tiles too? That would be more consistent. :)
 
But forts in enemy territory cannot be passed by ships, right? :confused:

No, in the same way that units can't enter enemy territory. Forts in unowned territory also can't be entered if the fort is occupied by a hostile unit.

But Cargo Ships and Caravans are treated completely differently by the game core - they can enter any territory without Open Borders agreements - cities/forts are just an extension of this behaviour
 
And this is why coding the DLL is a real PITA ...

Everywhere (two places) that the WaterTradeRoute pathfinder checks for a city, it now also checks for a passable fort ...

... which means that Carthage can create a water trade route to Utique ...
attachment.php


... but why the #!}$~#! can't Utique create the reverse route back to Carthage!!!
attachment.php


However, if there is a city to form the link between the ocean and the lake, the TR from Carthage now takes a longer route (why!!!)
attachment.php


And we can now create a route from Utique!!!!
attachment.php



#£$~{!#^%~}!!!
 

Attachments

  • TR_Issue1.jpg
    TR_Issue1.jpg
    82.1 KB · Views: 786
  • TR_Issue2.jpg
    TR_Issue2.jpg
    77 KB · Views: 753
  • TR_Issue3.jpg
    TR_Issue3.jpg
    95.6 KB · Views: 826
  • TR_Issue4.jpg
    TR_Issue4.jpg
    96.9 KB · Views: 782
"fun" must translate differently in German ;)

Edit: Fixed. And also solved the "why does this prefer to go on a longer journey via a city" issue as a bonus

attachment.php


Now to fix the bug where a sea trade route persist through a razed city

Edit 2: But first I'll fix the Firaxis "we didn't need it for the scenario" bug with trade routes over pontoon bridges

attachment.php
 

Attachments

  • TR_Issue_Fixed.jpg
    TR_Issue_Fixed.jpg
    165.2 KB · Views: 782
  • TR_Issue_PontoonBridges.jpg
    TR_Issue_PontoonBridges.jpg
    67.9 KB · Views: 760
Hehe :lol:

Woah, trade routes were not able to pass pontoon bridges? I've never noticed even though I use them in every game, good to know!
And even better you are going to fix it! :thumbsup:
 
@Whoward I came upon a small mod on the workshop that simply alters the influence decay with city-states based on distance. Trouble though it uses custom dll. Would you be interested in incorporating that if you'd get access to the source code, or do you have any plans to add a similar thing? You seem to have lots going on though, hope you'll get the time to look into it.
 
Woah, trade routes were not able to pass pontoon bridges? I've never noticed even though I use them in every game, good to know!
And even better you are going to fix it! :thumbsup:

Now fixed. Along with water trade routes persisting after a city they pass through has been razed (along with pillaging forts they pass through)

While I'm deep in the AStar route finding code I'm going to try and fix pathing through forts as well.

Then I'll release v71 on an unsuspecting world!

@balparmak - I'm not merging any other DLL mods - it just takes too much time.
 
Sounds good!
Maybe I can throw in another request just in case that one is easy to fix:
Helicopter Gunships that hover over coastal waters cannot attack naval units. Can this be changed somehow so they can?

It just came to my mind while I was browsing the TechTreeUpdate.xml from the Smokey Skies Scenario, and noticed that hovering Airships are able attack ships and embarked units.


edit: Nevermind, Airships cannot attack ships or embarked units either, even though their AI setting is set to Attack/ Escort/ Explore_Sea. :confused:
Well if it is possible to allow hovering units to attack naval units it still would be really nice, otherwise I just set them to ranged combat with range = 1.
 
Getting the hang of this path finding lark!

attachment.php


WRT helis, I though they did change to ranged attack over coast ... IIRC there is a horrible CTD in the graphics engine when a land unit melee attacks a sea unit ... I'll have a look, but I remember there being very good reasons I removed the ability when I was doing that code

W
 

Attachments

  • WaterRouteFinding.jpg
    WaterRouteFinding.jpg
    66.4 KB · Views: 753
Oh that looks promising! :)

WRT helis, I though they did change to ranged attack over coast ...

At least with the Terrain Crossing mod they don't, but changing to ranged attack over coast sounds like a very good solution!
Thanks a lot for having a look!
 
At least with the Terrain Crossing mod they don't ...

You'll need to lift some bits of SQL from "Units - Steampunk Airships", specifically

Code:
-- Permit hovering units to only heal when over land
UPDATE CustomModOptions SET Value=1 WHERE Name='UNITS_HOVERING_LAND_ONLY_HEAL';  

-- Enable hovering units to range attack over coastal tiles - range 1, ranged str = 1/2 of melee str
UPDATE CustomModOptions SET Value=1 WHERE Name='UNITS_HOVERING_COASTAL_ATTACKS'; 
INSERT OR REPLACE INTO CustomModOptions(Name, Value) VALUES('UNITS_HOVERING_COASTAL_ATTACKS_RANGE', 1);
INSERT OR REPLACE INTO CustomModOptions(Name, Value) VALUES('UNITS_HOVERING_COASTAL_ATTACKS_MULTIPLIER', 1);  
INSERT OR REPLACE INTO CustomModOptions(Name, Value) VALUES('UNITS_HOVERING_COASTAL_ATTACKS_DIVISOR', 2);
 
V71 uploaded to my web site and GitHub

Mod includes Serp's German translation
DLL includes
  • pUnit:GetActivePath() - see UI - destination
  • Ships correctly path through forts
  • Land trade routes correctly route via pontoon bridges and tunnels
  • Sea trade routes correctly route via forts
  • All trade routes correctly cancelled if required improvement destroyed / city razed
  • Marble trade routes now require the marble to be improved!
  • Weaker unit evicted from multiple occupancy tile on out-break of war
 
Tested all the new features, and they work smoothly! :) (as usual!)
Especially the UI - Destination-upgrade is a real improvement! Very handy!

PS: Have you considered the bonus for founding cities on a jungle tile yet? ^^
PPS: The rule that changes attacks of hovering units to ranged ones over coastal tiles, does it check if it's a melee unit, or would it also affect hovering ranged units?
 
Back
Top Bottom