Consume Produce
#1


Hey all, I'm having some trouble with the consume produce UI.




For the buildings that produce something out of nothing, and have a range of food items, I have a drop down menu that lets you select which you want to produce (i.e. lobster or tuna). This works perfectly, and my codes look like this in the fishery.rsc template...



Quote:
Quote




ConsumeProduceDescription consumeproduce

{

    Product _products

    [

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialLobster.rsc";

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Lobster";

        }

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialShrimp.rsc";

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Shrimp";

        }

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialHerring.rsc";

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Herring";

        }

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialMackerel.rsc";

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Mackerel";

        }

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialTuna.rsc";

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Tuna";

        }

    ]




    StringTable _stringTable = "UI/MaritimesRawMaterialsStringTable.rsc";




    float _workTime = 6.0;

    ToolType _toolType = Hoe;

    int _workRequired = 6;

}




... and like this in the MaritimesRawMaterialsStringTable.rsc...



Quote:
Quote




        { String _requirements = "Herring";                String _text = "Herring"; }

        { String _requirements = "Lobster";                String _text = "Lobster"; }

        { String _requirements = "Mackerel";                String _text = "Mackerel"; }




       { String _requirements = "Shrimp";                String _text = "Shrimp"; }

        { String _requirements = "Tuna";                String _text = "Tuna"; }




However, if I change the String _requirements = "Tuna" to String _requirements = "TunaRequire" in both the template and the string table, no name shows up in the drop down menu and the game crashes. This isn't a problem for the above, because I don't need it. However when I move on to buildings that produce something out of something else, I get issues.




If I do the same as above, for example for a grist mill, in the template file...



Quote:
Quote




ConsumeProduceDescription consumeproduce

{

    Product _products

    [

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialFlour.rsc";

            ConsumeRawMaterial _consumeMaterials

            [

                {

                    ComponentDescription _material = "Template/RawMaterialBarley.rsc";

                    int _count = 20;

                }

            ]

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Barley";

        }

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialFlour.rsc";

            ConsumeRawMaterial _consumeMaterials

            [

                {

                    ComponentDescription _material = "Template/RawMaterialCorn.rsc";

                    int _count = 20;

                }

            ]

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Corn";

        }

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialFlour.rsc";

            ConsumeRawMaterial _consumeMaterials

            [

                {

                    ComponentDescription _material = "Template/RawMaterialOats.rsc";

                    int _count = 20;

                }

            ]

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Oats";

        }

        {

            ComponentDescription _produceMaterial = "Template/RawMaterialFlour.rsc";

            ConsumeRawMaterial _consumeMaterials

            [

                {

                    ComponentDescription _material = "Template/RawMaterialWheat.rsc";

                    int _count = 20;

                }

            ]

            ResourceLimit _resourceLimit = Food;

            String _requirements = "Wheat";

        }

    ]




    StringTable _stringTable = "UI/MaritimesRawMaterialsStringTable.rsc";




    float _workTime = 6.0;

    ToolType _toolType = Axe;

    int _workRequired = 18;

}




... and have this in the string table...



Quote:
Quote




        { String _requirements = "Barley";                String _text = "Barley"; }

        { String _requirements = "Corn";                String _text = "Corn"; }

        { String _requirements = "Oats";                String _text = "Oats"; }

        { String _requirements = "Wheat";                String _text = "Wheat"; }




... again it works fine, the mill will take in which ever crop you select it to. However, as soon as I try to change the string _text to "Flour [Oats]" for example, nothing shows up in the drop down menu. If I try to change the String _requirements to something like "FlourRequire" or "OatsRequire" or "FlourOats", again, no name shows up in the drop down and it crashes the game.




Now I also tried to add a drop down to the rope maker and dory maker to show what ingredients they need. For the rope maker, I have this...



Quote:
Quote




ConsumeProduceDescription consumeproduce

{

    Product _products

    [

        {

            ConsumeRawMaterial _consumeMaterials

            [

                {

                    ComponentDescription _material = "Template/RawMaterialflax.rsc";

                    int _count = 125;

                }

            ]

    

            ComponentDescription _produceMaterial = "Template/RawMaterialRope.rsc";

            ResourceLimit _resourceLimit = Coal;

            String _requirements = "Rope";

        }

    ]




    StringTable _stringTable = "UI/MaritimesRawMaterialsStringTable.rsc";

    int _workRequired = 10;

    float _workTime = 5.0;

    ToolType _toolType = Saw;

}




... and this...



Quote:
Quote






        { String _requirements = "Rope";                String _text = "Rope [Flax]"; }




... and for some reason, the drop down menu shows a nice picuture of rope, but no text saying "Rope [Flax]". Again, if I change the String _requirements to something else, nothing shows up or crashes. If I change the string _text, it tells me it will produce Rope, but not what the ingredient is. The Dory maker is the same, only in the String _text I have "Dory [Rope + Lumber]" and nothing shows up apart from a picture of a little dory.




I have compared my template and string table files to that in the mod kit for Blacksmiths and Tailors, and cannot for the life of me figure it out. The same is happening for the lumber cutter, it shows that the output will be lumber, but not what is used to make lumber. I also tried to add firewood, in the exact same way, but it would only show lumber in the drop down menu not firewood too.




 




What am I missing?


  Reply



Messages In This Thread
Consume Produce - by Necora - 13-01-2017, 01:54 PM
Consume Produce - by Necora - 13-01-2017, 01:58 PM
Consume Produce - by Kralyerg - 13-01-2017, 02:32 PM
Consume Produce - by ShockPuppet - 13-01-2017, 03:10 PM
Consume Produce - by Ketchup - 13-01-2017, 03:26 PM
Consume Produce - by Necora - 13-01-2017, 10:58 PM