Jump to content
kid1293

Modding, Sweet Modding

4 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Candy Store Stand-Alone (source)

large.CandyStoreSA_source.jpg.e5e208d0598cd4724957fe9c8be61de6.jpg

What on earth do I want with this?
I thought I should go through the mod to see if there is anything useful to learn.
This will be a lesson for new modders. I recommend that you download the file.

CandyStoreSA_source

It will contain several files to build a mod. You can find the same files in
the modkit examples, and get help by reading the help file README.html.
I assume you have the modkit working.

I uploaded this to have a common ground for asking questions.

There is a folder called Profession, and within it, a file Profession.rsc.
It declares a new profession I have used in the mod. 'Worker'
It uses an icon in UI/Sprite/ProfessionWorker.png - Don't change that file.
Modders have agreed to have it the same from mod to mod. If you change it,
you end up changing all declared Workers in the mods you are using.

You can see in the file Template/CandyStoreSA.rsc there is a 'workplace' entry.
It is actually called 'WorkPlaceDescription workplace' but the first word is to
describe the function for the compiler. You can address this section like this:
Template/CandyStoreSA:workplace. If you do, you address only that section, not
the whole template file. Useful for changing just one thing.
There you can change 'Worker' to ...a blacksmith. No, don't.

Remember - If you call the whole, you may force a change to a setting someone else
has changed. Not good. Here we have a new building. The whole must be compiled.

It is done in the file CandyStoreSA.rsc in the root folder.

It is pretty simple, ask if you hesitate.

I have also added some RawMaterials. They are the same between modders. Don't change.

There is a problem with this mod. It uses sugar or honey. Where do you get that?
If you don't have any sugar or honey production, you have to wait for the trader.
I will continue this idea later.

I recommend that you compile the mod, check it in the game, and then you can start
changing it. With some minor work, you can change input/output to be a producer
of sugar from apples. :) 

Enough - ask if you have any questions. I guess there are a thousand things to ask about.
 

  • Like 1

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Sugar House Stand-Alone (source)

    large.SugarHouseSA_source.jpg.7dfd635db353a746068183c531ceab60.jpg

     

    Hi again.
    Earlier I told that the Candy Store needed sugar. I will show a way
    to make sugar in a logical way. A greenhouse with an attached boiling room.
    Download the file. There is an extra file GlassMaterial.rar in the package.
    More on that later

    SugarHouseSA_source

    For sugar, I use the same files as I had in Candy Store.
    If I don't have them here, and I don't load Candy Store, the game will crash.

    The real reason for showing this is the Material files made by Bartender.
    He made it possible to create transparent materials without destroying
    the texture. They are used for the windows in the greenhouse.

    In Models/MaterialInstance/XGlass.rsc I define what material to use.
    like this

        Material _material = "Material\Glass\XGlassMaterial.rsc";

    The files needed for this to work are located in the folder Material.
    All files are needed. 
    A word of caution - rename the two files in the Glass folder if you
    use them in another mod. You have to change the name in the .rsc file too.

    I have added the original files from Bartender for reference.

    With the house part built into the greenhouse, I can skip the step of
    making sugar from sugar cane. With a larger production scale, you will
    need a separate building for that.

    Ask and I will do my best.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    This is fantastic! As a new modder this greatly helps disambiguate how information is organized - thank you!!

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Sugar Mill Stand-Alone (source)

    Sugar Mill SA (source)

    large.SugarMillSA_source.jpg.3dd5af33534f96de92a38168b3d03796.jpg

    So... You like sweets. Then you need a lot of sugar.
    You have to grow sugar cane in a field. You need a model (sugarcane.fbx).
    There is a CropSugarCane in that file. In that file, there are also
    three models of stacked sugarcanes that are placed in the storage yard.
    SugarCanePile0, SugarCanePile1, and SugarCanePile2.

    Setting up the resources is just like any other model. In this case
    I do not use any special material for the sugarcane.

    The file NaturalResourceSugarCane.rsc in the Template folder, tells
    the modkit about the settings for this crop. Some of those values can
    be changed, but strange things can happen if you change randomly.
    Let's keep the almost default settings.

    With a new crop - You MUST declare it in your resource list SugarMillSA.rsc
    in the mod folder.  The game will probably crash if you don't.

    Quote

     

    ExternalList resource
    {
        External _resources
        [
            "SugarMillSA"
            "Template/NaturalResourceSugarCane.rsc"
            "Template/RawMaterialSugarCane.rsc"        
            "Template/RawMaterialSugarRefined.rsc"        
        ]
    }

    Toolbar SugarMillSA
    {    
        Toolbar _parent = "Game\Toolbar.rsc:food";    
        int _sortPriority = 703;    

        Action _action = Tool;        
        ComponentDescription _tool = "Template/SugarMillSA.rsc";            

        bool _autoHotKey = true;  
    }

     

    The line "SugarMillSA" points to another entry in the file.
    Toolbar SugarMillSA.
    This declares the toolbar button, where it is placed, and what it does.

    Now you will have a sugar cane crop. The seeds come with the trader.

    So - What is this Sugar Mill?
    It is a place to produce sugar from sugar cane. You have seen production
    in my earlier examples. This has an input of 12 sugar canes.
    The output is 11-14 sugar.

    The Sugar Mill menu does not have a choice for the production.
    It is not needed with only a single product.

    I commented out the menu section in SugarMill.rsc in the Template folder.

    Quote

     

    //        {
    //            ObjectType _type = ConsumeProduceUI;
    //            ElementDescription _element = "Dialog/ConsumeProduce.rsc"; 
    //            String _insertAt = "userGroup0";
    //        }


    Theoretically, you can grow anything with the right models and a change
    to the code. Take a look at the crop example in the modkit example folder!

    If you have any questions, feel free to ask. Either here or in Questions.

    I have a compiled Sugar Mill SA in the Files section. Ready for the game.
     

    • Thanks 1

    Share this post


    Link to post
    Share on other sites

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections