yairm210 / Unciv

Open-source Android/Desktop remake of Civ V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

River cannot be added on consol?

saud2410 opened this issue Β· comments

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

4.11.3

Describe the bug

I couldn't add river on world screen using tile addfeature river consol command.
In fact it did but the river is applied ON tiles, not between of them.

Steps to Reproduce

  1. Start or load a game to see world screen.
  2. Select any tile and check its info.
  3. Open consol and enter tile addfeature river.
  4. Check again its info. The tile now would have "river" and might have "fresh water" but there's no new sprite of river around it. Especially if it was a hill, its color would look different from any normal hills.
  5. Apply the consol command on any adjacent tile of it.
  6. Check there's no river sprite even between of "river tiles".

Screenshots

20240410_084039

Link to save file

Siam_-_0_turns.zip

Operating System

Android

Additional Information

No response

Console is only for those who know what they're doing. This is a prime example. Sorry.

No spoilers for now, don't wanna ruin the fun too soon.

Console is only for those who know what they're doing.

Wow, this is the last thing i expected to hear. Before i close this or not, please be more specific @SomeTroglodyte .

  • Am i just too ignorant to learn how to add river? Or it's actually unavailable for everyone?
  • Issue won't lead to apparent update on consol?
  • Do you think it's better to close this issue?

Hey come on, "No spoilers for now, don't wanna ruin the fun too soon." should clue you in I'm not being quite serious.

Spoiler: The game's rivers are not a Terrain Feature, the TerrainFeature "River" exists solely for Civilopedia and to fetch Stats from. Thus actually adding it to a Tile will lead to - unspecified unintended results.

We could re-route the console's addfeature through the terraform unique's code. But then - did I PR that River special-case for that or did that sink under the waves? Ah, yes, #11256...

So that's a 5-minute thing:

Index: core/src/com/unciv/ui/screens/devconsole/ConsoleTileCommands.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/com/unciv/ui/screens/devconsole/ConsoleTileCommands.kt b/core/src/com/unciv/ui/screens/devconsole/ConsoleTileCommands.kt
--- a/core/src/com/unciv/ui/screens/devconsole/ConsoleTileCommands.kt	(revision 5a40c4f56395a77ace6ac0b056bef3db1dbcf1d7)
+++ b/core/src/com/unciv/ui/screens/devconsole/ConsoleTileCommands.kt	(date 1709131971282)
@@ -1,6 +1,8 @@
 package com.unciv.ui.screens.devconsole
 
+import com.unciv.Constants
 import com.unciv.logic.civilization.Civilization
+import com.unciv.logic.map.mapgenerator.RiverGenerator
 import com.unciv.logic.map.tile.RoadStatus
 import com.unciv.models.ruleset.tile.TerrainType
 
@@ -41,7 +43,12 @@
         "addfeature" to ConsoleAction("tile addfeature <featureName>") { console, params ->
             val selectedTile = console.getSelectedTile()
             val feature = getTerrainFeature(console, params[0])
-            selectedTile.addTerrainFeature(feature.name)
+
+            if (feature.name == Constants.river)
+                RiverGenerator.continueRiverOn(selectedTile)
+            else
+                selectedTile.addTerrainFeature(feature.name)
+
             selectedTile.getCity()?.reassignPopulation()
             DevConsoleResponse.OK
         },

... BUT - need to think what to do on tile removefeature river - which would never do anything for the same reasons, and we don't have readymade code for the intuitive outcome.

... Or exclude from add/removefeature and do separate console commands with direction control? (like tile addriver north, tile removeriver southeast)

Actually, all of the above is coded, though it still has autocomplete incomplete , so not today, I'm off:
Untitled

Sorry for not being literate enough πŸ˜‚ Thank you for your work.

Sorry for not being literate enough

Nothing to do with education, only Unciv internals - so those were coder jokes at the expense of players, after all what else are players even good for... (πŸ€ͺ😈πŸ€ͺπŸ˜ˆπŸ™ƒ)