Beiträge von Enzojz

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 have seen you put a bug stop in the station by a piece of model.


    In fact, you can directly put a station by edgeObject, you can look at this as reference (line 605)


    https://github.com/Enzojz/open…cripts/opencutstation.lua


    (There are to show the values of variables a possibility? In the game or in a log file? That helps program immensely.) ‎

    I am using this:


    http://lua-users.org/wiki/DataDumper


    It dumps variables in lua sythex..


    Edit by Merk: Merged double-post.

    Don't worry, they will be back. There will be option to choose if to have ramp for each part and there type (solid or bridge)


    The thing I will discard is the different radius for the same level.

    Build 13505 (July 27)

    • Fixed crash instead of error message in some cases when resources are missing
    • Fixed rare crash when building a bus stop
    • Fixed rare random crash while building
    • Fixed town building terrain alignment
    • Fixed terrain alignment issues when upgrading constructions
    • Fixed tunnel terrain alignment issues
    • Fixed Steam Lorry animation issues

    @Enzojz as you said it's fine when it simply works, however when they should change the API that way so the modder has to care about proper alignment, they will have to provide a way to align terrain directly by splines or to transform a spline to an alignment polygon, since they can't expect everyone to implement this conversion on his own or use some community code for this.

    Sorry, I don't quiet understand what you mean...you mean use a spline(or, edges) as a way to deform terrain?
    I think using edges as directives to deform terrain is the most probably way, for UG if they want to introduce this, they won't have much extra work to do since I think they have implement it in the core.

    @Enzojz thanks, but there should be a native version if we want to pass the spline to the updateFn and let the user himself handle the terrain alignment.
    Otherwise there will be many implementations of the same alignment and some users that don't know how to properly align the terrain.
    btw. I also implemented some spline to polygon approximation so I can use splines for terrain alignment.
    I should have looked at your code BEFORE implementing the whole spline stuff :D On the other hand it was just ported from some js code I had written some years ago to display some spline stuff in the browser, so it was not too much work.
    Btw. it is possible to calculate the exact length of a spline by (numerical) integration. However, in many cases an approximation is just fine and faster.

    No matter it is native or not, it's ok once it works. The native Lua lib given by UG is not so functionally and hard to use, so I did almost 100% of lib by myself. I started with port my lib written some years ago in C# too :D


    Enzojs: Your code is a bit hard to follow. My code is even worse to follow, so no problem If I am right you calculate the arc of a new track and the store this for later reusage.

    My lib fits 100% my style of coding : undocumented. Then I am deep influenced by OCaml (since at work I am using this language) so perhaps not easy to follow by who is not familiar with it.
    Yes I calculate the tracks by different arcs and duplicating them with different R then assembly them together, and this can be used for both edges and polys. For the vertical profile it's almost the same thing and linking the two aspects with distance from the start point of arc.


    My station script is dump compared to your approach, I do have a virtual coordinate system and bend it to the curve.

    It is also what I was thinking about in first place before UG release their curves station, since they release it before I did it, but I find this game supports only affinity transformation, I switched to analytic solution since I did wrote such a library some years ago in C#, copy paste is always quick.



    ‎‎I was wondering whether I should publish my API as shared mod, I like my it rather a mod without external dependencies are and not everyone would be probably with ideas and their execution happy. On the other hand to provide API and modifer not in any mod would be also a beautiful thing. ‎‎‎‎‎

    Have you tried it "complied" or "confiscate" it then release it so no other will not modify it, I remembered at least theirs one mod in TPF have code confiscated.

    ‎‎

    Indication of the aligmnents and the ground faces by a spline, interprätiert a line with a certain (to be) width. ‎
    ‎ Feature for roads and tracks, the new alignment is useful. Sometimes you want to dig a pit along a spline is no road or just to dig a pit for a road not a separate define road types. ‎
    ‎ As the new feauture anyway, dig a hole, which is equivalent to the course of the road and the area that the road nothing else is as a line is exactly as wide as the road and follows the course of the road, which is a spline, the internal törö likely can alignment already this. ‎
    ‎ In the faces, it could become more difficult.‎

    Aha, spline, you should look into my code, I have already done this! (in flying junction of march already, but the current wip version integrates more practical functions)


    I did this for flying junction and also my ultimate curved station


    https://github.com/Enzojz/flyi…cripts/junction_assoc.lua


    Line 239 and 273 also 139


    I use arc(circle with ranged radius) not spline, since in this game they are using spline to simulate arc, so calculate directly from arc is better, you can't calculate the length of a spline.



    the spline where the track / the road to follow. Based on this spline, you can use E.g. assets along the road or for the terrain use this alignment or the ground faces. ‎‎

    I have request UG this already, but I think it's not realistic since when the construction is snapped to road/track, you don't actually call the updateFn. UpdateFn is called only when the user change the parameters.

    I did it based on my previous work for flying junction, so no new track type created, I use no terrain alignment and calculate the terrain alignment by myself.


    However I know what are you asking about. In game with new track/road created, the terrain alignment is till -1 existing edges. In my case I have more 4 edges in an arc and this is formed by 2 arc, and two transition edges at each end to give snapping.