New industries

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


  • I'm trying to create new industries but they aren't placed on the map while creating it. Is there any howto about how to bring them to the map generator? Also is there some mod to manually build a supply chain (as the industries aren't connected when placed by hand in a running game) ?

  • I looked at other mods but I'm new to TPF2 modding and these mods seem to be way to complicated; I don't want to examine 20 lua files doing dynamic modding while I want static modding. Do you have a wiki link? I looked at a lot of development oriented wikis but couldn't find any entry related to this topic.


    //EDIT: In case you wonder what I mean with "new to modding": I have 15+ years of development experience. Did a ton of mods for other games... I ported the TPF1 to TPF2 mod converter to linux... And then I tried to convert the "Soylent Green" mod. Now I'm adjusting meshes, materials & co since days and so far all looks good but this industry bug is one of the biggest blockers. Here my complete bug list

    - You have to place industries by hand and as a result there is no supply chain, leaving the buildings useless.

    - No horses.

    - Wrong ground textures at the industries.

    - Trees at industries grow into buildings (I had to replace most trees as they are no longer available in TPF2. For example orangetrees have been replaced by lemontrees).

    - No soylent logos on tucks/waggons.

    As you see 4 of the 5 bugs are just cosmetic but the first one is the showstopper...

    Einmal editiert, zuletzt von V10lator ()

  • https://www.transportfever2.co…odding:constructionbasics


    I meant the other game industries, they are located in res\construction\industry

    They have a ton of "genereated data" but the definition at the bottom should be similar


    I don't understand the problem with "supply chain". Should your industry be placed in the map generation?

    Eventually you need to define a new cargo type.

  • https://www.transportfever2.co…odding:constructionbasics


    I meant the other game industries, they are located in res\construction\industry

    They have a ton of "genereated data" but the definition at the bottom should be similar

    Thanks, I will have a look later


    I don't understand the problem with "supply chain". Should your industry be placed in the map generation?

    Eventually you need to define a new cargo type.

    New cargo type is already defined. The problem is: Industry B needs the new Cargo type produced by Industry A but Industry A doesn't even produce it as it thinks there's nobody wanting it. Anyway, while trying to make some screenshots I saw some bummer which might explain that bug. Will have a look soon.

    //EDIT: Okay, vanilla does industry buildings completely different. The reason for this might be that this is a TPF1 port. So this is what I do to define the stocks:

    Code
                constructionutil.makeStocks({
                    stocks = {
                        { cargoType = "MY_CARGO",     type = "SENDING", x = 32,    y = -46,     sizex = 1,    sizey = 4 },
                    },
                    stockRules = {
                        { input = { { 0 } }, output = { { 1 } }, capacity = 100 },
                    }
                }, result)    

    But the industry seems to want to receive these stocks, so it looks like type = "SENDING" gets ignored. Sadly I can't find any reference to constructionutil.makeStocks in vanilla codes. Before I start to rewrite the whole industries from scatch: Does anyone know how to utilize constructionutil.makeStocks correctly?

    //EDIT²: After examining the constructionutil.lua file this should work:

    Code
                constructionutil.makeStocks({
                    stocks = {
                        { cargoType = "MY_CARGO",     type = "SENDING", x = 32,    y = -46,     sizex = 1,    sizey = 4 },
                    },
                    rule = {
                        { input = { { } }, output = { MY_CARGO = 1 }, capacity = 100 },
                    }
                }, result)

    but it doesn't: It still wants to receive instead of send the cargo.


    //EDIT³: There was a table too much. After removing it the game finally reacts to the rules - with a crash

    Code
                constructionutil.makeStocks({
                    stocks = {
                        { cargoType = "MY_CARGO",     type = "SENDING", x = 32,    y = -46,     sizex = 1,    sizey = 4 },
                    },
                    rule = {
                        input = { { } },
                        output = { MY_CARGO = 1 },
                        capacity = 100
                    }    
                }, result)


    //EDIT: It finally works and I feel stupid... Industry A:

    Code
                result.rule = {
                    input = { { } },
                    output = { MY_CARGO = 1 },
                    capacity = 100
                }

    Industry B:

    Code
                constructionutil.makeStocks({
                    stocks = {
                        { cargoType = "MY_CARGO",         type = "RECEIVING", x = 26,    y = -48,     sizex = 2,    sizey = 2 },
                    },
                    rule = {
                        input = { { 2 } },
                        output = { FOOD = 1 },
                        capacity = 100
                    }
                }, result)

    6 Mal editiert, zuletzt von V10lator ()

  • I am experiencing problems with rules.;)

    I only need a single producing factory for "MY_CARGO". It will end up in a fish farm on the bottom of the sea and it should be connected to a harbour. This mod is working in TpF1, but now it's time to get it into TpF2. "FISH" is as cargo already defined, but to test the function at the moment I use "OIL"


    I have for a long time read Wiki and looked into different vanilla industries, ex. oil well. Interestingly, even though I use exactly like industry A above, TpF2 crashes with the following log.


    I have put some print inside my con file, so I can follow that it completely executes two times before the crash.

    The first run is done when clicking on the industry in the menu. After placing the industry on the map, it is visible for about 5 seconds before it crashes.


    The construction is working (though without any production) when a comment is placed before result.rule = { input = { { } }, output = { OIL = 1 }, capacity = 100 }


    I do not understand what is wrong. Below is the small con file.


BlueBrixx