Coder Social home page Coder Social logo

Comments (14)

yairm210 avatar yairm210 commented on July 20, 2024

There's a "tile checkfilter" command, can you use that to check the filters?

from unciv.

SpacedOutChicken avatar SpacedOutChicken commented on July 20, 2024

I don't know how to use the console. Is there a guide for doing so?

from unciv.

yairm210 avatar yairm210 commented on July 20, 2024

https://yairm210.github.io/Unciv/Modders/Scenarios/#console

from unciv.

SpacedOutChicken avatar SpacedOutChicken commented on July 20, 2024

I've got the console open, but I can't make any sense of what I'm seeing. What should I be putting into the check, and what results should I be expecting?

Sorry if this is a dumb question.

from unciv.

SomeTroglodyte avatar SomeTroglodyte commented on July 20, 2024

tile checkfilter "non-[Fresh water]" I'd guess (select the tile to test outside the console first), as that is the part declared to be a "tileFilter" in the Uniques dox. Needs quotes and proper casing to be meaningful. I'd bet it's the lowercase 'w' - or otherwise the parser not understanding nested brackets.

Seems to me "Fresh water" vs "Fresh Water" vs "non-[Fresh Water]" vs "non-fresh water" is still not handled well... But how else can we reliably differentiate a water source from "supports a consumer"?

from unciv.

yairm210 avatar yairm210 commented on July 20, 2024

There was a problem in the checkfilter command, now fixed
That aside, checked, your exact unique is working absolutely fine for me
I confuse

from unciv.

SpacedOutChicken avatar SpacedOutChicken commented on July 20, 2024

When you build the improvement with the "Provides [1] [Stuff] <in [non-[Fresh water]] tiles>" unique in Fresh water tiles, does it still provide the stockpiled resource? Based on how I'm reading the unique, it shouldn't be doing that, but when I test it on my end, it's still doing exactly that. The "Stuff maker" makes the same stuff in Fresh water as it does in non-[Fresh water] and it's not supposed to be doing that.

from unciv.

yairm210 avatar yairm210 commented on July 20, 2024

Nope, it's working, and I even have a test to reproduce it

    @Test
    fun CityResourcesFromImprovementWithConditional() {
        // given
        val resource = game.createResource(UniqueType.CityResource.text)
        val resourceImprovement = game.createTileImprovement("Provides [2] [${resource.name}] <in [non-[Fresh water]] tiles>")
        game.getTile(1,1).addTerrainFeature("Oasis")

        // when
        game.getTile(1,1).setImprovement(resourceImprovement.name)

        // then
        val resourceAmountInCapital = city.getAvailableResourceAmount(resource.name)
        assert(resourceAmountInCapital == 0)
    }

from unciv.

yairm210 avatar yairm210 commented on July 20, 2024

And without the oasis it provides the resources

    @Test
    fun CityResourcesFromImprovementWithConditional() {
        // given
        val resource = game.createResource(UniqueType.CityResource.text)
        val resourceImprovement = game.createTileImprovement("Provides [2] [${resource.name}] <in [non-[Fresh water]] tiles>")

        // when
        game.getTile(1,1).setImprovement(resourceImprovement.name)

        // then
        val resourceAmountInCapital = city.getAvailableResourceAmount(resource.name)
        assert(resourceAmountInCapital == 2)
    }

from unciv.

SpacedOutChicken avatar SpacedOutChicken commented on July 20, 2024

I don't know what's going on, but I swear that it's not working on my end. I'm using 4.11.19-patch1 and it's still not doing for me what it's doing for you.

Can someone else test this, and see if the problem is just on my machine?

from unciv.

SpacedOutChicken avatar SpacedOutChicken commented on July 20, 2024

I tried it out on Android, currently running version 4.12.0, to see if the problem exists there as well, and it looks like it is. I converted Stuff to a city-level resource to see if that would change anything, and I built one improvement right next to an oasis with the other next to no Fresh water. The result: still getting two Stuff in the city. You can check my code here: https://github.com/SpacedOutChicken/Lodo-s-testbed
Screenshot_20240616_144228_Unciv
I don't intend to be an annoying asshole, but I've been able to consistently get the bug on my phone and my PC, so let me ask: are you sure it's working on your end? Is there anything about the test you ran that might not catch the behavior we're looking for?

from unciv.

yairm210 avatar yairm210 commented on July 20, 2024

I'll test this more hermetically
I have no doubt that there is a real problem, I'll see how I can replicate - I think I'll use your mod and game save

from unciv.

SpacedOutChicken avatar SpacedOutChicken commented on July 20, 2024

Here are a pair of saved games you can use. One with the Stuff Maker next to a river, the other with a Stuff Maker next to a lake.
StuffMakerRiver.json
StuffMakerLakes.json

from unciv.

SomeTroglodyte avatar SomeTroglodyte commented on July 20, 2024

I don't intend to be an annoying asshole

Thanks! When I read that in my mail, I laughed out - "they seldom do" came to mind immediately. Sorry, it's not you, just the word combinations... Sorry again, won't debug myself unless y'all ask nicely, because I get lost in all that stockpile code, it's unfamiliar and I quickly scratch my scalp into a bloody mess "how is all that supposed to work???" :where's that rips-hair-out-not-that-i-have-any-left emoji: - Yair is the better person for this. By far. With strawberries on top.

from unciv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.