Added the wagon
I did not add that area on purpose since it's darker than the original red. I'd like to find a way to still make it darker than the rest.
Yeah and implementation for that style could be helpful
Added the wagon
I did not add that area on purpose since it's darker than the original red. I'd like to find a way to still make it darker than the rest.
Yeah and implementation for that style could be helpful
I partly understand the need of sending LuaATC code to trains from LuaATC tracks. I recall some similar discussions, although not on this forum. The main thing to consider there is that you need to send the code as plaintext (instead of functions - so that the information can be saved across server restarts)56independent_actual wrote: ↑Tue Jan 10, 2023 18:37The idea is to say what LuaATC code to send from the aspect definition itself, with maybe a view values coming from drop-down fields.
This way, you can say, use something like atc_send_tsr(ARGV[1]). 1 is the value of the first dropdown field.
Perhaps you could try to add a custom step function to overlay that area with a semi-transparent black texture? I have not tried that myself though.
It's not necessary to do that work inside the on_step. Nor it is necessary to use special-purpose textures. Simply make it a part of the texture-string-forming code to add a texture overlay for the first layer, followed by another texture overlay with a multiply filter of semitransparent black.
Code: Select all
local livtex -- livery texture
livtex = "tfl_base.png"
livtex = livtex .. "^(tfl_layer2.png^[colorize:" .. bikepaintercolour .. ")"
livtex = livtex .. "^(tfl_layer3.png^[colorize:" .. bikepaintercolour .. "^[multiply:#00000088)"
That sounds closer to an XY problem. You want the train to respond in a certain way when it approaches or passes a specific signal, and LuaATC does not need to be involved in this process at all. Instead, IMO a better solution is to allow mods that provide such signals to define these callbacks. Then the main advantage is that servers (and players working on different LuaATC environments) do not have to implement these features independently.56independent_actual wrote: ↑Wed Jan 11, 2023 06:02LuaATC acts as the driver; executing logic based on info about their train. "Do i have x carriages? Maybe i use the top number.". This works well within the paradigm of advtrains. For example, we could also have a sign based off Weather, like "5 m/s whilst raining on this mountain climb", where the mod might use the weather mod API.
You are looking for advtrains.trains (plural). It's indexed by train IDs, which you can show with in-game infotext by configuring advtrains_show_ids in your minetest.conf. I'm not sure there is any central documentation on the mess of fields under each train ID, since it's kind of a free-for-all from various modules. I recommend you install the QA Block mod because it's really helpful for navigating the global Lua space and figuring things out.56independent_actual wrote: ↑Wed Jan 11, 2023 11:28I'm stuck with the train table. I've tried grepping for "train" (DO NOT RECCOMEND LMAO (it broke my terminal and forced me to re-install my Bash 32 bit emulator)), "train table", "train", "train keys", "train = {" and for "self:train", but i can't seem to find any explanation of the keys and what they're used for. Not even a definition of the table.
I've had a look at assets/doc/tex for some filenames which might help. None did. Even looking on the wiki for "train table" didn't work.
Where can i find documentation for the train table?
If the output of that command is too enormous to fit on your screen, use a pager like less to make it manageable. If it "broke your terminal" you probably included binary files in your grep (e.g. B3Ds which may contain "train" as text or bone names, PNGs that might contain it in metadata etc. and perhaps advtrains-internal binary formats).56independent_actual wrote: ↑Wed Jan 11, 2023 11:28I've tried grepping for "train" (DO NOT RECCOMEND LMAO (it broke my terminal and forced me to re-install my Bash 32 bit emulator))
I interpret it as "Reserved for potential future usage" - but never actually being used, given there's literally no other reference to it in the entire modpack. Whatever it was meant for likely ended up being unimportant.56independent_actual wrote: ↑Wed Jan 11, 2023 13:43What does "(reserved)" mean? Is it reserved for my usage? Someone else's?Code: Select all
-- path_node - (reserved) -- path_cn - Connid of the current node that points towards path[i+1]
A connection ID, which we'll get to explaining the next quote block..56independent_actual wrote: ↑Wed Jan 11, 2023 13:43What's a con nid? A con id? A conn id? A Conni D? A Co NNI D? What even is the id about and where do i find out what they mean?
connlku looks up which Connection IDs to use, and then train pathing looks along the appropriate connections. The mod also has to handle rotations, of which there are four for every track node: north, south, east and west we can call them even if that's kind of inaccurate. Advtrains uses a 30° track system (only actually approximately 30°, it's actually a system of axis-aligned, 2+1, 1+1, and 1+2 deltas in position), which adds up to a total of 16 rotations. These live at the top of helpers.lua in dir_trans_tbl. These are the 16 'connection IDs' mapped to the actual coordinates they connect to. There is a helper function, advtrains.dirToCoord to translate that into coordinates.56independent_actual wrote: ↑Wed Jan 11, 2023 13:43Having a basic search with grep reveals a list
But this only adds confustion. What's 1 for?Code: Select all
2 = straight rail; 3 = turnout, 4 = crossing, 5 = three-way turnout (5th entry is a stub)
The coordinates of a specified path element are exactly what the path table contains. Each increasing index of advtrains.trains[train_id].train.path is a set of coordinates for the next position that the train will occupy. So.. it seems like it's your brain that's in reverse and the lookup you want to do is forwards? Again I commend the QA block mod to you. Plonk a train down in a world, and inspect its path data through the QA block.56independent_actual wrote: ↑Wed Jan 11, 2023 13:43How do i find the co-ordinate of a specified path element (which would be the most helpful), a bit like path_lookup but in reverse (take index and turn it into a pos table)?
Nice mod for checking global variables.
As an addition, there is the git grep command that, among other things, feeds the result through a pager and also adds more coloring (the latter is especially helpful with -r and -n)Oh also, when grepping somewhere you might find binary files (even though I thought grep was supposed to just print "binary file"..), you might try adding --include=*.lua to your command line.
I'm all in favour of coding some tools to help you debug and test mods instead of doing stuff as though it's a black box, manually, and so on. I would also recommend Debug mod's /lua as it automatically shows the evaluation result instead of having to ask it to print stuff, and it has pretty printing. The dbg() mode is useful in some situations too (unfortunately it doesn't do stepping in the debugging though).
Nope, we should email the admin and ask...Blockhead wrote: ↑Thu Jan 12, 2023 00:08Has anyone seen this train?
I first spotted this "CS 810" train on train table server on 2023-01-06. It has a 3D-animated model, horn sampled from I think a DCC decoder pack but no attachment offset patch data. Is it a train table exclusive? I searched high and low but couldn't find it published on the interwebs.
Well, the actual angle is arctan(0.5), which is about 26.5 degrees. (By the way, make sure to configure your calculator to show the result in degrees - I have heard that some people messed this up in their exams)56independent_actual wrote: ↑Fri Jan 13, 2023 20:37I have a question about track rotations. You see, "30 degrees" is stated as the intervals between rotations, but according to my calculations this is wrong. We have knight's move tracks, which have half the angle from a straight line then the 45 degree (diagonal) track segments. So, this should be 22.5 degrees, and not 30 degrees.
There are, in fact, 16 directions (listed below counterclockwise from north, in degrees)However, this would result in 16 and not the 12 rotations we're used to. It seems 30 degrees is 360/12, but then you can't make a 45 degree angle with 30 without doing some form of weird angles.
The catheti for this situation are the differences in the x and z directions. Please do some research on trigonometric functions if you need further explanation.56independent_actual wrote: ↑Fri Jan 13, 2023 21:15Looking at the docs, arctan seems to be a wrapper for tan(x)^-1, but i don't see how this function call is relevant.
I only barely understand how tan relates to a right-angled triangle. It seems one of the function definitions is "opposite / adjacent", but i do not see how this is relevant to directions.
Why would we use arctan over, say, my 45/2 (which is a lot easier to understand)?
The step is not constant.Now that makes sense now i count what exists. However, 365/16 is 22.8, much closer to 22.5 then your 26.5.There are, in fact, 16 directions
The "logic for equal rotation amounts" is where things break down. Again, some research on trigonometric functions should give you an idea.56independent_actual wrote: ↑Fri Jan 13, 2023 21:4045/2 comes from the two cardinal tracks: 0 degrees and 90 degrees. The diagonal is half that, or 45 degrees. The knight's move from there is a further half using my system of logic for equal rotation amounts.You have not shown where 45/2 comes from. It is incorrect because you (apparently and incorrectly) assumed that the angle bisector also bisects the opposite cathetus, which is not the case. This can be seen from the fact that tan is not a linear function.
Explain what you mean by "equal degrees".So the tracks do not rotate to equal degrees?! Or am i just misreading because i'm bad at jargon outside my fields of specialisation?
I expect you to make translations only if your language skill is sufficient. Otherwise, I would suggest looking elsewhere to practice your language skills.56independent_actual wrote: ↑Sat Jan 14, 2023 11:40Ever since i started making Spanish translations of the newsletter, my Spanish has improved drastically. If a native speaker was to compare the first and latest versions, they would see a clear improvement. The Spanish newsletter has resulted in the improvement of my Spanish whilst helping South Americans, Spaniards, and other people who know mainly Spanish to get introduced to the project and access knowledge once locked inside the Anglosphere\.
Of course though, i live in Catalonia, which is a place which speaks Catalan. I come from Wales, a place with a dying local language, and the last thing i want is for a local language where i live to die. It's a win-win situation. Advtrains has one more language for the newsletter to gather in more users, and i get to improve my Catalan skills.
The first version will likely be mostly taken from a dictionary, but slowly, more and more words move to my head, to read the become easier newsletter will and easier and easier, until native speakers no longer have to re-arrange words in their head.
How do you all feel about a new Catalan translation of the newsletter? In any case, it probably won't hurt you too much if i decide to spend my effort on something which does not directly benefit you (you're probably used to that, being part of a FOSS project).
Users browsing this forum: No registered users and 32 guests