#General modding chat
1 messages Β· Page 11 of 1
Do you have the code so I can also try?
you hit the hard limit of PioNet sync. objects π
I will release the reworked mod in a few days depending on how much time i have
Damn I wanted 500,000 trees
@formal crane i dont remember if you have already answerd this but
Are you perhaps also looking at alternatives/improvements for the mesh importer?
proceeds to add a render pipeline thats based on PBR hidden behind advanced settings
Here is the link to my new offroading map https://steamcommunity.com/sharedfiles/filedetails/?id=3546613343
Same bro, same
I'm pretty sure I hurt Frans mentally with 20k though so maybe 500k isn't a great idea
gonna be looking into my multiplayer HP mods and make them look a bit better today, if anyone wants to help out with the technical block names of the dlcs after 1.9.5 id be glad
also, about the richtext part
if someone has extensive information about the glyphs, thatd be great
oh theyre thrown together
guess its worth making a small thread
oh thats not good
i cant overwrite mods anymore
its now making duplicates instead even though the mod folder did not change name
@formal crane we have issues with overwriting mods now, it seems ; trying to update my mods results only in duplicates
update through steam maybe?
steam duplicates them instead of overwriting them
i cant just update them manually through steam
why not?
i guess everytime a new version is due itll be a new mod
=> steam duplicates them instead of overwriting them
i have not changed my folders name since v 1.0 and im at 2.4 now and it breaks
when you do it through the Trailmakers upload menu or when you actually do it on the steam workshop page?
when i do it through the trailmakers mod menu AND when i do it through the workshop page
both seem to break now
oh
now all the new parts work as intended on the mod atleast, so thats good
Has it ever been any different?
But yeah it kind of sucks and I wish for a few changes to the whole overall experience
i mean it has been
i was able to overwrite mods before
its how i kept updating my multiplayer HP mod
from v1 to 2.3
now in 2.4 it broke
"PFB_StoneWall_Large" seems to no longer cast a shadow π
August 28th, our prayers will be answered
it will be pretty chill
Here is a blurred changelist for modding only
And we still working on it!
I might actually cry, it's so beautiful.
I will say that we have prioritised bug fixing like I have been rambling about in here for a while now.
So not a lot of new stuff.
That story is still not done and will continue for a while until we smashed all the major broken things.
I don't even care about new stuff. The fact that we aren't left to rot is what's beautiful to me.
yea im completely fine with getting bug fixes over new content cuz they can be much more annoying
bug fixes is all i want for now
That makes me happy to hear!
This shits hits harder with voice message π
Glad to hear! Lets gooo
antimatter and his voice messages - never change
Guh?
I think you are one of the only people on discord that use that feature, nothing wrong with that though
Little did you know I'm the one that paid discord to add that feature
It's so nice that I can properly express tone using VM's. I'm terrible at doing it over text LOL
ooo frans on stream tomorrow
peak
COMPUTER - UNPIXEL
I actually blurred it at first but realised that de-blurring algorithms are quite good nowadays lol
COMPUTER - HALLUCINATE THE TEXT
i know there isnβt a ton of new content so will the stream also be including some larger bug fixes?
I am cooking up a demo yes. But wont include 80% of the fixes.
im guessing youβre just going to show off the full changelog here at some point
That will be included in the patch notes when we get there yes π
@median cobalt hey i think you should attach the "Tutorial" tag to your post: https://discord.com/channels/296562030624899072/1409212922902741024
im letting you know here so i dont pollute your post
I pray for server owned structures 
oh right, sorry
done
btw frans do you have any way to look into if perhaps the workshop api changed
cuz its still trying to duplicate items
i cant manually reupload code into a workshop item either
unless id actually tap into the pure API itself which i dont feel like is aligned with the whole TOS
To my knowledge there has been no change on our side. Could be that Steam did something. But I dont have the resources to dig deeper into it at the moment!
But I wanna give it some attention later π
would be worth asking steam directly but i wont get nowhere , not being a dev nor on a high priority anyways
Is anyone else having the issue? If itβs unique to you itβs probably not related to a change with the APIβ¦
Wish it was coded in some way instead. Having the modding community scramble to decode said message would be super funny to see (and i definitely would try). By coded i mean like a ceasar cipher, or straight up what sub rosa had where each character is represented by a different one or sth
Love a good ARG! Just have nowhere near that time to make something like that :p
i do not, although maybe theres more to it than just updating a mod
Not had the issue
heatmaps properly implemented
if it was unique to me how would that even work
this is an issue that is happening at the level of the api, in either way
the mod directory didnt change, i have not changed where the game is located, i have been updating it since v1.0 and only now do i get this issue
before i was able to overwrite the mod with a new name and new description every version change
now it duplicates EVERY mod including those without name changes OR description changes
making overwriting mods essentially useless
If nobody else can repro it, it's either you or your pc. The API/game is fine
Could you maybe explain each step you take?
Wrote this so I can come back to it later
Or I guess I oculd have just followed it but yeah
I might make a custom map
Upload mod
enters same directory i always do
gives it title
gives it description
upload
wait
check steam
see duplicate instead of overwrite
hæh.mp4
only thing i change is the end of the title and a new description when its a new version, but that hasnt ever made a duplicate up until now
That's indeed user error
its always mods/multiplayerHP as a directory
has never been different
and that seemed to work for like... ages
That never worked
ποΈ
I understand you have done it differently before; but from the looks of it, then other people have not used this approach.
#1140936220487192587 message
I have been going through similar confusion some time ago.
With that said; I think there is a lot of confusion in this and it could be improved.
But for now. I see no direct issue.
Stunning. Is this using the heightmap?
yeah
What sort of heightmap data are you using? I wouldn't expect image since you cant really read the pixel data.
Is there like a "dump" of all features and things you can do right now? it would be handy and probably the only help I would need
The correct way to update a mod is to open it in the in game workshop->edit->type the folder and upload it
i made a little python script that exports a images black and white data to a json file
Look up my API docs
i first wanted to read the binary data of the image using the lua mod but i was advised against that lol
(probaply for the better)
Trailmakers wiki
https://trailmakers.wiki.gg/wiki/Modding
https://trailmakers.wiki.gg/wiki/Basic_Modding_Guide
Otherwise you can also check out TerrorSouls modding portal
https://mods.trailmakers.ludixi.com/docs
And also ALVAROPING API definition which has some additional comments on each function which can be used with the Language Server.
https://github.com/ALVAROPING1/Trailmakers-API-LuaLS
The language server?
Oh okay yeah I saw the frans edit
-# Though I don't even have an lsp because I just use notepad like an idiot lol
You don't have an ISP? How do you access the internet?
-# do you mean an IDE?
No, lsp
Basically all I have is autocomplete from previous code i've written and syntax highlighting
And sometimes a bit more, but not much
So I can't install the TM modding autocomplete because you can't do that with notepad I think
Oh.
The L on discord really looks like an I at a glance
Yeah...
But also yeah I don't have an ide techincally
I'm 90% sure I can't even install the autocomplete either. I use Pulsar as my IDE
i did NOT see "pens" at first glance
The image I was sent did not say pens
Quick preview of my new multi object placement tool for Track Creator Plus called the "StringAlong" Tool:
It allows you to create a line that follows your path and then choose an object to repeatedly spawn along that path. You can then edit many parameters including rotation, position and scale along with the ability to randomize those parameters separately.
This is not in the same class as Blockmantahampta's tool but is still useful within the mod.
Quick preview of my new "StringAlong" tool for Track Creator Plus. This tool is a multi object placement tool. It allows you to create a line that follows your path and then choose an object to repeatedly spawn along that path. You can then edit many parameters including rotation, position and scale along with the ability to randomize those para...
This is just thinking but is it possible to get material info from a raycast?
Or the very least what object it is
No. Only the position, normal and distance
Oh okay, I know noiro got vehicle block positions but I have no idea how
There are specific apis for that
I saw nothing in TerrorSouls stuff but maybe it's named something different
ModBlock.GetPosition iirc
Oh okay, I guess I just assumed modblock was like something specific to modding and not just all the blocks
It's the proxy class for a block
how fast is the raycast function by the way
not as fast as it could be
also which one
basic lineintersect raycast
wont need much more complicated stuff i think
well, i would need to find a way to properly position all the pixels
the tracespeed to beat would be 400 full* traces / s
-# or about 2500 traces/s
sounds expensive
well, im planning to redo a render engine ive made using lua before
we use normal non-jobified raycasts, but i dont have any exact numbers.
And from very quick looks of it it hits most things, so properly pretty expensive.
Especially taking Lua binding into account
nonjobified is fine
my raytracer also was nonjobified
im planning to recreate this pipeline btw:
mipmapping, AO, rough phong shading, no speculars, and texture mapping based on cube projections
this render took 40 minutes to output and has a res of 512x512 at 128 samples (at 4AO samples per sample)
so thats a time to beat in the long term
ofc since trailmakers might not be limited by operations a second it might be faster
but then again id need to manually set the color of each pixel probably meaning id need to re-spawn assets at a high rate
question is, what will crash first, the renderer or the unity engine
given this raycast wont have material info alot of my code might just not even be used
something else im wondering, by the way
unity uses directx here as a native render pipeline right
or are we using openGL
insanity is part of my routine
noone believed id be able to make a raytracer on an inferior cpu bound single core network-bottlenecked pipeline
(you had to network each pixel manually onto the screen from the server to clients because that display is a leftover from 2006 implementations)
ofc if theres more flexibility with trailmakers unity raycasts this might be even faster
because if theres a way i can use sphere raycasts for AO it would probably speed the render time up by 8x
whats the max spawnables limit btw
cuz with a 512x512 screen ill be spawning a whole 262144 planes (twice if i cant directly write color after being spawned)
65536, but that is total in the session (so structures, npcs, players etc.)
maaan thats so tiny
65536 network synchronised objects is no joke π
can i atleast manipulate UV on custom objects
so i can just have a chunked object that i can map a LUT table to so i can still set the color per quad
i paid for my whole internet im using my whole internet
Tell that to the lowest denominator
throws bandwidth at the guy from australia connecting
iirc you can only update ~1k objects/frame, after that operations start being spread over multiple frames
Compute shaders when?
I guess there would be tons of issues with implementing shaders though, even if they could be fun
Game uses d3d11 yeah
Assuming you could set up the same state over and over again couldn't you launch more instances of the game?
I mean yeah slow*6 is still slow but
i could only set up 6 extra instances before id get thread overlap
and trailmakers really glitches out having 6 individual same players on one map
2 was already very weird
Have the current list of fixes π
It is not done yet, but growing strongly π¦Ύ
Subtle Messages and GUI elements will now throw a mod error if the message is too long instead of Oh Noβing.
Subtle messages will now throw error if duration is outside range instead of Oh Noβing.
Spawning PFB_Explosion and variants will no longer Oh No after player late-joining.
Fixed collision on the top of oibjects marked as SetIsTrigger to true.
PFB_Barrel did not always despawn.
Fix exceptions being thrown when trying to remove a UI element that doesnβt exist.
Failed mod loading now shows Error icon for subtle message.
Fixed rare case where failed to load mod exceptions message would be null when throw to user.
Fixed wheel deformation on custom meshes with concave colliders.
Mouse clicks on custom mesh with concave colliders will now be registered correctly.
Soundsbanks from Wwise will now be loaded dynamically, adding 226 new sounds from space sector and pioneers.
Fixed SetPrimary/SecondaryColor being unreliable. Can now be used outside of builder.
Fixed rare case where failed to load mod exceptions message returns null.
Sticky orbit- and Builder camera will no longer override mod camera
Audio Play and Stop should now be more reliable.
Player camera now collide with Custom Meshes
SetTimeOfDay is now clamped between to 0-100.
also Frans you better make that beginner modding guide
I would love to but I am unsure how to make it good! I am talking with another programmer about doing it π
server owned structures? o.o
pls
And it is also so different from whatever we do.. It has to be a little bit unsexy.
No π
π
But have this WIP leak that I know you personally want π
It is not done yet, and we are prioritising other stuff at the moment.
message so this shows up in me chat
ooo
rally map gogogo
magnetic custom objects?
wait custom model surfaces π
this is a little dumb but i think ALL custom mesh are magnetic right now lol
lmao
anyway sorry for not being able to answer questions; just had to keep up the vibe and I was also nervous.
But like hit me with questions here if needed π
Frans #1385250615340306523 message
have these blueprint related bugs been looked into?
Not yet, but are quite cursed atm.
Structures are generally very complicated and always requires talking with a few people.
ah ok, i think most of them occur because the player is also the owner of the mod spawned structures
any updates on the progress of block health functions?
would be awesome if we could just spawn blueprints like that without a owner, but from the sound of it thats probaply way more complex than i imagine
The ability to disable backspace would be wonderful π
actually that would be pretty useful
is there a thread for it yet in suggestions?
Since the beginning of time
Sounds nifty.. @dim wolf ??? π
Working on it β’
Think its the only disable function that is missing in terms of gameplay
What kind of ideas do you have with that, @warm canopy? π
Well it could be used as a potential solution for blockhampters structure issue in terms of we could have structures spawned, if backspace cant be pressed then the structure cant be messed with. Sometimes I like to handle the whole respawn/teleport login myself, in the aerobatic aces mod in the start menu screen, if someone presses backspace it becomes a whole issue as it deletes the structure in the custom menu I made.
Also fireworks in the end screen of the aerobatic aces, but if the host presses backspace then no more fireworks
Pro move would be to highjack the button completely, @formal crane. That way modders could just say "nah this does new things now"
Maybe it should be a general thing, so that modders potentially could override all button actions in the game. "Only turn left race, right makes you blow up" or minigames where you can only jump... or whatever
But then... controllers? If you can only override keys but not controller buttons then it's a bit problematic
We can't handle controller keybinds currently anyway, think thats a separate issue
Indeed - wish we could π
But doing stuff with backspace is pointless if it can be overridden on a controller
We need access to the actual events
disabling respawn rather than overriding the keybind would fix your issue in controller as well though
Do you have plans for a wind setting that is more localised. So at a specific radius around a vector3 etc. It could be used for turbulence and winds in specific areas
Yeah but I'm talking about the actions, not the buttons. So "jump" or "respawn"
That way you intercept the intent instead of saying "this button does this"
And works with rebinds
Sounds good to me
a way to tell if someone respawned or backspaced would be good too, right now we check if the player pressed "r" or "backspace" to know.
Yeah, itd also solve that detection of repairing (on controllers)
that's exactly what they are saying, you could run custom code on a callback from that action
Yeah that would be the quick solution, something specific to respawning. I just love general stuff.
also, instead of full replace, it might be better to have a normal callback with an object to control the default functionality (like js does it). That way you can also add functionality without breaking the normal flow, or have multiple callbacks for the same event (which makes sharing libraries easier, as they can register their own callbacks without the library users having know of its existence and adding it manually)
Yep that's what I was getting at and was hoping that you meant it that way π
My thought would be:
You make a specific input subscription. You get the current input state on mod tick and you can choose to "consume" specific actions so they don't pass to the game. If you don't consume them, they will pass undisturbed.
This way you can also just listen without consuming.
yeah, that's basically how js does it. You get an event object in the callback and you can call e.preventDefault() to consume it
wait
"Soundsbanks from Wwise will now be loaded dynamically, adding 226 new sounds from space sector and pioneers."
did you guys have sound bank limits before?
that sounds odd
They had to manually add them as available sounds for modding
ewwwwww ok thats alot better then
having to manually add them sounds like more work than needed
couldnt they just compile a soundlist
i mean yeah the .wem files are named randomly
but that is only when writing the files if i know wwise correctly
which i will most definetly check should a micropatch happen again
well
now that i know the modding API works as intended ill be able to finally finish the mod that had issues
meaning i can finally add a method to quickly re-paint blocks with certain colors into other colors
just have to wait

