Business Owners - Not Working in AI Mode - In to Address Bug?

  • It's no bug that business owners can't be controlled by AI anymore. This has been deactivated by those few lines because it was very buggy and let to some strange behaviour (the mainchar was collecting resources in other towns, for example).

  • :idea: If the problem is that owners are going outside the town to collect resources, then perhaps that problem could be fixed instead of just stopping them from producing anything?


    For instance, I have tried adding the following to the top of the Run procedure in ms_022_Gather.lua:


    The effect of this is that:


    • Owners will gather resources if Manual production is set
    • Owners will not gather resources if Automatic production is set
    • Owners can gather from the Guild House if asked to


    If owners are at their business and Automatic production is set, and they try to gather resources, they will not go anywhere or do anything and will still gain experience points while they wait for some production that they can do.


    This is just an example of the kind of solution you could consider. Perhaps it is not ideal but it works for me. :great:


    Note that this should also fix http://forum.runeforge-game-st…om/project.php?issueid=65.


    I tried checking the SettlementID of the resource to see if it was the same as the SettlementID of the work place but unfortunately all herbs seem to have a SettlementID of -1 (which I assume means Map).


    I also tried limiting the distance an owner can travel to gather resources by adding a max distance constant to GameConstants.dbt and adding the following to gather.lua:


    I prefer the first 'solution' as it doesn't depend on the map layout.


    Cheers


    Judy

    Einmal editiert, zuletzt von scrums () aus folgendem Grund: Clarification

  • scrums, i did your fix and my main characters still stop working.


    did this to ProduceGoods.lua :