• 📚 Admin Project Update: I've added a major feature to PictureBooks.io called Avatar Studio! You can now upload photos to instantly turn your kids (and pets! 🐶) into illustrated characters that star in their own stories. Give it a try and let me know what you think!
Maritime Weather+

[New Feature] Maritime Weather+ 44

The uncertainty to me is, do I need brackets around the conditional? The existing "not ... ==" failed, unbracketed. I don't understand why exactly, it's poor form perhaps but shouldn't it evaluate to same as the ~= form?

My guess is it failed cuz 'pPlot:GetFeatureType()' immediately following an 'if' of 'if not', somehow evaluates to "true"; maybe cuz it returns a non-nil value? If so original code is basically checking if false == -1, and never triggers correctly.

So for 'if pPlot:GetFeatureType() ~= FeatureTypes.NO_FEATURE' we might get another problem, as it might evaluate this as 'if true ~= -1' and misfire as well?

to be safe I'd change the line to

Code:
if (pPlot:GetFeatureType() ~= FeatureTypes.NO_FEATURE) then return false end
 
~= is always to be preferred to "not =="
Without brackets it evaluates "not pPlot:GetFeatureType()" that gives a boolean then you compare with a number (-1), so it gives error.
You don't need brackets in your solution:
Code:
if pPlot:GetFeatureType() ~= FeatureTypes.NO_FEATURE then return false end
But you could just simply type:
Code:
if pPlot:GetFeatureType() > -1 then return false end
Same result given -1 is the lowest value.
 
Tekamthi updated Maritime Weather+ with a new update entry:

Vanilla-fied

Main MW+ mod is now compatible with vanilla!
  • refactored code to work with vanilla lua functions
  • storm is now a feature-only -- improvement/feature hybrid plot is unnecessary (thank you zai4z!)
  • removed all improvement-blocking lua
  • gameplay adjustments for vanilla/VP inter-compatibility:
    • all previous storm promo effects scrapped & re-designed
    • storm plot costs base 4 moves
    • weather sensitive promo applied to all air units: -20% attack in storm
    • all-weather promo
      • double move in storms (storms cost 2 moves)
      • applied free to all moveRate = BOAT units (ie all steam- and petro-powered boats)
      • available as promo choice to all melee, ranged, mounted, armor, gun, siege, recon after discovery of steam power
    • submarines receive 'ignore terrain cost' to negate all storm move penalties
      • atoll is now impassable to sub as balancing trade-off
    • hovering unit promo gives -20% combat strength in storm
  • bug fixes:
    • resources should now remain visible when a storm traverses the plot
    • speculative fix for reports of late-game crashes (could not reproduce): storm spawn rate tapers down as the game progresses -- later eras should result in 1/4 to 1/2 the storm spawns seen in early game
    • corrected logic that may have been causing mod to silently re-initialize itself during play
    • most unused code snippets that had collected through early dev stage have been cleaned up, though these were unlikely to have caused any in-game effect
    • re-tag caravels and turtle ships as moveRate = WOODEN_BOAT instead of BOAT
Due to significant code refactoring this mod should still be considered 'experimental', though many issues have been resolved since v1. Tested v42 in 4 observer games allowed to run to industrial or later -- my time to actual play is too limited, have only managed a few dozen turns of actual human play -- need user feedback to find any additional issues!

Fixed feature-conflict in static storms alternate version.

CF isn't allowing me to edit OP rn so some details may be mis-matched there

edit: all testing complete in (otherwise-)unmodded vanilla & VP 4.22 -- have yet to test in VP 5.0+
 
Last edited:
Tekamthi updated Maritime Weather+ with a new update entry:

balance adjustments, bugfixes, workarounds & refactoring

As noted elsewhere, this mod was adapted from another by relying heavily on a vibe coded standalone framework (greatly helping get it off the ground ~quickly) -- but vibe coding misses a lot of nuance. Much if not all of that has now been scrutinized and should now be fixed where it was lacking. Most reported (and many unreported) issues have been addressed to improve stability and general playability of the mod. For vanilla its still WIP to some extent due to firaxis bugs (plot visibility in particular), but in either case have tested multiple observer games to completion on standard/standard games and smaller/quicker without issue.

New functionality:
  • storms on land now 3 move cost, in water 5 move cost
  • storms apply promo in-plot, -1 moves, -1 vision
  • storms can now traverse flood plains and atoll (but still not the other features)
Bugfixes:
  • fixed art conflict with resources (1 or 2 were not behaving correctly)
  • fixed obscure situations where storms could get stuck and never despawn
  • fixed storms not spawning at all in late game
  • many other minor logic issues fixed or improved
Workarounds
  • (VP only) issues with permanent vision popping up in random plots have been mostly addressed
  • existing illegal-ocean-movement workaround has been adjusted to better identify offending units
Other
  • reverted storm spawn diminishment in late game (was bugged anyway to no-spawn rather than less-, but game is stable in testing with same amount of storms throughout, after other fixes & refactors)

Read the rest of this update entry...
 
Back
Top Bottom