How to get mod cargo types?

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 talking about if a player is using the Expanded Industry, the mod Freestyle industry would show expanded industry cargos. If the play is using just the mail mod FSI would also show just 16 vannila cargoes + mail as an option.

    You can include an addModifier function in the runFn of your mod:


    runFn = function(settings)

    addModifier( "loadCargoType", cargoHandler )

    end --runFn


    Also define the handler:


    local function cargoHandler(fileName, data)

    if string.find(fileName, 'res/config') ~= 1 then

    -- an addon has defined a cargo type, so do what needs doing

    end

    return data

    end

    Einmal editiert, zuletzt von doug () aus folgendem Grund: syntax corrected

  • I'm not a software engineer but this how I got into the game without a crash however it still just shows the vanilla cargoes I typed down (mod.lua) ( have 5 modifers to do)


    Question is does something like this require a script? or can it just be done in the .con files?

    ( it needs to work with and without common API because it has been on steam for a month now. )


    If this is not an easy fix I don't want waste peoples time going though a step by step instructions. I'll just update it as is.

  • Inline function definitions are allowed. I think you want:

    Edit: This is kind of OT for this thread. If this example doesn't work for you, start a new thread and we can look for solutions.

BlueBrixx