Page 1 of 1

Extend Wait Condition

Posted: Sat Jun 20, 2020 5:27 pm
by Pat4yczek
Hi there

I have problem

I want to make mod, which add a new wait condition "Next stop is enable"
What's gonna do?
Normally, when all stops are disable, train gonna skip this station and go to the next.
This wait condition gonna disable this feature.

Re: Extend Wait Condition

Posted: Sat Jun 20, 2020 9:31 pm
by Pat4yczek
Continuation for topic:

For now if I think right need to extend gui-train and gui-train-wait-condition-description

Code: Select all

data.extend({
    {
        type = "gui-train"
        name = "add-next-stop-enable-condition"
    }
    {
        type = "gui-train-wait-condition-description"
        name = "next-stop-enable"
    }
})
and I make code for local/en

Code: Select all

[gui-train]
add-next-stop-enable-condition=Next stop is enable

[gui-train-wait-codtition-description]
next-stop-enable=__1__ is __2__

Re: Extend Wait Condition

Posted: Sat Jun 20, 2020 10:26 pm
by Rseding91
I don't see this happening.

Re: Extend Wait Condition

Posted: Sun Jun 21, 2020 6:52 pm
by Pat4yczek
A very helpful motivation I see...
I see this code can't work, so for now I gonna make new class that's be inherrit from LuaTrain.
I'm not familliar with lua, but if I can make classes, so properties can make too.

Re: Extend Wait Condition

Posted: Sun Jun 21, 2020 10:05 pm
by Rseding91
I don't think you understand how modding in Factorio works. Have you done any tutorials yet?

There is no creation of new classes or extending base game classes. There is only using the mod API as it's provided and the classes the game provides.