It was just hardcoded which banks were available to modders.
oh i see
Ngl this seems familiar to other structure spawn problems
(like non-modding ones, at least the teleport thing)
In the meanwhile you can adapt my wind utility that uses the wind box prefabs for localised multiplayer compatible wind before flashbulb inevitable make a local wind function.
This one slipped past me.
Not yet! But totally want to. The global one was just pretty straight forward and not so risky.
Wind but you can define a Normal based on a function
would be nice
well, theres one way one can do that already but itd involve direct forces and none of the actual aero
I mean, you cooould use getDrag... But that's not exactly easy
Especially since you always get the full drag, even if faces are hidden, so drag would be totally off
Can't wait for custom model surfaces. That's going to be a serious gamechanger for mod maps
New Map, Just in time for Tank Treads!!!!!! https://steamcommunity.com/sharedfiles/filedetails/?id=3563372295
I thought we didn't have a GetDrag function? Would love it if we did. I've only seen SetDrag.
there is only setdrag, you would have to make an approximate lookup table for each block name atm
Looking back at the docs that's right, I misremembered
Yeah it doesn't make a lot of sense to not have it
Also, what unit is setdrag in?
No trailer or basic demo video? π
Yes :p
Fine, I will put together a video
I do a little off roading in Trail Makers, On a map I made, in my 4 link HumVee
New custom Map on mods workshop
https://steamcommunity.com/sharedfiles/filedetails/?id=3559549149
A rock crawling map with extreme wall climbs.
The terrain is a formidable tapestry of jagged rocks and towering cliffs, a challenge that calls forth the most daring of...
π
Ah yes the classic
Is mesh instancing a thing? and if it is does it save on performance and memory usage?
(my SPAWNS_PER_UPDATE is currently set to 100 so it shouldnt even affect these examples in any way)
Is it just me or the other message is gone?
for me both are still there
Well, someone stole mine
Found the culprit
Anyhow, you said half and index==nil, by any chance are you doing table.remove inside a pairs?
i am
That's your issue
alright
So instead of ipairs just use a normal for starting from the highest index and going down
How would I adjust a hinge block to bend in 2 directions and swivel? I need a rod end so I can stop having to use 5 hinges in every linkage, instead of 2
you cant modify blocks like that
dyno doesn't like indented code blocks
How do I talk the devs into making a Rod End / Universal Joint block? It would make off road suspensions be much simpler, For each 4 link suspension, I need 28 hinges, and I have 2 4 links on a rock crawler
The one I'm thinking is only free moving
Really?
really
Damn
It literally is
Not in all directions though it has resistance
That, and they are kind of big to put 20 of them in a build
Holy crap, they are, but becuse of where they pivit, they get stuck in weird places when you use them, I thought they had restricted movement.
mostly I think they are just broken
they move up/down/left/right with little resistance, they just don't have roll
oddly, they do have roll, but you can't put preasure on them because it's hard to center the force.
I figured out how to steady them, so they are usable, they just have some weird behaviors
so i made a 3d model in blender but in trailmakers it's mirrored, does anyone know why?
i used tm.physics.SpawnCustomObjectConcave to spawn it
Is that what I think it is?! 
no clue
i just have to make the x scale negative everytime
thanks, it worked
just noticed this but in pioneers, this mod breaks, showing transform slots as individual structures
i cant filter these
thats gonna make alot of spam
they also are precisely the transform slot theyre in, ordered accordingly
so slot 4 is place 1, and slot 1 is place 4
for some... reason
is this a bandaid patch from when transform slots caused some crashes
oh also can i check if a subtle message is no longer on screen somehow
if no, maybe thats something to add for 2.2
i actually have no idea if subtle messages have a handler that just returns the element, do subtle messages leave behind a unique indentifier where i can check if theyre still active or something
They do return an id, but i dont think you can check wether or not the message still is shown
I don't know of a way to check if they are still active. Would love to have that ability for sure.
Yeah, as far as I can tell, when a subtle message is removed from the screen (for whatever reason) it can't be directly called back - even if you gave it your own ID.
Unity gives the message a GUID and that remains associated with your own ID unless you re-issue a new message using that same ID. In that case Unity then gives it a new GUID.
So unfortunately the onscreen state of a subtle message can't be detected via it's GUID it seems. Maybe there is something else that can be checked?
||Or we get more subtle message options in 2.2! :)||
=====> #1123915629653667943 π (otherwise it will be forgotten through time..)
As a solution you can add duration to the subtle messages and then create a tracking table with timestamps for when you created them so you know when they should close down.
Check export settings
Yeah try and goof around with these in the Export OBJ settings
(If someone has time to figure out the correct settings please smash some words into https://trailmakers.wiki.gg/wiki/Modding:Custom_Assets)
Supports OBJ meshes and PNG and JPG textures
Automatic LOD generation (3 levels) of meshes
Client-side Caching
The game has a dictionary with all mods and their resources. As you add assets, they get added to this list. Meshes and textures shares the same list, meaning that you cannot use the same key...
The correct settings are
no
crazy
i guess this is the only solution
Is this
or should I add something or remove something
I don't think anyone here is going to use Maya but I wanted to add more examples than just blender, even if it might be the most common program used here
what if theyre meant to stay up but trailmakers suddenly just removes messages after 30min
Well thats your timer then?
subtle messeges were never intended to be shown more than 5 seconds or whatever. I think there is some float packers that might compress the values in a way that is unexpected, but cant remember right now
But sure i support the idea of guids handling. But please discuss this further in a #1123915629653667943 thread
already done
I don't think it's related to duration timing. I have some messages set to 999999 duration (HUD elements when racing) and some set to 8 or so. They all work fine most of the time. However every now and then the game just randomly removes one or more of them.
It can be at the very moment they slide onto the screen or after several minutes or anything in between. I can't spot a pattern. The game seems to have some process that somehow hooks into a mod's subtle messages - and eats them!
Might be we have some system that clears them in specific situations that I am unawre of.
The mod subtle messages shares the same ones as the built-in ones.
Strangely it doesn't always clear all of them. I can have 2 going - both set to 999999 - and one of them will get cleared but not the other! But sometimes it does both. Very weird.
Yeah, it is a tad unpredictable at times
Maybe we should investigate duration=-1 and then these can be specially handled.
Any chance of getting some npc enemies as prefabs in the future?
Would love to someday!
Is there a way to load a binary file or does it have to be plaintext
You can only read text
Moonsharp lua has no way to store binary data. Normal lua uses byte arrays for strings, but moonsharp uses utf-8 encoded strings and not all byte sequences are valid utf-8
Aw okay
I guess I could make a preprocessor that takes binary and just dumps it as base64 or something
I'm assuming there's still a way to store binary data
Also it's lua 5.2? that's at least the link on the wiki
Yes, 5.2
I'm reading the manual but it isn't exactly friendly lol
I do know the index 1 thing at least
your only way is to store it a table of 64 bit doubles were each value is manually restricted to be an integer from 0 to 255
Yeah but that's fine by me, unless it does become a performance problem for some reason
Though since it's interpreted (right?) I don't have high hopes
that's just a fairly standard grammar representation (in extended Backus-Naur normal form). It just means that a table constructor has the form of an optional fieldlist surrounded by {}, where a fieldlist is a list of fields separated by either , or ; (allowing a trailing separator). Each field is then either an expression between [] followed by an = and another expression, a name followed by = expression, or an expression
Oh I see now, I thought it was different tables for some reason so I got really confused, never seen this notation
tl;dr: these are all valid table constructors
{}
{ 1, 2, 3, }
{ ident = 1 }
{ var = 2, foo = 3}
{ [1 + var] = 3, foo = 2, 5, bar = "bar" }
guh
#1368999049188872204 message
Awesome, time to rewrite an entire mod
I'm gonna try using vscode for once but I can't for the life of me install autocomplete so I'll have to make do without but I think I can make it work
usually you just need to install the lua extension for basic autocomplete (and my docs for specific tm api autocomplete)
I have syntax highlighting at least
Also if there is no console where do log messages end up
Oh nvm it's just not working
in a log file in the mods directory, called either <name>.log for local mods or <name><id>.log for workshop mods
Weird that the selection would be considered a nil value, I guess I screwed something else up that's causing it to report completely different lines of code
Oh it was variable naming that was causing that, I guess it doesn't have a way to easily convey that
Nevermind I accidentally used zero and it didn't error so I got confused π
there is bit32, but only works on integers
yeah I found that
Interesting, loops don't break when you disable the mod
Huh
Oh
It doesn't error and it doesn't continue the loop, weird
What happens if you do happen to have strings with arbitrary data by accident?
Apparently appending stuff to really large tables is slow
Oh wow insert is slow
This is just indexing directly, 200ms vs 2 minutes
I guess it doesn't cache the length so it had to calculate it over and over again
Tables are hashmaps under the hood, counting the amount of elements is slow, and if you have a lot of elements adding another might require reallocating and copying the data
Equivalent to the native 'dofile' function in Lua.
Is it?
Okay I got something working for now at least
It literally just invokes it. There is a bunch of security checks but thats about it
yes. It just runs the file and returns whatever the file returns
There's no way to like store a continuous blob of memory right? so if I want to get arbitrary length data, I'm gonna have to loop over with a bit index
As in
{0b00011100, 0b01110001, 0b11000111}
into 3-bit ints
(endian is wrong but that's just an example)
I have a feeling that doing this hundreds of thousands of times is slow
in default lua yes, but not in moonsharp
that doesn't make any sense
I guess I could just increment the current bit and if it's larger than 8 just subtract and add to the byte instead
Like this (I know I said 8 but just assume my brain is a table
)
that still doesn't make sense
as in when accessing that table by
bit32.band(data[byte], 2^bit)
tables are indexed with integers. If you are trying to split a blob of memory into table elements, you just need to do table[byte_idx]
what are you trying to make?
Yes? I'm just treating the indexes as the bytes, I guess I could put 32 bit values too but I'll do that later if it's way too slow
Oh I see what you mean, I never got nil for some reason
zlib
Or at least part of it
I switched to the latter one so I won't be using division anymore
It just happened to be divisible by 8
table[#table] will always be nil in lua, #table returns the first nil integer index
I'm not sure how that's related
if you are iterating through the table, you will always reach a nil index
All the good features seem to be in lua 5.3 π
Okay no maybe not all of them but still
can someone help me with my first mod
Sure. What sort of help do you need?
elaborate
I wish there was a way to sanity check my work though
It's weird because I've manually parsed the file and the first two symbols are 12 and 25
The uncompressed data is literally just 00s so I would expect some literals
12 is perfectly normal but I have no idea why 25 is there
Unless it's like flipped incrementing
does anyone know if reshade works on trailmakers?
That's dll modding
it does
thank you
sorry for the late response but i can go now
You can look at the wiki for information about modding https://trailmakers.wiki.gg/wiki/Modding
DLL modding goes against the Trailmakers Terms of Service. Promoting it on the official Discord server will result in a temporary ban at first which will become a permanent ban for serial offenders.
Trailmakers supports modding through Lua scripting language. There is a full modding API that can access...
ye saw it later thx
Will we be ever able to specify our own LODs, I really like details so I'm not sure if I will like the result that the auto generated levels will be
It makes sense but not something we would prioritise at the moment.
at the
Okay no but got it, hopefully we will at least get transparency soon
I'm assuming since this game is forward rendered we could have semi-transparent objects?
At least that's how I think it would work
But also they would have a different draw order? transparency isn't too simple
I am butchering terminologies here, but the current internal proposal is to have shader variants where one does cheap alpha testing/cutout and one has alpbha blending.
But not promise here, it was just our "best" case proposal and not something I think will land any time soon.
(if you have an opaque object behind a half transparent object you need to render the object behind first so you can write the transparency, but normally you'd do the reverse for speed)
Okay yeah I see
the cutout would just be a fragment shader discard? I think, not sure how unity does it
I'm mostly thinking about aliasing, not sure how "obvious" it is, I guess higher resolution would fix it but at the same time that also comes at a cost of course
Not much you can do about that other than resolution π
But I mean works in the right context, eg. foliage, in-world UI, etc.
4k leaf texture 
this is why modding will never come to consoles
lmaoooo
-# I think I do actually have something close to it, a 4k "abstract" feather texture I think
I could make hyperrealstic melvin 
the furry community is not ready
The funny thing is, if I were to make realistic Melvin, I would basically use all the stuff I normally use for my furry art, since I specifically made some geometry nodes for placing haircards/feathers on a body
I need to rethink this 
it's horrible
I also need an actual decoding tree, the current one I use is for an encoder, not sure why I chose that
probably stupid qeustion but how do i get the player id in multi player
Basically this: #1140936220487192587 message
I'm assuming it's faster to do multiple passes over a table to prevent a ton of function calls
Like do one pass for converting the bitstream into codes, then another for the back references
I'm thinking if I need to do error checking, not sure
I guess it would be useful for stuff that is unpredictable
A lot more nested than i'd like but it's better
Still need to add full ll and dist logic
What in the world, not sure how the lookback length is 23 just a few bytes in and it's so painful to manually decompress the file
Ooooh this is 25, so it can just reference it's own data apparently, interesting
Yeah
Mostly just me here, but you know what, I don't mind :3
Also yeah it's working
π
Now I just need to do the decompression
And then we're halfway there 
I still have no idea how to grow the dynamic trees but I will think about that when I get there
What are u working one
https://datatracker.ietf.org/doc/html/rfc1951
Currently it's deflate compression
This specification defines a lossless compressed data format that compresses data using a combination of the LZ77 algorithm and Huffman coding, with efficiency comparable to the best currently available general-purpose compression methods. This memo provides information for the Internet community. This memo does not specify an Internet standard ...
Got no idea what that means
Well when I say compression I mean decompression only and non-compliant because I just need to work, at least this time
Maybe when I actually understand how it works fully I can make it compliant
Do you want bootleg melvin for that?
It's cool - I'm learning stuff π
where can i find this folder? it's certainly not in the same documents folder as the trailmakers blueprints
Iirc you need to make that folder your self in documents
i'll give that a shot
Yeah it doesnt matter where it is. In vscode you change the setting to point at the folder so it doesnt matter where it is
alright then
am i missing something?
Just click "Open user settings"
And then you can switch to the Workspace tab
guh
usually there is an option to open that directly, but i guess it doesn't show up if you don't have a workspace (i.e. folder) open
yey 
No I want to make my own, I think it would be fun to try and make it like one of those realistic angry birds
I'm not sure how the eyes would work though, since they're pretty dependant on refraction
I do hope lua is sufficiently fast enough for the things I want to do, but I have high hopes because I switched everything to local and got a 10x speed boost :3
It's just that deflate isn't optimized for speed but ratio instead
damn, what you cooking up?
That's a secret as a surprise, alvaro might know but I'm not 100% sure
can someone vc for help?
Mmmm. Big things are coming soon
How much, if any of this applies to moonsharp? I know about the local thing of course, but I'm unsure of the others
https://www.lua.org/gems/sample.pdf
Getting started 
I'm gonna try to make it readable this time, I learnt my lesson on trying to make everything fast with the fixed block type
I just realized something is wrong too
It should be 7
Nevermind?
Oh 255 is not 
Classic naΓ―ve search mindset π
could some one help me
write your problem here so we can all help you. loads of people already said they wanna help you π
thanks both im working on a mod that enables some sort of capture the point i have the position of the players and the points but idk how to look if a player is on the point i dont think i should just spam if statements but idk how i should do it
Quick high-level explanation, I can give details later maybe.
- Have a list of capture points that is the positions
- During every update, go through all player positions with for-loop checking whether their position is within distance of the capture points. From there you can determine if they "capture" it.
tm.vector3should havedistancefunction to compare two vectors. Player position you can get usingtm.players.GetPlayerTransform(playerId).GetPositionWorld()
whats the difrence between getpositonworld and getpositon
None. Get Position was just the old one that has now been deprecated in favour of the more explicit GetPositionWorld
which one should i use
GetPositionWorld
tm.vector3.Angle(vector, otherVector)
so i would use this
.GetPosition() isn't documented as deprecated. Should it?
no, tm.vector3.Distance(a, b) (in practice, you can just do a.distance(b))
I am just freehanding based on what I remember heh.
I think we should do that to reduce confusion.
But then again, we dont have any policy regarding actually removing APIs yet, so not strictly important.
ah ye i understand the vector distance now
Why not use triggerboxes?
Seems like a much more performant way
what are that
spheres are better than boxes
ye was planning on boxes but this is bett
better
Doing a bunch of distance calculations every frame is worse than having tp deal with boxes imo
The calculations still has to be done but just on Unity's side :p Plus the box calculations are more expensive.. But I think they might be quicker in Unity.
Which should be more efficient
maybe
depends on how it's implemented under the hood (although c# is likely faster, and if it's done internally in unity it's likely to be in c/c++ and even more efficient)
But anyway, in my head it was just a whole overhead of spawning a PioNet spawnable object which I felt was a little overkill.
Of course both solutions are totally durable.
Fair
Maybe share a code snippet, because im not quite sure what you're strugling with
pointA= {834.7769, 345.2936, 1110.791}
pointB= {1947.75, 231.8369, 2247.872}
pointC= {1349.093, 204.0641, 581.9082}
function getpos (playerid)
local pos = tm.players.GetPlayerTransform(0).GetPosition()
tm.playerUI.AddSubtleMessageForPlayer(0, "location", tostring(pos), 5, "Icon")
tm.os.Log(tostring(pos))
return pos
end
--tm.input.RegisterFunctionToKeyDownCallback(0, "getpos", "p")
tm.vector3.Angle()
this is all i have now
the top should be vectors i think
If you want to check the position every frame you need to define a update function:
function update()
-- code that executes every frame
end
k
In that function you could loop over your playerlist that you can get with tm.players.CurrentPlayers() iirc
does this output the player ids or number of players
and that would be a for loop?
Yeah a for loop
Its a table of player objects
In what order?
what are for ipairs and pairs
Each player has a id that you can acces by player.playerId
ipairs is for iterating a table with normal number Indices
If you have a table like {"test"=2, "test2" =3}
You would need pairs
Because it has strings as indices
No idea, test it out.
I dont think anyone has documented it yet or even tested it lol
Oh
i think index is a table or smth and the value the value of the table
Index is the position the element is at inside the table,
And value is the value this element has
ah makes sence
In this case your indexes would be "test" for the first element and "test2" for the second
But in any other table that doesnt have this notation with the = inside the table you normally have numbers for the indexes
Starting from 1 in lua
whait ipairs or pairs
Use ipairs to itterate over the table of player objects
You can imagine the playertable to have this structure: {player1, player2, ..}
This table can be itterated over with numbers
what would the player table contain
I've always used normal for loops for now, but I'd imagine I'd have to use the pairs or whatever for the players
undefined, order should never be relevant (because structures are graphs, and nodes in a graph don't have an order operation defined). Only relevant thing is that it's an array, so blocks are in indices [1, amount_blocks]
The player Objects like i said
it's defined in the docs
(docs being here)
No the players are just returned in a normal table and have number indexes (what else would they be indexed by)
ipairs, which is for arrays
im sry its a lot to remeber
ye staring at it
--- Get the GameObject of a player
--- @param playerId number
--- @return ModGameObject
function tm.players.GetPlayerGameObject(playerId) end
this?
look for tm.players.CurrentPlayers instead
No, the table you get returned from the function:
tm.players.CurrentPlayers()
Is a list of all player Objects
what is a player object
I mean you would have some kind of order, unless it literally just calls a randomizer function
Though I guess that order isn't as simple since it's not like the structure is a tree or something
I see
Its a reference to the physical object in the world and also saves the playerId which you need to call your function
You can acces the playerId of your player object like this:
for i, player in ipairs(tm.players.CurrentPlayers()) do
local playerId = player.playerId
but wouldnt this overight itself with the next player
Sorry forgot an i
Yes you need to do something with the playerid in that loop if you save it like this
ah
You could for example call your other function there
(Also forgot the ipairs (silly me))
currentplayers only returns a table with the player id, it doesn't actually have a reference to the physical object
this?
for _, player in ipairs(tm.players.CurrentPlayers()) do
local pos = tm.players.GetPlayerTransform(player).GetPosition()
...
end
oh ye that was for testing
Also, I'm assuming variables need to be declared before being used, even in the top scope
-# I guess after is a bad habit from JS 
you can just do local var_name = init_value. Omitting the init value just uses nil
Oh interesting i guess i misrememberd
No I meant as in
function func(a)
return a + const
end
local const = 12```
in the end, I did put the declarations at the top and that works, so
const there is undefined within the function, because it's undefined at the time the closure is created and it's not in the fallback global environment. The scope of a local variable starts where it is declared
and how do i get my cursor normall again
tysm
its so anoing
can you explain vector3 better dont really understand it yet
thanks for all the help btw
its kind of like a coordinate.
its a data type that stores an x, y, and z components. its mainly used to represent positions and directions. you can create one using
tm.vector3.create(x, y, z)
or you can get it elsewhere like from getting the players position
how do you have mutible
-- I created one now
local pos_center = tm.vector3.create(0, 0, 0)
-- Now I create a second one
local pos_another = tm.vector3.create(1, 2, 3)
-- pos_center is x=0, y=0, z=0
-- pos_another is x=1, y=2, z=3
-- lets try print them, check the log for the result
tm.os.Log("Here is pos_center informatio")
tm.os.Log("My x is:" .. pos_center.x) -- this prints the x of pos_center
tm.os.Log("My y is:" .. pos_center.y) -- this prints the y of pos_center
tm.os.Log("My z is:" .. pos_center.z) -- this prints the z of pos_center
-- etc
ah ye makes sence
Trigger box is more efficient
question
are audio files able to be pitched discretely
and can i use doubles for their input
and crucially, are the soundmakers' files exposed to the audiolist
Is there a way to detect if someone does something in the editor, I don't see an obvious function in the docs
I guess I could just assume they've done something if they're selected a block, but that only applies to single selections
Like what
I think we only have the get selected block function, but you can tell if a structure is in build mode if the rotation is perfectly level
we do have a getStructuresInBuild (or similar) you can check for number of blocks there to see if new where added, if more than one at the same time it's a new creation/copy
You cannot check if you edit the setting of a block
You cannot check anything with decals
You cannot differentiate moving a block and selecting another identical one
The rest should be doable
Oh, 6 years, I guess
dang already?
crazy
I see
Guh, every implementation does something different 
Personally I have no idea what any of these questions mean π
I hope someone else here can help you
Wait, what are you trying to do?
Inflate (Deflate decompressor)
I think it will be the hardest part, everything else should be like a breather in comparison, but block type 2 is going to be a nightmare
why does this output hex garbage
players= tm.players.CurrentPlayers()
tm.os.Log(tostring(players))
Because tables don't have a tostring implementation, so you just get the address the pointer points to
When spawning custom models, is there a way to directly modify the transform matrix, or modify the depth it is rendered at?
Thinking for UI
What does that mean
Probably that you can spawn a camera for the player, and if you spawn it in the right position relative to the object you get the effect you want, problem is you can't apply this to the existing camera
I guess I'll just have to use CPU to move the geometry then 
At least for 2d elements, gizmos might be harder

It's generating sometihng, I'm gonna have to check if it's correct but I'm at least a bit happy that something works at least
π₯ , i wish i knew what it was
we really need access to all the ui elements it would be amazing

the react
Don't worry frans it's only like 45k triangles so it should be fine

No fun π
High res melvin is too powerful
"Salty Chirpos"
What would be the pigs then? mildly sinful froggits?
Hell yeah
The modding UI isn't showing up but everything else is working?
Oh nvm it was just ctrl u that freaked out for some reason
not even the gz dumper I found works
Ngl this sounds like a snack
Yeah, tables are passed by reference, not copies
Yes, even that will still reference the same table
You have to manually make a copy with pairs/ipairs
because tables are just pointers to data, and recursively cloning them is expensive. Pretty much all languages do the same with arrays/objects/tables/dictionaries
so long as you don't have nested tables (you seem to be using them just as arrays, so that's fine) this should work
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
end
return t2
end```
I don't need it to not be permuted because I know the state and I kind of have the counterpart, but thanks
I'm not even sure it's worth the brain energy to do all this instead of brute force searching most of the values in the table (I mean max length will be 288)
I was just confused over why it happened
I'm trying to find if there's like issues with having a large table but all I can find is that having lots of small ones is wasteful
Like I could just create a 128 length table in this case, but later on I will have to deal with 2^15 so 32k, it's wasteful, but it should be fast if lua doesn't have like overhead for reading large tables for some reason
I mean at most 1% of the 32k table will be used but if it's float64 (which I don't know) then that's only like 130K
you seem to be using them just as arrays
Yeah I don't really use much else I think
I was comfortable with the options that uInt8Array etc gave me because I didn't have to worry about the weirdness that tends to be implemented with general purpose arrays
I do feel like I need a break because it feels like i've been making minimal progress in the last days
You have been so busy with your project! I see you here almost all-day everyday!
I dont feel busy though
it's more like exhausted
cf. this, it's like two things i've gotten to
And if I get just one bit (could be literally) wrong I would have no idea where to even begin debugging but that's a problem for future me if it happens
So far ironically the only thing that's really been helping is checking my work with gpt, usually it would suck but apparently it's pretty okay at partially decoding something as it can just write its own program. I was a bit surprised but yeah
I do have like a 2 hour lecture thing I've also been using but it covers gz not zlib, so there's some extra stuff there, but yeah. It's not like "hard" in the sense of I logically can't see this, it's just hard because you have to remeber so much stuff and keep track of it
For now it's just some meaningless numbers but I hope to make even more meaningless numbers so I can make some more meaningful ones 
@formal crane in practice there is no reason to add that because of a couple reasons:
- Lua has closures, so you can just create functions dynamically at the language level without having to evaluate strings. This achieves the same goal of dynamic code generation, but it's faster, less error-prone, and the editor can help you catch errors (since you are working with actual code rather than strings)
- moonsharp already has
dynamic.prepare()/dynamic.eval()to achieve the same thing
@ivory agate for your usage of self-modifying code, you can override/shadow function names (simply assign another function to the same variable/global name), although in practice using closures is all you need
i wonder if we get access to all the space sounds like the voice lines and the elevator sounds, that would be awesome
Next update will have ~200 new sounds available from Airborne and Space Sector.
Dont know what sounds though :p
I just coulnd't help it π
Also these variables are definitely something with the length_code_length and MAX_LENGTH_LENGTH
How would I make gizmos though? or is the answer you don't?
I swear I saw some earlier
spawn a 3d object at the correct location and use mouse raycasts to detect where the user clicks
No like the rendering side
Because if I just move them closer to the camera then the perspective is gonna be off
If you scale one axis down and flatten it the prospective should look fine, but I'm not sure how good it will look with shadows
How would I do that? I don't think I can scale it on an arbitrary axis
But at that point it would be isometric so
Iirc you can scale objects on each axis independently, and any other direction should be a combination of those
No? Because if I do it will just reduce the dimension I'm trying to flatten it on
Basically making it a line with two and just one point with three
If you don't set it to 0, but a low enough number it should still not be isometric, once you set it to 0 it will be so, as well as being pretty much the same as if infinitely distant.
You can scale separately the 3 major axis, but this means not every scaling can be made (you can't flatten it on axis that are not the main ones)
I'm not sure I understand anymore 
What I thought I had to do was scale in the axis projected from the camera that forms the planes, therefore flattening it
Yes, BUT, since you can't arbitrarily scale any axis, only the 3 main one, you have to march the axis projected from the camera to one of those
But would't that look very wrong?
Okay so I really don't understand
Like, if I just scaled in the x y or z axis it would be wrong right?
ah, my fault, i forgot to say this but the axis are relative to the object (when it comes to tm scaling)
so as long as the object is rotated correctly you can scale it properly
Okay so it's local, but if I want to rotate it then flatten it?
then you can't, assuming i got correctly what you mean
Say this, like these two
it will only look in 6 directions+ any rotation on the remaining axis
I see
yeah, this can't be done, not with a "normal" cone 3d model, you'd have to rotate it before exporting it to obj, but this will mean being stuck to that rotation, which i'm guessing is not what you want
Yeah no
So I have to make like 10k+ variations of the same model to get decent angular resolution
Yeah...
Can't wait for when we'll be able to make objects dynamically directly in-game
Now let's run this through the standard algorithm and see if I get sad
did you get sad?
Once I'm done with all this then I'll finally be 25% done, but that's after exams, have to do them for now 
Good luck with your exams
curious, is it possible to use SpawnStructure to spawn something like a custom bullet at a certain (adjustable?) location on a moving build?
You can only spawn blueprints
Should be possible
nice
Spawning blueprints always need to be owned by some player which makes them really annoying to work with and can cause a magnitude of issues
what about just setting the blueprint owner to the one who spawns them?
Would be the best option, yes
Just not sure how doable it is on a moving build, iirc spawning stuff takes a little and for that time it can't move, after that you can apply the force you want
You'd need to test it
Wait there's no way to do something every physics or graphics frame?
Okay so it does take 200ms to do the lookuptable construction
I'm sure that's fine
Also there's no debugger right? only print statments
yup
you can run update() at 60hz
What is "faster than the game"? >60Hz?
It's not in the docs? or is it official or something?
yup
physics run at 60hz, you can't go faster than that
Can't you do other things faster than 60hz?
no
Also finally 
oh okay
Also damn vs code is slow 
I mean it's an electron app so I guess it's kind of expected
Especially for 8KB of text
Now let's try it with real world data and watch it break π
Yup, and it's also in the canonical algorithm which I barely understand 
Okay apparently I just set some lengths wrong, let's just hope it wasn't for a specific reason
I'm not exactly sure why I set this to 5, I guess I should just name every constant

what does this mean
almost 10% of my code is logging
damn
That's not supposed to happen
Nevermind 
It actually is like that for some reason
I swear this thing is full of off by ones
All made by me 
i have no idea what ur even saying, is it maybe binary or smth?
Yeah I'm trying to do decompression
ok
Okay finally, I think no compression is working flawlessly
Lmao
zero coding knowledge but that's hillarious
Also got the actual compression working 
Total runtime for now is about 8 seconds, one of which is spent on a crappy base64 parser 
Do we have math? I assume
yes
my mod has been updated, go check it out #1357312069824938114 message :P
How do I use callbacks
I just get
function is not a function and has no __call metamethod.
Oh so I can't just put a function, I need to make a function that calls a function
I see
i think you can also just put the name of a function, but i find it to be easier like this
its a little easier to keep track of your parameters this way
Oh right the parenthesis executes it
Right
Do structures actually contain data or are they just objects with methods?
Yeah I'm confused
Hm
No way to get the id?
Of what with what?
What do you need to know about it?
i don't think it has an id like player id but you can get all structures owned by a player, tm.players.GetPlayerStructures(playerId) (this gives a table with the structures) and then use ModStructure.GetBlocks()
So this is for mod spawned builds only?
i think so
yes
structures spawned by players don't have a structure id
I see, I will just have my code be intended to run in the builder and always assume one build, seems the easiest
there is also this tm.players.GetPlayerStructuresInBuild(playerId) i haven't used it before
Yeah that's the one I will use
Since I have no idea how to get the "focused build"
Or the one that the player is currently in
i mean you can just choose the one with the most blocks
No
i mean theres no great way to know which structure the player is actually working on
Yeah just doing this to explore what I can do
one work around that i just thought about is using tm.players.GetPlayerSeatBlock(playerId) to get the seat block and then getting the position of that and then comparing it with the position of other structures to know in which one you are seated
I guess that could work
It's also much more sane than what I had in mind for the structure ID if there wasn't a getblocks π
nvm there is ModBlock.GetStructure()
Yeah but you can't check if it's the one you're in
ah this isn't in builder specific
this message confused me for a sec
so just do tm.players.GetPlayerSeatBlock(playerId).GetStructure()
thats what this is for
Oh right
That's definitely a deer
Y up
Also what are like the coordinates? like sometimes I get the origin when I try build.GetPosition() and sometimes it's some arbitrary position that doesn't really represent anything
I might need to experiment my way to finding out what defines the rotation axis
iirc it's local to their weld group
I'm pretty sure I don't even have the correct global coordinates for the structure either
Yeah
It's just relative to the builder origin

I don't see how that makes sense
because it's likely what the game uses internally and the API just grabbed that
I didn't mean each of the parts, I meant the entire structure
No way to get any information about the builder right?
Seems to be spawned seat first, (0.0, y, 0.0)
Though that could just be a lucky coincidence
Do you mean in the API? as a mod? externally?
I fake slipstreaming in my mod with trigger boxes and forces
you ought to try saving drag levels of the structure and decreasing them instead of adding forces, it might be more dynamic and doesnt do odd forces when the car isnt facing the same direction
might be more stable in 2.2 but im fairely sure its not that broken rn
That was my initial idea but as we don't have a getDrag function I couldn't figure out a way to do it that way
That is assuming setDrag also stops behaving weirdly
uau it's been silent while i've been on the start of my 2 week minecraft obsession
does anyone know what the max size for a Preview.png is? i keep getting upload failures with my current and its 1000x1000 and 1113 KB
i believe it to be 1 mb
so yeah you are over
Ayyy nice you uploaded ironwood
yep. with a final total of 312 custom models
now to work on the next map, with even more
We are now shiny 
woah
Damn
woah
Oh yeah shiny - cool
Hell yeah
It's nice seeing modders get some fun colors like wikimakers
how likely is it that sometime in the future we will be able to set snow settings on objects?
@shell ore you mispelled your map in your thumbnail xD
happend to me once too
keywords: it's not done yet, and we are prioritision other stuff
let's wait until the base implementation is done before wasting time discussing the future
alright fair enough
π Iβll change it soon maybe lol
airfeild
i have comp mod but the game seems to just give up and crash at 2100 comp, any ideas as to why this is?
because your 3 times over the limit set by the decs, also 2048 blocks just crashes your game
game instacrash at 2048 blocks, mechanical blocks count as two
any way to get around it?
multipart
any other way?
use less parts
there aint some magic mod for it?
no
aw
no
There are no "snow settings" on objects. There is only show on terrain AFAIK.
We teased the idea, but nothing planned or solidified yet.
https://youtu.be/Ge3aKEmZcqY?t=5698
Idk but this video reminded me of the wheel raycast system, I guess it has to use the built in ones though if it wants to hit everything at every angle
much smoothness
@radiant lion
I know you can remove custom objects spawned by your mod
Do you recon trailmakers will like this much road as a custom object
ill most likely have it be decorated using trailmappers objects and hopefully some buildings from airborne or such if i can get that to work
currently sitting at sub 8k tris but it might turn into about 15k when im done
I have like 7km of road and terrain on my spa Francorchamps map so i think it will be fine
Quick little update for changes to 2.1.2 sound list!
226 new sounds added
Here is a full list of them π
#1423565172018118768 message
They are very untested - it is pretty much one of the lowest of priorities due to resources available.
I split my roads into smaller objects and set them all to have origin 0,0,0. It preserves the offset in TM and makes them easier to place/load in game
-# I should really rework my road creation tool so that it is actually usable and can create intersections etc.
-# another thing that i will always keep on saying, but never actually do
neat
Instantiation at this rate when π
Okay no but 15k does seem like a lot, at least for me
You can't modify the audio right?
Like skip parts, pitch or anything like that
Correct. Can't even modify volume.
When i get to simplifying, alot of the straight roads will be de-subdivided for sure
itll probly trim that down to 4k
Hm, is there a sound limit like minecraft?
That way you could just spawn that many sounds each time to clip the previous
audio modding is like the lowest of lowest priority at the moment π
How do I even do something every frame?
Everything I can think of just means stalling the cpu with work or checking if something has changed in a loop (which would probably stall it either way)
The answer is no 
It's funny that it says timed out because it was basically instant
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> ABBBBABAAABAAAABABBAAAABABBBBBABAABAABABABBBBAB: RepFuncQueue overflow
Use the update function, you can then do setModTargetDeltaTime(1/60) so it happens every frame
I guess it isn't in the docs for some reason
Also I*m not sure if it's my game but it feels like half the sounds that are avaliable do nothing
It is
i am pretty sure with 2.1.2 they added all sounds dynamically, aka you have access to EVERY sound of the game, which likely also means some useless/quiet ones
I'm gonna try all of them at once to check what it sounds like
Disappointment
What why is this even happening, i'm just trying to access an array from outside the update function
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
you are trying to use an object that has been despawned
I did figure it out it wasn't defined in the first place
Also yeah all of the Amb sounds seem to do nothing
Or maybe they're just a lot quieter
What does this mean? it doesn't mean time at least
should be duration of the audio
but you can not stop or move the sound
Afaik it plays until it runs out, at least I tried with 1000, 1 and 0.1 but no difference
Yo guys
would it even be physically possible to make a TM mod that could allow inputs from a VR Headset?
like binding things to controller rotation or making aiming servos point towards the angle of your controller/headset (Second one would probably be way better because you don't need to finetune the speed and stuff)
Yes this is because I want to become a giant robot
Nope, we can't even check controller inputs with mods
damn that's sad
can I know why?
just curious
speed = 0
for _, player in ipairs(tm.players.CurrentPlayers()) do
local playerId = player.playerId
tm.playerUI.AddUILabel(playerId, "speed", tostring(speed))
end
function update()
speed = ModStructure.GetVelocity()
end
why doesnt this work
because it's not doing anything. You update the local variable speed, but never tell the game to change the UI after it is initialized
Assuming 'ModStructure' is defined somewhere ||which i dont think is the case||
no this is the only code i have jet
then modstructure isn't defined and that will spam errors
ah k how do i do that
You nees to define the variable and initialize it with valid data
You could probably make a macro that translates controller input to keyboard input though
But of course that would be outside of the game
Can a mod game object be a player or does it have to be something like a custom model or spawned object?
Asking for the extra sound options
I'm pretty sure you can get the playe game object, yes
Probably, yeah, but you won't get the precision of knowing at which angle the controller is tilted
Damn
Why?
oh right
yeah nevermind
how do i do that
tm.players.GetPlayerSeatBlock(playerId).GetStructure() this returns the structure the player with playerId is inside of
if the player is in no structure this will throw errors
you can check if the player is in a structure by calling tm.players.IsPlayerInSeat(playerId)
for _, player in ipairs(tm.players.CurrentPlayers()) do
local playerId = player.playerId
if tm.players.IsPlayerInSeat(playerId) then
tm.players.GetPlayerSeatBlock(playerId).GetStructure()
end
end
like this
?
yeah
k
just this wont do anything right now as you dont save your structures
is that in func update
wdym? what do you aim to do with this mod?
im trying to make smth like turn rate mod but with diffrent stats
then you will want to check every players current structure every update cycle
also whats the diffrence between getspeed and getvelocitie
speed returns m/s and velocity returns a 3D Vector
so in func update
ah k
you can do that by having all of your code in the update function and then using the return value of the ...GetStructure() function as the object to perform these other methods on like the getspeed or getvelocity
@warm canopy could you please unmute burger he was just trying to get help on some code
casdekker2010_41269 was unmuted.
how do get that code text?
^
do you mean how to format text to look like code?
for short code blocks you can put these `` around the code
for longer code blocks do
```lua ```
you will need to include the speed = structure.GetVelocity in your code now to update your speed variable
how do i update the value of a ui label
Setuivalue iirc
--- @param playerId number
--- @param id string
--- @param value string
--- @return nil
function tm.playerUI.SetUIValue(playerId, id, value) end
is there any optimizing mods?
There are mods that do structure cleanup/antilag but nothing like sodium from minecraft if that's what you mean
im asking because i have a 2 core cpu and 6gb ram 2gb vram and cannot upgrade for a couple of years
unfortunate
but yeah no. besides structure cleanup we cant do performance mods with the current API
on the lowest settings I could get i got like 30 fps on test zone
I would recommend for you to switch to "Force Single Process Server" with a machine like that; it is usually better in low-end machines.
not sure what channel to put this in but im wondering if the menu video is editable, here i have changed the original to just a general aviation video, but in game i am met with a frozen first frame of the original
show file name extensions make sure its an mp4
You have the mouse as a 2d vector, and the mouse wheel as a scalar value, but yeah true
