[New Feature] road-only diplo units

Tekamthi

Deity
Joined
Aug 12, 2016
Messages
2,007
THIS IS NOT A FULL MOD, AND NOT INTENDED FOR GENERAL PLAY. just a playable test for messing around with in firetuner/IGE basically, I wouldn't recommend dedicating much time to it beyond that... alterior motive to maybe draw some attention to an incomplete lua hook with good modding potential, if it were ever properly integrated for use

The attachment loads fine and behaves as expected in simple scenarios. Whether its playable beyond that, without eventually breaking the game, is unclear (idk how AI will handle a unit that cannot ever reach its destination in current version of VP, as will be the case... game might soft-lock or ctd) -- this is essentially a simplification of an old recon mod -- that mod did NOT crash nor soft-lock the game last i used it around vp 2.x era, but it caused AI to get affected units stuck most of the time. if nothing else, AI will be greatly disadvantaged accessing CS with diplo units, with unintended side benefit of having many extra eyes in rival territories

Theorycraft discussion on discord raised the premise of diplo units being restricted to roads -- on reflection, I had already built this mod years ago but for recon -- simplified my code and relabeled its effect to diplo units instead of recon, adjusting the movement rules to match the theorycraft concept. Basically, works as follows:
  • diplo unit can enter rival, but all movement anywhere is restricted to:
  • can enter unpillaged road/railroad
  • can enter river
  • can enter coast adjacent to land
  • can enter any TR plot to/from owned city
  • can enter all minor civ territory
  • overriding all of the above: cannot enter any civ territory that has denounced us or we're at war with
  • flat 1 move disembark (so it can disembark through cities and onto the roads on the other side)
  • diplo unit has invislbe submarine status (they're gonna be sitting ducks with these movement restrictions)
lua hook for GameEvents.CanMoveInto() needs to be supported by VP pathfinding for this (or any other mod that uses it) to work properly. As-is, the pathfinding correctly evaluates the destination plot pursuant to the modded movement rules, but none of the plots in-between, meaning it will sometimes try to pathfind immediately into a plot it cannot actually move through. Even if it gets the first few plots right, any destination of significant distance will not pathfind correctly. idk if there are any other hooks in which pathfinding can be forced to evaluate with this same ruleset....
 

Attachments

Last edited:
Back
Top Bottom