Results 1 to 19 of 19

Thread: Resource "Conditions" Problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Resource "Conditions" Problem

    I have a mod of TATW 1.4, RR/RC. I've been playing with my own minor mod for a few months and it's been stable, etc.

    In the EDB, I have a few conditions that were working fine but I'm having problems with one: I wanted to keep a particular castle from ever upgrading to a fortress (cirith ungol). It also has a hidden resource by the same name (how convenient!). So in the EDB I added like so:

    Spoiler Alert, click show to read: 

    fortress castle requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, } and not hidden_resource cirith_ungol


    Am virtualy certain it was working fine. So started up a new game as Gondor and found out there were no longer a fortress in the building browser for Tarnost. Started a few new games, checking other factions-- NO fortresses in ANY building browser for ANY faction. If I comment out the "and not..." part it works fine. What's driving me nuts is I'm almost positive it was working before-- I have save games in the same config where I'd built fortresses.

    Is there anything else that could be causing this that I'm just overlooking??

    Any advice is greatly appreciated.
    Thanks!
    Last edited by RandomAttack; July 30, 2010 at 08:30 PM.
    "Perfect" is the enemy of "good enough".

  2. #2

    Default Re: Resource "Conditions" Problem

    Come on you master modders-- a little help please!

    I'm sure it's something so absurdly simple that I'll never figure it out...
    "Perfect" is the enemy of "good enough".

  3. #3

    Default Re: Resource "Conditions" Problem

    Shouldn't it be
    Spoiler Alert, click show to read: 

    fortress castle requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, } and not hidden_resource cirith_ungol 1

    I'm new to scripting mtw but that's what I'd try.

  4. #4

    Default Re: Resource "Conditions" Problem

    ^ Thanks, but I'm pretty sure the "1" is only for "events". There are a lot of other hidden_resource conditions working just fine-- just can't figure out what's wrong with this one. I double-checked the resource is there (and only there). And the fact that it is prohibiting all fortess upgrades everywhere is kinda freaking me out, man.
    "Perfect" is the enemy of "good enough".

  5. #5

    Default Re: Resource "Conditions" Problem

    Quote Originally Posted by Gharbad the Weak View Post
    Shouldn't it be
    Spoiler Alert, click show to read: 

    fortress castle requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, } and not hidden_resource cirith_ungol 1

    I'm new to scripting mtw but that's what I'd try.
    Hidden resource don't use "1" at the end.
    Also remember if u add a hidden resource in the EDB file u have to add them in the descr_regions.txt file also and then delete the map.rwm file for changes to take place.
    Only event_counter types in EDB can have "0" and "1" at their end.

  6. #6

    Default Re: Resource "Conditions" Problem

    ^
    Hidden resource in descr_regions.txt file? Check.
    Hidden resource in EDB? Check.
    Delete map.rwm? Check

    With line as in OP, nobody can build fortresses anywhere. Since the hidden resource is ONLY in one place, have no idea why it would do this. Without the line, everything works normally.
    Sigh.
    "Perfect" is the enemy of "good enough".

  7. #7

    Default Re: Resource "Conditions" Problem

    @RandomAttack
    It doesn't work that way.
    If u add a H.Resource in the EDB and as well in descr_regions.txt under a settlement then only that settlement can use it.
    Like for eg u add the resource in Toulouse and block the EDB entry for fortress by it then if France gets control of it they upgrade their castle in Toulouse only.

    Tell me exactly what is u trying to achieve here?

  8. #8

    Default Re: Resource "Conditions" Problem

    Ishan,
    I was trying to somehow prevent Mordor/England (or anyone, really) from upgrading a specific region from a Castle to a Fortress. So I noticed that region had a unique hidden_resource. So I added a "and NOT hidden_resource X" to the Fortress line in the EDB.

    To me it seemed, therefore, that only any region having that hidden_resource couldn't upgrade to a Fortress. Since there is only one region that has it, it would only impact that region. But when I use the "not" line in OP, it is being applied to all regions-- whether it has that resource or not.

    I've used the "and not hidden_resource" condition a lot in other areas and it's worked exactly as expected. Just not this instance. Of course, logic is not my strong suit.

    Thanks for the help.
    "Perfect" is the enemy of "good enough".

  9. #9

    Default Re: Resource "Conditions" Problem

    Quote Originally Posted by RandomAttack View Post
    Ishan,
    I was trying to somehow prevent Mordor/England (or anyone, really) from upgrading a specific region from a Castle to a Fortress. So I noticed that region had a unique hidden_resource. So I added a "and NOT hidden_resource X" to the Fortress line in the EDB.

    To me it seemed, therefore, that only any region having that hidden_resource couldn't upgrade to a Fortress. Since there is only one region that has it, it would only impact that region. But when I use the "not" line in OP, it is being applied to all regions-- whether it has that resource or not.

    I've used the "and not hidden_resource" condition a lot in other areas and it's worked exactly as expected. Just not this instance. Of course, logic is not my strong suit.

    Thanks for the help.
    U have to place a different entry in the EDB for the factions u want to stop the upgrade.
    Coz u see the entry is
    fortress castle requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }
    Now this will include all the factions
    If u want to make this for say north_european only then create a whole new entry for them something like this:-
    Code:
    fortress castle requires factions { gondor, mesoamerican, middle_eastern, eastern_european, greek,  southern_european, }
    
    fortress castle requires factions { northern_european, }

  10. #10
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Resource "Conditions" Problem

    Umm... I don't really know anything about regions, so forgive me if this sounds ignorant but:

    Why not make a region which contains every province where you want the capability to build a fortress?

    At least, it seems to me that this way you avoid the 'not'.

  11. #11

    Default Re: Resource "Conditions" Problem

    Taiji: Basically the term "region" and "province" are being used interchangeable here. I could add a hidden resource to every region but one, and then avoid the "not", but that is just a pain.

    Ishan: From another spot in EDB that works perfectly:
    Spoiler Alert, click show to read: 

    citadel castle requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, } and hidden_resource huge_city

    Only a few regions have that resource. It works exactly as expected. Like the OP, it applies to all factions.

    Back to the OP: An example is Gondor DOESN'T HAVE a region with the hidden_resource, so the "not hidden_resource" condition shouldn't prohibit it from building a fortress somewhere else--but it DOES.

    Again, we're back to why only the "not" part of the OP statement is messing everything up. Basically you are saying that any statement like that with "not" can only be applied to an entry with one specific faction/culture? Wow, I defer to your knowledge but it seems really strange it would work like this.
    Thanks!
    Last edited by RandomAttack; August 01, 2010 at 09:39 AM.
    "Perfect" is the enemy of "good enough".

  12. #12
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Resource "Conditions" Problem

    Quote Originally Posted by RandomAttack View Post
    I could add a hidden resource to every region but one, and then avoid the "not", but that is just a pain.
    Yep, that is what I meant. Adding hidden resources to provinces to make a region which excludes the province you do not want.

    I think 'region' is a sensible english term to use given the context, but I can see it's confusing potential given the game's specialised use of it
    Last edited by Taiji; August 01, 2010 at 10:48 AM.

  13. #13

    Default Re: Resource "Conditions" Problem

    @RandomAttack
    U want to stop the fortress upgrade for certain faction types but what is the condition that u want, so that they can be capable for that upgrade if that condition is fulfilled?
    We could work on something like this with the help of event counters.

  14. #14

    Default Re: Resource "Conditions" Problem

    Ishan: We seem to be over-complicating this:
    - I have one region that has a unique resource
    - I don't want anyone to ever be able to upgrade from a castle to a fortress in that region.
    - I added a "not hidden_resource" condition to the fortress level. So nobody can build a fortress in that specific region with it's unique(!) resource.
    - That "not" condition doesn't work as it does in all other instances. It stops ALL fortress construction EVERYWHERE. This should not be and I'm trying to determine why.
    Thanks for all your input guys. Bottom line is doesn't work (although it still bugs me that I can't determine why) and I'll figure another solution.
    "Perfect" is the enemy of "good enough".

  15. #15
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Resource "Conditions" Problem

    Please let us know if you do manage to find an alternative solution to the one I suggested
    Last edited by Taiji; August 01, 2010 at 11:27 AM.

  16. #16

    Default Re: Resource "Conditions" Problem

    Ok, so I decided to conduct an experiment using known-good settings.

    Currently in EDB, there is a condition for huge cities:
    "huge_stone_wall city requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, } and hidden_resource huge_city"

    I t works great-- only a few key cities have the resource and are eligible to upgrade to "huge walls". So I changed it to include the "not" statement:
    "huge_stone_wall city requires factions { gondor, northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, } and not hidden_resource huge_city"

    Just as I found in the OP, this prohibits ANY city, anywhere, from upgrading to "Huge". I would have expected the cities previously allowed (with the resource) to be stopped, while the other cities would now be allowed to go "Huge" (as they do not have the resource).

    So this is not an isolated incident just applying to my original issue. At least it wasn't "operator error"!

    Conclusion: You can't use the "not" argument for hidden_resource at the top level to control building availability. I have no idea why this is so, but it is consistent & reproduceable.
    "Perfect" is the enemy of "good enough".

  17. #17
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Resource "Conditions" Problem

    BTW with TA:TW I think it's easy to implement my suggestion because you have an AoR. In my mod it would be easy too, because almost every region is a horde_target.

    You just find and replace each AoR area's resource with 'orginal_resource, new_resource' (where 'orignal_resource' is the Area resource, and 'new_resource' is the one you want applying to all regions).

    Then you remove the resource from the region where fortresses are not desired, and make it a requirement for that tier of that core building in the EDB. Finally you remove the new resource from the place where you don't want fortresses, delete map.rwm and you're done.

    Doesn't seem so 'painful' to me
    Last edited by Taiji; August 01, 2010 at 04:19 PM.

  18. #18

    Default Re: Resource "Conditions" Problem

    Well, where the "pain" comes in is that the base for my mod is RC/RR-- and the number of hidden resources is already at the max, so I would have to find one to "replace". And the AoR in TATW is "mostly" controlled by culture level vice hidden resources. I wanted to use the resource I did as it just so happened to be only in the one region I was concerned with. As you said, I could do it by adding a new resource to each and every region EXCEPT the one I want to limit, but that offends my sense of efficiency.

    Now that I know the "not" argument just doesn't work in this specific application, and that I didn't just make a bone-headed mistake, I think it's not worth the trouble. If Mordor really wants to build a fortress there then, by the Valar, I'll bloody well tear it down!
    "Perfect" is the enemy of "good enough".

  19. #19
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: Resource "Conditions" Problem

    Oh I see, maxed resources. Presumably it's pretty much impossible to do it without breaking something else then.

    I think you could make it impossible for the player to build at that settlement, by monitoring it's selection and freezing construction via script. But I don't think it can be done with the AI, unfortunately, since it doesn't 'select' settlements as such.
    Last edited by Taiji; August 01, 2010 at 04:40 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •