Resource icon

Proper Mountain Movement & Exploitation Mod 2017-04-08

Gleb Bazov

Warlord
Joined
Feb 13, 2017
Messages
176
Gleb Bazov submitted a new resource:

Proper Mountain Movement & Exploitation Mod - A mod enabling mountain exploitation by cities an unit movement, but only for select unit types.

This mod enable mountain exploitation by cities (a fairly straightforward change) and movement over mountains, but only for select unit types.

Rather than permitting all units to travel over mountains, only the following units types are allowed to traverse the peaks:
  1. Civilian Units (Settlers, Builders, GreatPersonIndividuals, Naturalists, Religious Units);
  2. Recon Units (Scouts, Rangers); and,
  3. Helicopters, Observation Balloons and non-mechanized...

Read more about this resource...
 
UPDATE: I have compiled LUA script that achieves the following:
  1. Index and track through a table a roster of each player's mountaineer (unit capable of traversing mountains) units;
  2. Index and track each mountaineer unit's location throughout the game;
  3. Listen for and identify any instance when a mountaineer unit moves onto a mountain;
  4. By random chance either:
    1. allow the mountaineer unit to remain on the mountain, or
    2. damage the unit and push it back to the location where it started, before moving up the mountain, and
    3. destroy the unit if it is damaged beyond 100 points;
    4. all the while maintaining the unit's promotions if any.
Here comes the catch, however. Because I've found no function in CIV 6's LUA that allows me to actually force a unit back from the mountain to the plot from which it moved, I've been forced to improvise and destroy the old unit while creating a new one simultaneously to simulate the failed attempt to traverse a mountain. The promotions and damage can persist no problem, so that's less of an issue. I still can't find a way to persist the unit's veteran name, but I might be able to fix it with time. There is a greater problem, however.

With civilian units, like settlers, GPs, etc., there is no issue - because they can't earn experience or promotions. However, with any military unit (like scouts or rangers) that this mod allows to climb the mountain I face a dilemma. I can persist their promotions and damage in the new unit without a problem, but the way the game's experience/promotions system is coded, it produces an unfortunate hiccup. Despite getting x number of promotions up front, the new units are still treated by the game as brand-new units that received no promotions. That is, the promotion are active, but, instead of having to earn x++ number of experience points for the next x+1 promotion, only 6 points are required. That wouldn't be a game-ending problem in and of itself (although this is quite ugly, there are ways to circumvent the problem by delaying the unit's experience progress using LUA), but a strange bug crops up in the game, where a unit that's given too many promotions off the bat has its promotion mechanic lock up. It stops being able to use its new earned promotions and experience points, but still continues to earn them. This also might be a product of conflicting LUA codes that I am running in several of my active mods, but I doubt it.

So, here is my dilemma. I'd love to be able to code a way to prevent a unit from climbing the mountain, but I see no way of doing it using in-game scripts (there are ways, it seems, of doing it in the UI context) without the create/destroy process. And the process only works in an elegant way for non-promotion-capable units.

Thus, I have a choice: (1) implement the process as I have done, and keep trying to find a solution, (2) instead of pushing the unit back, only damage it if it climbs the mountain, or destroy it (and perhaps keep the original mechanic for the civilian units); or (3) keep the original mechanic and just live with the fact that the unit will lose all of its promotions (well, I can say that... heh... the unit was so damaged, that it forgot how be a zweihander sword-wielder and everything else it learned :))).

OR, and I just came up with this: on the first go round, the first time a unit is damaged on the mountain, give it a chance of getting a "mountainclimber" free promotion that will keep it safe from any future mountain failure (so I won't have to ever re-create it again), and make that chance a 100% if a unit has at least one promotion (and keep it on the mountain instead of re-creating it).

Actually, I might just with this :). BUT, please let me know if anyone has any other suggestions, I'd love to hear them!
 
when a settler plants a city on the mountain, weird stuff happens. Can you make mountains tiles unsuitable to settle on? (like natural wonders)
 
Top Bottom