#General modding chat
1 messages · Page 10 of 1
why does clearUI also clear the mouse callback?????
I'm quite sure it clears none of the other key callbacks
oh sorry i didnt know my mouse click event was a ui element
correct!
only the mouse ones
because i assume its internally lumped in with the ui since its in tm.playerUI(why?)
Y’know you could use my library
which?
i dont really need complex ui
Btw, just thought about it now, but this might end up being way less than expexted
Assuming TM converts it into a 32 bit integer it's gonna overflow
ohh so i have this issue sometimes where when i enable a mod it doesnt actually continously update, i have to reenable it
and sometimes the ui function just stops
If for some reason seconds instead it uses float to mark seconds it might instead be actually infinite, since it can't subtract 1 it will just round back to itself
I tend to just opt for 999999
I highly doubt someone’s going to be playing for 11 days straight
What format is value in?
Watcha making
the string format accepted by the create function
the ui data is from the mouse click
Vector accepts strings !?
yeah...?
That's news to me...
Doesn't seem that major to me
hmm idk chat
i feel like that should work
i would show a video if this thingy was working
it should
Possibly stupid
But might it be that for some reason negative numbers break it?
I'd say try with some custom strings
Honestly expected, but still... I was hoping it was as stupid as the Vs code parser with negatives
i tried removing the parenthesis but then it just gave me a pattern match error
try with integers
i forgot modgameobject.addforce also just doesnt work
oh another bug
cameras just dont work if you use either orbit modes
all other 6 modes work
you wouldve been able to select a landing spot if the mouse position thing worked
you press ctrl to bring up the menu and then you can type in a code with the arrow keys
As you might know, clearUI clears subtle messages too.
Also TM just randomly clears them from time to time which is really annoying. There's nothing that flags this so I give the player a hotkey to manually bring back important ones if they disappear.
Also TM just randomly clears them from time to time which is really annoying
id know
kinda sus ngl
tf is this goofy LOD
its probably 2 variants of the same model on top of each other but i cant actually tell
@scenic echo please (maybe) fix my bad code that i havent tested in game a single time
Uhhh, maybe test it? Idk what it does or what your tables have stored
aw man i have to do work myself /s
damn
thats crazy
so apparently block is nil despite the for loop for blocks running
i lvoe luahh
I need to see what the difference between ipairs and pairs was again
ipairs gives i
pairs give nothing
useful i know
for my use i use ipairs if i need the index
Both ipairs and pairs give i
ah i see hwy its throwing erors
Ipairs just skips items with indexs that are not numbers like "home" and ones that are under 1 like 0
nerd talk
Have you found why your tables are nil?
so basically
blocks contains ModBlocks
ModBlocks is not ModBlock
thus, ModBlock.GetName() fails
Ohh no
this, works
Maybe put an extra check in the if with .exists()
nononono it does exist its in build mode
the issue is that blocks originally wasnt a list of ModBlock s
it was a list of ModBlocks
those ModBlocks listed the blocks
so basically i was running .GetName() on a LIST OF BLOCKS
not the blocks themselves
... My brain is ... not comprehending
So easy fix right?
ye i fixed it works beautifully
2 blocks and you are banned
ModStructure.GetBlocks() returns a ModBlocks
when people go through blocks in a structure, its usually like:
- blocks = ModStructure.GetBlocks()
- returns a list in ModBlocks format (it's a list containing many ModBlock)
- for _,block in blocks (loops through ModBlock in blocks)
- do shit to the blocks
theres gonna be a minimum blocks amount
but what i was doing is, essentially,:
- for all structures, blocks = table.insert(blocks, ModStructure.GetBlocks())
- for _,block in blocks (loops through a list containing ModBlocks (ModBlocks are lists of many ModBlock))
what i was doing is storing a list of ModBlocks, which contain ModBlock
Ohhhhh, lol
and then trying to run ModBlock functions on a list instead of a ModBlock
got the essential tracking + raw display done, tomorrow I think will be punishment and profiling?
Ipairs is for lists. Pairs is for general tables
Thanks, i knew you were gonna say something about it 
if we have ipairs why dont we have jpairs and kpairs...
What about itrios?
would that be a composite key to value pair?
I guess either nested key value pairs (so yeah, composite key) or key-tuple, if you want something totally useless
Especially since tuples aren't real
you can already use tables as keys and pairs will return them (iirc it hashes the table's contents)
can it not do the same for userdata objects?
in sm there is a uuid object type, if you want that to be the key then you have to tostring() it
using the uuid object itself as the key doesnt work
pretty sure it can. Not sure how they are hashed though, it might just hash the memory address unless the userdata explicitly implements a hash operation and that would be useless in most cases
hmm i see
peak
for context heres the code that causes that moonsharp error
lol what its just deleting the seat
and now it just deleted a singular wheel...
gigantic lag spike that is a pain in the ass to deter from normal lag
it varies from like 10ms to 50ms
or sometimes 281ms? from mid may
POV, you forgot to click the 'static' box
what…
close enough right
vro
1724ms
frametime vs fps is correct
LOL
Hey i think a player joined
i successfully deleted the concept of the players
🔥
this is fire actually
aaa
I might have figure it out? I put onplayerjoined before update and it might not error but I'll have to check properly later
i might have made my server stability mod too good 😭 any moderately complex build triggers structure clears
this is still so funny... 3000ms frametime
i have no idea how this mod manages to delete the player controls(?)
nothing has restored controls so far and usually you have to just rehost fully. it applies to players who join after it is triggered aswell
ModStructure.Destroy() having a temper tantrum
ModStructure.Dispose() has no errors with otherwise identical code btw
what happened?
cant move the character, in a vehicle no controls work, and apon becoming airborne the player floats up infinitely
you can still build and get in/out of vehicles i think
i think it freaks out bc im modifying physics speed but it DOES prevent crashes
You are doing something wrong there, because server fps should never go above 60
yeah its probably measuring frametime wrong because of physics speed being modified rapidly
meanwhile, i'm working on a proper way to store data into blocks, and it seems to work just fine, a full 81 bit per block (doouble if you use both colors) and it doesn't seem to be having errors
i have decided to partially ignore efficiency, if i want to store a bool i still have to decode and re-encode the entire RGB color, it really shouldn't happen often enough to matter
i am considering the whole RGB color as a single storage, tho the primary and secondary are managed separately (mostly because coloring is broken)
Nice
how is it different from using the colors independently? Won't you still have to deal with the same unusable bits in each color and thus get the same usable bits in total?
yeah
thus the 81 bits
the difference is that before it was hardcoded to just compress a float
now there's proper support for floats (any size, mostly), ints and bools
so if before i could only store 3 27 bit floats, now i can store 4 20 bits floats and a bool
here, this should be a proper working version
there aren't many failsafes, so mantissa too high and it breaks, data outside of the 81 bits is lost ecc...
car
how can i get rid of this?
i have no idea what it is, jsut ignore the problem and remove the log
tm.players.GetPlayerSeatBlock(playerId)
it keeps doing logs automatically
does it happen when there is nothing spawned?
it happens when they arent in a seat... when they dont have an active seat
my guess is that it's supposed to be used only when the player is in a seat, so if it isn't it considers it an error and logs it. There is no way to check if the player is in a seat without using that though
there is
check the rotations, X and Z are ony perfectly 0 if the player is not in a seat
also tm.players.IsPlayerInSeat(playerId)
Smart
right
demonic actions
somehow i skipped that when going over all occurrences of "seat" in the docs
how does setting rotation on spawnpoints work
it seems like the first spawn point i set causes its yaw to be applied to all other spawnpoints, from there none of the other are applied (besides pitch??)
iirc it's a direction vector
but only the first item, with 50 degrees, is applied
yes i have tried the number only on each axis and it seems putting it on both makes no difference
also weirdly its actually 45 degrees ingame and not 50?
asumming y is up (don't remember atm), the first rotation there is 45 degrees. In fact, all of them are
y is up
then in all of those cases arctan(z/x) = arctan(1/1) = 45º
wtf, this language is nonsense
this prints this
(ignore the longer numbers)
but why is the floor of -31 -> -32
the number is generated like this, it has no reason to act all funky
does the same thing happen with math.log(-31, 2)?
no....
then you are losing precision at some point and not getting exactly -31
that i was thinking, but it's all stuff with powers of 2, that's what computers should be good at
if you implement math.pow manually with a for and multiplications, does it still happen?
is it possible to DoFile a lua file within folders within data_static
yep
how
surely not
like if i wanna load default.lua thats contained in data_static\maps\Treasure Island\
other side slashes
? in your example its / not \
and i did try \ and it didnt work
you said \ in your message
in this its /
never use spaces in paths. Always replace them with - or _
well then ill have it take the space out of name in this
just use gsub
or just use the ID instead of the name
making it easier to read for people if they wish to modify this mod
that doesn't change anything for readability, in fact replacing spaces is worse because it's more complex than it needs to, specially since you already have that translation table
meanwhile, i take back my statement of saying: the mod stores data fine... it just breaks randomly
you set the data: works fine, deselect and reselct the block, totally broken all data changed
miiiiight have been completely my fault, by leaving another mod on
WHAT
why do people sometimes spawn at 0,0,0 argghhh
BRILLIANT
Player gets deleted(?) extremely rarely when using tm.players.TeleportPlayerToSpawnPoint(). Player was displayed as being in build mode despite having an interactable structure in the world. Player reported being stuck on a gray screen after being killed and attempting to respawn.
@topaz arrow so confusion
oh it really hates me putting a all players subtle message there
?
whats confusing? tm.players.getCurrentPlayers() returns a table, and it doesnt allow concatinating a table
oh no, its crying about line 123-125... thats the global variable table one
its this one PlayersRemaining.. " player..... this is causing the error
this used to work before i didnt even change it argh
oop ic why
oh thats not at all worrying
no errors?
mod is functionally basically done :D
are these errors caused by your code or is the game just like that
I think it's just a really rare bug where trailmakers doesn't spawn the player right
it was probably like 1/500
Likely the code considering it's never been reported
it only happened once in >500 respawns and i might have been obstructing the spawnpoint with my vehicle. also it kept throwing moonsharp errors every update when trying to spawn the player
Again, that's likely caused by your mod as it's never happened without it
the mod hardly works now but it worked last night ofc (my fault still)
arghhhh it is such a mess
this subtle message disappearing bug is REALLY annoying for this
race conditions my beloved
Is there a way to know which player entered a trigger?
Yeah, pretty sure the function gets called with the id of the player that entered it as argument
ohhhh, it gives 0, 1, 2 so you dont need to put .playerId
Yeah, just like key callback, since it doesn't have an id or a value (if you want to know which trigger it was you have to use different functions, kinda annoying, but doable since Lua can create functions on runtime)
what?
also repairing as well
ohh its because im setting it to false when its already false
tasty. is there anything i can do about this?
this is spammed thousands of times before the server crashes. although it is probably related to the crash
and again! soon after beginning to host, when a "match" started (everyone gets teleported) it freaks out and spams despawn infos
https://cdn.discordapp.com/attachments/1140936220487192587/1398746090047541389/mod.zip?ex=68867b4f&is=688529cf&hm=749e2af02d93a866728542fa22028b99b5f60586d26fe34e9283534d739b5e43&
are you sure your code isnt doing something weird?
i sure hope not
maybe it is
that is it failing to spawn the player correctly i think
but it also mentions oneshotsound?
but im literally just doing tm.players.TeleportPlayerToSpawnPoint so i dont know what i could do about that
repfuncqueue overflow?
i think what might be happening is that it takes time for the server to set a client's position
so when you get the position for the failsafe, its still the same position
so the function is called again
and the position is still the same
so the function is called again
but if they havent been teleported then they cant be at 0,0,0?
although when i did move that from the player logic loop to the spawn function itself (repeats itself) to fix players spawning on top of each other ig thats roughly when that started happened
0,0,0 is the target spawn point? then why are you checking if the distance to that point is smaller than 10 and not larger?
0,0,0 is when the spawning breaks. i'm trying to spawn them at places other than 0,0,0 but sometimes it just fails and spawns them at 0,0,0
"it" being this function
weird
exactly!
hey also do you know why OnPlayerJoined keeps getting repeated until another player joins?
ive never multiplayer tested my mods so no
never had it happen in singleplayer either
only ive reported this problem so :///
those are the only 3 mentions of it btw
i love connection lost disconnect when I AM THE HOST
@dapper jay are these crashes even my fault...?
like this doesnt look like its my fault
but it crashes SO MUCH
are these issues also present in singleplayer or only multiplayer?
def not my fault
mod requires more than one player for a match to start (its a last-man-standing gamemode)
now that is really inconvenient
lol this error
this is null, really not good.
ok heres the server errors... why??
game, give me information on why youre crying and i can help you not cry
seems like the server almost always, if not always, crashes when this error is logged
bro wtf vscode automatically detected the log file as visual basic
first it was lua, now visual basic...
thats the error i kept getting when i downloaded older versions lol
fuck it im enabling single process, GIVE ME ALL THE ERRORS!!
this code gave me 77 nullreferences for Trailmakers.Mods.Api.ModApiPlayers.InternalUpdate
hosted 8 MAX player modded, this was the only mod enabled. used single process server. one player joined and then i closed the game
that's almost definitely the case, since you can't update physics state within a single frame
if they haven't been teleported yet, how can they be near 0,0,0- which repeats the function?
0,0,0 is probably a default location, probably all objects in the queue go there before being actually moved
yeah
probably actually, the spawnplayers function always says they got a spawnbug
at least its being honest now
there is something wrong with the getSecondaryColor function
on the button press i'm doing this, aka:
get the selected block, and print both position and color.... the positions are different, as they should, but the color is the same for some reason
i feel it's related to the other setColor bug, since to fix this one you have to first do setSecondary (now properly prints the value you just set) or setPrimary (changes the secondary to match the other block)
hmm maybe it's time to look at an alternative data storage method...
https://www.youtube.com/watch?v=hCQCP-5g5bo
I got a bit concerningly obsessed with birds for a few months.
Follow Sarah and The Mouth! https://linktr.ee/inkydragon
Older bat vid: https://www.youtube.com/watch?v=X4eqkaHkTAI
💗 Support this channel and join an amazing community: http://www.patreon.com/bennjordan
👀 Stalk me on social media for more frequent updates: https://linktr.e...
seagulls on stranded
or the chickens? Don't forget the chickens 🙂
yes yes the chickens as well
even that chicken
Seen that :P, gonna have to wait for the Devs to add support for it tho
welp CMM is only gonna be available on airborne then
until CMM starts spawning in chirpos on other maps (actually, are chirpos in any way spawnable objects?)
yes
ohhh I just now got the joke
its available on stranded too no? cause of the seagulls
once again! ModStructure.Destroy() just deletes the seat!
is that a reoccurring issue?
yeah across multiple of my mods iirc
it used to work at some point this year iirc
how are you getting the structure?
in the case i just mentioned,
replace dispose with destroy
sounds like that should just work
unrelated but you could simplify it to
if not tm.players.IsPlayerInSeat(playerId) or structure ~= tm.player.GetPlayerSeatBlock(playerId).GetStructure() then
tm.os.Log("dispose structure")
structure.Dispose()
else
tm.os.Log("skipping structure")
end
unrelated unrelated but you could probably store InSeat and SeatBlock in a variable outside of the loop so you dont have to(potentially) get them multiple times
all of this is true
unrelated unrelated unrelated buttt you could also check InSeat once, delete all creations if its true, and only delete the ones that the player isnt seated in if its false
#optimisation
#successfullysaved3microseconds
why not use .Dispose()? last time i checked dispose is a lot more reliable and quicker
because destroy looks better and players can be really confused sometimes
Dispose actually disposes a structure and destroy sets the health of all blocks to 0 iirc
flashbulb when they discover function arguments
it looks better BUT yeah almost every time i use it, it freaks out and causes a bunch of moonsharp errors
||why use arguments when you can have 4 addForce functions||
very usefull functions💯
Destroy() was broken by an update a couple of years ago. I doubt you'll get it to work the way you want unfortunately. I stopped using Destroy() the day Dispose() was added to the API.
i remember it maybe working early this year but i guess not?
Yeah it became very inconsistent and therefore unreliable
should add Destroy() to #1123915629653667943
It was reported back in the day. I'd rather be modding than re-reporting old bugs. But feel free to post it 🙂
ah shit here we go again
its 32768 triangles btw, so only 1 over the limit
actually let me make it be 32767
nope, didn't fix it
let me make it be 16384 faces? currently its 32767 faces
29282 faces/triangles is weird too
does it just HATE it being triangulated from blender?
OK VRO
it seems to freeze the server for significantly less time, probably because it doesnt have to delete a whole bunch of stuff
whatd i do wrong this time
God dang lmao
The modding API is suffering from xkcd 927 at times..
Worst part is deprecating API functions in favour of better feels scary is pretty scary.
You could have added a ForceMode field just like unity and that should have worked, but that's just me being picky, so long as it works it's fine
Speaking of things that work... GetColor doesn't, and it's probably the reason why setColor is also broken
surely shiny new modding api 2.0 would fix all of this and just magically make everything work
speaking of things that don't work, ModStructure.Destroy() just doesn't
We have a task on it; there was some investigation on the setColor issue before the vacation, but I don't know the scope of it at the moment.
Wonder how MoonSharp handles Enums!
I'm curious if using single process mode could allow client side errors (like UI) to appear in mod logs
That's good to hear :)
oh, and, good morning frans 👋
i think the lua function could just take a number that you could cast to an enum in c#
i was not spamming
no example then!
in my experience with bindings across languages, it's usually either a string with the variant name or a specific set of static objects added to the API, usually as a static table of variant name to object (usually under the hood the object will just be an int as that's how enums work in most languages, but using the table instead of ints directly gives better type safety and allows to easily add new variants without breaking old code, since usually the specific int used for each variant is undefined and not guaranteed to be stable)
Both of those are usually automatically generated/translated by the bindings generator. Assuming moonsharp allows to define API functions with primitive C# types transparently (i.e. you don't need to manually cast between C# types and lua types), it will likely handle enums automatically as well and you can just specify the enum as the argument type in C#
It was also my assumption that it would simple bind it. Issue is I am not sure to what exactly. I don't think it will generate a dictionary similiar to what Vajdani showed. But it would simple bind the numbers back into enums upon getting back into C#.
I just believe we don't have any examples in the game already, so I am curious to try it out 🙂
worst case adding the table of constants to the API manually should be easy, although it would require modifying code in 2 places to add new variants
https://github.com/moonsharp-devs/moonsharp/blob/533e8b0f227bd2f975fb088a08869bf900dddd6c/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataEnumsTest.cs#L78C28-L78C36 a quick search suggests it doesn't add the table automatically, but you can tell it to add it with a single call
why does this always delete the player's vehicle?
"Disposing a structure" always occurs
the initial IsPlayerInSeat check works normally
ohh wait, it might be because this instantly follows a spawn player at spawnpoint thing so it may not think youre in a seat yet
wtf
IsPlayerInSeat() == true
tm.players.GetPlayerSeatBlock() == nil
but this cant be true
because i can get the ModStructure?
but then i cant
idk
and this still doesnt work
i "solved" this by comparing the block counts instead of the structure
You don't split your terrain into several models?
For maps like Ironwood I've split my terrain into at least 50 pieces to save on load time and triangle limits
don't feel like doing it automatically and because it's hard to do multiple textures and stuff it'll just be mostly a reference model to put prefabs on
for an ocean map it could maybe work if there aren't many steep slopes
Oh, as a reference that works fine LOL. If you were using it as actual terrain I would definitely have suggested splitting it
well it can't have the proper surface and stuff like sand or grass so I don't really wanna use it for proper terrain
Very true
that and no texture blending
so mud looks horrible and any transitions don't really work unless I cover it up with prefabs somehow
mud uses 2-3 different textures for some reason
that and no normal maps so sand looks weird
that sounds like a whole different surface on some directions, no??
dirt sound?
peak
how did you manage to do that?
custom model wheel collision being funky. it's been a known issue for ages
Anyone using GetVelocity on ModStructure for anything by any chance?
I just came by it now and see it uses funny method where it only works if players are seated in the structure, and we have a new jobified method for getting velocity of structures.
Personally I don't use it exactly because it requires the player
A modStructure.getVelocity() or even for modBlock that don't require that would be very appreciated
forgot it existed, i just calculate it
That's what I imagined would be the case 🙂
I could change the method to use the new way.. I just don't know if anyone depends on the specific behaviour.
I was imagining making a new function which has the old method.
I'll check blocks!
While we are looking at bugs I am trying to look for these weird behaviours or simple things we are missing that is "minor".
if you have any of these ping me plz.. Preferable in a thread in #1123915629653667943 😄
no wonder that didn't work earlier
didn't know that
oh god... up/down transform missing from ModBlock 
wait wasn't that a problem when biwi was trying to modify CMM to work with different blocks, and those directions just didnt exist.
lmao
i think thats just because the "front" that CMM is configured for isnt always the front that other blocks use. for example i know the straight pipe does not go front to back, but some other direction
yeh, biwi was trying to get the camera block to work but the "forward" wasn't the same direction as the camera
Sounds like something to be investigating, but I dont have bandwidth to check it deeper!
i'm gonna briefly list a couple things that should be really easy
ModGameObject.SetMass(mass)
ModGameObject.SetBuoyancy(buoyancy) (nto exactly sure how it's handled)
also get methods maybe?
controller keybinds support (not actually sure how easy this is)
Anything input is terrible to my knowledge :p
yeah im pretty sure tm has a really weirdly built input system not well made to work with
like anything else
i think that's just due to how blocks are rotated in their "default" rotation, like unity's forward might not be the actual block forward
i mean, i think it would be possible to manually add exceptions, so that forward is replaced with sth else when using certain blocks but that would need to be built into CMM (which is possible, but probably just not fun to do)
i know this isn't CMM mod thread but i would like a indicator for the forward direction so i dont have to trial and error a tube double cross everytime lol
yeah that's kinda what i thought
seems it also is from modStructure
(should be possible, ill look how hard that would be to do as its also annoying for me lol)
I was literally on it as well 🙂
really all i know of is that the ModBlock health related functions act pretty strange
i think there is already a thread for it
https://discord.com/channels/296562030624899072/1368999049188872204
i am not gonna ask for raycast to return the modGameObject they hit... i know i'll abuse that
This is one of my personal projects; I hope to fix it for next update but I need to talk with ton of people to get proper insights into it 🙂
wow yay, I would like to make a bunch of cool stuff with those whenever it is 
Also add modblock.getdrag()
While at it can you check if making a global modBlock.getRotation is just a matter of removing "local" from somewhere (else it's fine as is)
I use GetSpeed() but I think it's the same except it's in Km/h instead m/s. Feel free to remove the in-seat requirement for both as it would be nice to be able to get the player's velocity anytime and easily get a structure's velocity when no player is in it 🙂
Yeah I wish for that. Also Frans - any chance we could have options for raycasts to ignore the player and ignore structures?
THIS! So much this!
it wasn't that they didn't have directions its that loads of stuff just had weird xyz base coordinates, so forwards on a camera was actually just to a random side not where it was pointing in jess's mod, i did fix it , it was just changing that each value was meant to be before it did all the calculations but it made the mod even more aids (and cameras were just a bad idea)
I think the biggest flaw with the mod block stat customization (setmass, sethealth) is that when the block is regenerated (its broken fully and then repaired or the structure respawns) that it gets reset, and the player has to re enter build mode to reapply most changes
i don't think it needs/should be permanently saved with the blueprint, but having it save across repairs is VERY needed if we want normal players to have a good, easy to understand time
a BILLION percent this
, and how would that be abused?
You "can" (big asterisks) use color to store data in blocks, but you have to make sure it doesn't clash with other mods, change color subtly enough that it's not noticeable, pray it works (hope Frans can make it work without too much trouble)... Once I'm done with my missile mod rework it shouldn't be too difficult to have a bunch of custom block kinds
ideally they just flip on the mod, and boom, stats are better. i don't think thats gonna do much though because for what i want i just want hardcoded values so that the host can be super lazy
Assuming a modGameObject is a direct reference to a unity gameObject there is a very likely chance you could get stuff like the floor, blocks or even water... And all relative gameObject functions, scaling, moving, force... Lots of fun for me :)
and secondary color setting doesnt even work on blocks with inputs no?
so that wouldnt work for engines / thrusters / propellers, which are a big thing to be editing
That's the: "pray it works" part
isstatic false on the terrain 🗣️
ok the water/infinite floor its actually fine cause we can set position i hope
These are all conjectures tho, there is a high chance that the water is controlled from a script or something (recalculated every frame, honestly I doubt, but I don't want to raise hopes about a feature that's the furthest it can be from confirmed), and changing it's position does absolutely nothing
a way to add regions where the water waves change intensity would be really nice, like how official maps already have their shape cut out of the waves
the surface level probably not yeah, but changing the floor height would be soo good
and they already do a sort of customization for stranded, it has no waves for a big area around the map
sets vertical scale of water
new intense wave setting invented
Oh god. I never realised you would be able to touch things that are not spawned though mods with that.
i meann if you just delete the terrain and replace it with a modded custom map what could possibly go wrong
Should I not have mentioned it... 
It will be SO broken hahahah
nah better idea, allow us to input a custom heightmap / model and idfk somehow allow us to paint surfaces onto it
i want custom maps man
the campaigns i could make
113hr past 2 weeks straight into mapping, it would be so good
Personally speaking i think few people will try that and even fewer be malicious, even then people can just disable a mod, so not a huge issue, but if deemed to risky I can live without it
And it would save you from having to make a water level function...
In general it is also OK. But from experience it will result in ton of confusion and absolutely weird behaviour
mfw i accidentally hit the menus gameobject and everybody cant escape
Anyway, fun fun :=)
It is probably the most cursed thing that could come to TM modding
dream environments vs literal bliss
Parenting objects (just came to mind, would actually be pretty neat) and runtime textures/object are also decently high, but not even close to that
Having the ability to load textures and meshes from datadynamic would be nice
unity's dynamic asset creation APIs would be a far better solution
That in combination with saving a players bp to data dynamic
was that not what i said? you still had the issue of not being able to use up/down vectors so you used some werid scuffed thing
if i understood it correctly, they meant that forwards wasn't what you would normally consider forwards, so even if up/down were a thing you would still have to transform them to what you want (unless the transformation needed happened to be a combination of 90º rotations on each axis)
I pitched parenting to our network programmer the other day. Think it has great potential too 🙂
Hierarchy changes is pretty expensive and complicated though...
Right, sometimes I forget about the whole multiplayer thing, I bet it's not as simple as setting the gameObject parenting for the host
Yuap. Especially if things are made runtime. If the clients know up front what they need to load and parent before joining the server (Eg. static world) it is pretty straightforward. But with runtime changes and late-joining it becomes a lot more complicated.
We barely do it in Trailmakers. I believe it is ONLY structures that really do any kind of scene hierarchy changes.
Rubber Warriors had a little more of it, so we have some engineers + tools for it already (PioNet is shared across all projects at the company). But it is still quite new.
Oh right, especially late joiners doesn't seem easy, you'd have to store all the ones that have been done... Eh, no use on me speculating on this, as I honestly got no clue
I intended it just as "people joining after things have been done"
Sometimes i forget alva is human,
then he posts something like this out of nowhere xD
if this is serious, my best guess is that people join a while after the server starts
or, and this is crazy, they join late
That shouldn't cause a significant difference from a server that just started though, it should still only have to transmit the current state of the server and static assets/information, using the same protocol. The way it has been mentioned up until now in bug fixes suggests is a significantly different process
#1226065444364877835 message seems like you found something i had a problem with a long time ago lul. if you can split the model and load them indivudually
just simply don't let people join, my genius new solo multiplayer idea
i dont want to bother with splitting a model into like 12 pieces, is there a tool that can do it automatically
Not that i know of
4 pieces would be enough probably
And keed their origin for all at one place so you can just put them at the same coordinate so they match up nicely
With blender you should be able to split models easy enough and they keep the original origin
Although last time I tried exporting multiple objs as one (there is a setting that looks like it's exactly what it does) but I ended up having to export them one by one
how though
i mean i did it before with just some cubes and boolean modifier but its kind of tedious. i’ve yet to find an easier method
maybe knife tool
you can always just move the origin back again if it doesn’t. its pretty easy to set it for all the objects in the same place
Yeah the boolean modifier and knife tool work well but they create extra faces where they cut through existing faces.
Another method is to select a bunch of faces and then 'separate' them.
yeah just select each of the 4 quadrants and separate by selection
Frans, if you are still taking easy suggestions a way to rotate the camera using eulers instead of a direction vector would be nice, right now you can't tilt it on the Z axis
Added a task for it. I am not too familiar with the cameras so would have to be someone else.
And on the topic of cameras, a getPosition seems like a must have (unless somehow i missed it in docs)
It's not possible because the camera is on the client but mods are run only in the server
I mean, could be done by "saving" the camera position as a variable somewhere, and having it supported natively would save a lot of hassle (+ you could know if other mods previously moved the camera)
The server has no concept of cameras, and it can't ask the clients for specific data. If you want to read the position, you will have to save it yourself each time you set it
I'm also decently sure the cameras for each mod are separate
multiple mods trying to control the camera at the same time will always be chaotic, regardless of how it works
What would the exact use case be for this?
EDIT: what problem are you trying to solve
I cant think of many specifics roght now, but at least 2 come into my mind:
- being able to know where the camera was for any amount of proximity, averaging or any other methods like that (i was thinking of having the CMM camera move more smoothly and sometime pause, this would be very useful for that
- if the cameras for players are connected between mods (so its 1 camera per player, not 1 camera per player per mod) this would allow for detecting other mods that use said camera and therefore allow for some sort of deconflicting mechanism
- if the camera moves due to something client side, the server is not aware of it
- Other mods can mess up with the camera arbitrarily, there will always be conflicts between mods that try to use the camera at the same time regardless of how they work. There would have to be an actual mutex for camera control if you want to prevent that
What can move the camera that is client side? I thought mods are server side and that the camera is for mods only
Yes, there will be conflicts, but if i detect that the camera is being messed with by something else, i can at least stop moving it myself and display a message that sth else is messing with it, making it much more pleasant than potentially having the camera jump everywhere because there is a tug of war over the camera position
- I'm assuming there is something (or you want it to work with normal cameras), since otherwise you can just store and post-process the positions yourself each time you set it
- That's a race condition at best. In practice unless you just tried to set a static camera it won't work, and that's assuming you actually manage to detect the movement which isn't guaranteed as the camera just teleports between positions and the order in which mods run is undefined
-
i can store the position myself, yes, but i would assume its more laggy for the mod to do that by itself rather than having it be built in (since i assume the code executed by the game itself is faster than the code that has to be interpreted from lua to native. Idk if im explaining this well), plus it seems extremely weird to not have a getPosition for sth with setPosition.
Also the same could be said for having a block.getVelocity, since you can calculate that yourself -
why would static vs dynamic matter? This detection could be ran by doing what you suggested yourself, saving the position in the mod, and on the next frame if the current position is the same as the one from the tick before, then nothing moved it, if it isnt then we have a conflict, plus of this is that if we assume two mods that constantly move the camera, then we can check only every so often, not on every tick
- You are just storing a single variable (which under the hood will likely be just copying a pointer). In practice, even if you do it at 60fps (which is the maximum that makes sense), it won't cause any significant performance difference. In fact, an API function that has to ask the client for the data would be significantly slower due to requiring network I/O. The difference with block.getVelocity is that the server has to know about blocks to calculate the physics, so accessing that data is simple. The server has no knowledge of client side cameras
- Because if it's dynamic, you will be repeatedly trying to set the camera to update it, which significantly increases the chances of race conditions happening. Again, there is no guaranteed order in which mods run, so it's not guaranteed all other mods will run between 2 update calls of your mod (and that's ignoring any asynchronous calls from UI/event handlers). In fact, it's not even guaranteed that multiple mods won't run at the same time in different threads, so you could even have a time of check-time of use race condition
Camera moving being smoother could be done if (just spitballing, not a real suggestion, would require a few odd/unreliable things) you could set the camera as child of a block, but that would require getting the camera as gameObject, parenting and blocks as gameObject/upgraded raycasts, this is not counting all the chaos that's likely to happen if said block is broken
Would allow for an absolutely smooth camera, but would take a lot of effort to add properly
hey, sorry to break the flow of things, but am coding my own mod using GPT, its ment to be a simple mod that increese the firerate of the small tank cannon, so we could have a realistic looking dogfight witherout the delay of the explosive bullets mod.
but according to GPT, it would be better to code it as a new DLL, that I would add to the game, (witch is authorized by the EULA), but would I be able to use it in a multyplayer? cuz if not, there's no point making it
-# (this channel is way too active, ping me if you reply plz)
Chat GPT is correct in saying modifying the DLLs would be better, the API is way to limited on stuff like this... On the other hand since the accident the whole game is encrypted so you are going to have a tougher time
are you talking of superprop?
Superprop?
but am not "modifying" the DLL, am adding a new one (I think)
ye, the propeller that got hacked, and was completly op
Did not hear of that, so no
whatever then
Anyhow, I don't know much about adding new DLLs except that bepinex doesn't work (at least I couldn't manage), finding where the reload time is stored and modifying said value should be easier, but again, encryption
ye, and am pretty sure modifying existing DLL are against the EULA
Devs are usually fine with it, so long as you don't interfere with other player's experience, if it's just that it should be fine, so long as you give a warning to joiners (assuming it doesn't have unexpected behaviour in multiplayer)
Terror here has more experience, he should be able to be more precise
Don't bother with DLL modifying, it really isn't worth the time and effort required with the current game; its a heck of an undertaking that cannot be overstated, gpt will not help you. Devs are also not happy with sharing DLL's or really discussing them type of mods here.
I'd say try first to get bepinex to work
sure
modifying the game through anything other than the lua API is against the EULA
you can't add a DLL without modifying existing ones. You can add the file to the folder, but the game will never try to load it as there is nothing telling it to do so
adding bepinex alone already needs to modify DLLs
Iirc no, bepinex uses the fact that windows runs a specific DLL when launching the app (don't remember which) usually said dll is not there, so it's just adding... Problem is, whatever the encryption did also avoided this, I can manage to make it work with other games, but with tm it just doesn't seem to run (no logs are made)
winhttp.dll, although in the troubleshooting it mentions renaming it to version.dll, which I did not try
even if you want to go with that technicality, the EULA doesn't just forbid DLL modification
mods using the lua API are explicitly allowed
where does it say "lua" here?
and I would love to use the lua api if it wasen't so restricted, I tryed, but I couldn't do anything witherou having a mod load error
-# (other than hello world)
the lua API is not a third-party software
that's just a code editor, you could use notepad if you hated yourself enough
vs code doesn't modify the game at all,
its literally just an IDE
k my bad
I'll give the lua api once more try
(unless you guys know it can't be done, in wich case, I won't bother)
i mean if you're getting mod load errors you're probably just doing something wrong
logs do show up in the mod folder which usually tells you what went wrong
april fools update, all mod errors become "skill issue."
pranking 0.1% of the playerbase
cant be THAT hard can it?
also are you available rn to test demolition derby
o
There is a chance you can manually spawn bullets, but it won't be that clean
Just mentioning this as an interesting anecdote - In some countries (eg Australia) consumer law allows players to modify their own install of a game for personal use if they wish (modify their own Game experience) regardless of a developer's EULA. Of course that doesn't mean players can use that to cheat or affect other players' experiences, etc..
afaik best you can do is essantially make ur own gun, where you spawn the bullets yourself. cant modify the fire rate, damage, or anything like that by yourself (although there is a mod for a custom gun iirc)
https://steamcommunity.com/sharedfiles/filedetails/?id=3427741362&searchtext=gun
is this the mod you are referring to?
I remember there was some kind of stupid issue with chat and modding but I cant for the life of me remember what it was.. anyone recall anything?
Maybe something with Enter input key conflicting with Activate chat or something? Mod window text field? halp
RegisterKeyCallbacks would activate even when chat is open, but that isnt really an issue
It is pretty minor, so if there is easier stuff I'd say go for that, but a function for if players are chatting or disabled callbacks would fix it both would be more than good enough
Frans dont start the modding thing before im back from vacation ||pls||
Dont worry it is not planned at all 😆
I just pitched something to Johannes some time ago. Not sure when we could do it.
johannes has confirmed some things for content regarding modding:
- Frans and Martin will do some challenge or event
- it will not be mapmaking or campaign related
- Im pretty sure Frans is still camera shy 😭
- Johannes still wants to do another mapmakers challenge, but demand appears to be too low to make it worthwhile
why is he wizard cat on ur screen
You won't receive any help with it here though
Yep which is totally fair 👍
does anyone have any cool mod ideas?
Make a working camera that outputs a black/white pictures based on distance using raycasts. Export said picture in png format
@dapper jay
we cant even load models from the dynamic data dir
well thats for you to find out
You can if its not a workshop mod
afaik:
The issue is you cant write the bits and bytes yourself which makes it impossible to accurately copy the png format.
You only can write chars to a file
you would have to:
- Get the image data as raw pixel colors
- Write a png encoder from scratch to an array of bytes (hardest part due to how complex the png format is)
- Write a binary->text encoder from scratch (likely bytes in hex or base64)
- Write the text to a file
- Use an external program to convert the encoded text into a binary file
i watched a video on how png compression works not too long ago and im definitely not touching that stuff
xD feel free to pick any other image format
almost all are just as complex, simply due to compression algorithms being complex. Your best bet would be to generate raw bitmap images and convert it to whatever you want manually with an external program
You could make a maze/dungeon generator
@dapper jay ||forgot to ping again||
Could also be fun to make logic creations that try to solve these mazes
hmm intereating
could make it so it uses trailmappers maps for each room
randomly generated trailmaker master trial
sounds fun
Bonus challenge: add enemies in form of structures that try to kill you.
I might be able to give you a bit of input in case you need some inspiration
Did you manage to make the png decoder you mentioned a while ago?
That could be a start
I havent even touched lua since then
Anyhow, I'll say what I told you then, I tried copy pasting pngs for the trailedit exporting a while back, but that didn't work, so either the reading or the writing is acting funky
ai enemies in destruction derby when @shadow iris
proper structure controls when @ developer
oh actually what if i just randomly give a force to a explosive metal crate, ggez
but how will i make it not fall into water
OH WAIT i can just spawn chaserai
🔥
just make a blueprint with gyro stabilizers and hover pads and add force so it goes towards the closest playyer
in my ruleset (for hosting, not for the mod) youre not allowed to glide over water
I do have a car chaser ai
chaserai sounds good
but it has horrific slope/cliff support... and it disappears after one successful hit
is the demolition derby mod only for dethrone island?
it supports dethrone and treasure island with a simple map creation system
hypothetically anyone could make it work on any map, even custom worlds
but idk if i wanna make it support pioneers / danger zone out of the box
because those arent really land/water/sky fighting worlds, or if they COULD be used for it decently, theres no good place to put 8 player spawn
and i havent made a system to pick which map to load yet so its always 1 default map
fyi in demo derby, the official map its being hosted on is called a "world", a "map" is called the spawnpoint/prefab-lists(optional) that turn it into a demo derby map
nice
no, not nice
so for maps like gcf
in the current system id have to decide between ground, air, or water combat
it has a way to support other maps, that's nice imo
from this code you can pick which worlds are "supported" (mod attempts to load a map from, if theres no map of the specified name it throws errors and me no like)
my issue is that i cant really auto detect maps
so i cant really do a ui to pick between multiple custom maps or something
Yes but witheout the delay, cuz it’s pretty a annoying to get hit, fly away, then explode, the explosion hit a random block that would glitch out, then trigger another explosion, and create a chain réaction
are you sure? i think you are talking about Old combat mod https://steamcommunity.com/sharedfiles/filedetails/?id=3261105008
mabe, I'll have to ask Whemplar what mod he was using
there has been an update which reduced most of those problems you mentioned
I'll have to try it out again then

disposing a structure when it has a looping sound playing (e.g. a siren) causes that sound to never stop
oh i just realized, maybe if it was read-only sorta? like you can get the name of the gameobject and check what you hit (e.g. check if you hit a terrain vs a structure)
Where's the fun in that?
i should make a mod that makes engines more powerful if theyre painted red. all car enthusiasts know this applies in real life so why not in TM as well.
I have released a mod called: "glider's toolbox"
Try it out if you like gliders.
You might like to create a new thread here https://discord.com/channels/296562030624899072/1126842222898315274
to give updates and get discussion going
It is currently 90 new ones (Not all have passed QA, so list may shorten) at the moment.
I'm starting to think a trailmapper-like mod would be quite nice... Should be doable with raycast gameobjects
It's technically not required since I am assuming it's using a custom camera
I mean, it will be janky, but should look fine
Just custom objects spawned in right places and janky press recognition (getting the object you click, and doing the function relative to it)
overlay UI is kinda impossible also
Having to press F4 before each time you want to use the mouse to place or interact with an object would be painfull.
You could have the camera be mouse controlled but then you would need a build that is responsible for getting the mouse movements.
And as soon as you press F4 the blueprint would stop picking up on your inputs
I had tried to do the same thing a few months ago and also implemented my own cursor basically but i put it on hold because it was pretty janky
I dont think so
But you have the camera position, FOV, and the object position, so you just do some vector maths to figure out which pixel the cursor is at.
Jeppe fixed audio banks, so they will now be resolved dynamically instead of static list.
So new audio's will be available immediately as they get added to the game.
Should add ~200 new sounds from what I can see -- that has been missing from Space Sector and Pioneers.
Do we know the FOV of a camera?
@shadow iris for the next time you need to debug UI handling code. Error messages don't contain the proper location due to a bug but errors bubble up and you can add logs to see where the execution stops
But if there is no object? Or the object is very large? It's not reliable
Oh heck yes. 
c u r v e d
||lame i can generate that inside the game already
||
Jk new assets are very much appreciated
Yes, they're big boys.
@radiant lion do you remember the mess you had to do to convert floats to binary? about that...
bit32 is a non-standard but commonly available module for bitwise operations, seems to be supported in moonsharp
but can it convert from float to binary?
cause i'm pretty sure i checked and it couldn't quite do it
in fact, i'm using it in a couple of places
seems to truncate numbers to ints first, so it can't be used directly. I thought you were still using multiplications/divisions for shifts though
i decided to rework on the whole method, now i'm turning them into very large ints with... this, then turning them to bits (there was probably a loopless version)
Pioneers fence and a wooden crate from a cut merchant iirc 👀
Will there be any way that mods can benefit from the terrain rework in the next update?
No built in mod manager?
there is 
No mods on xbox/microsoft store or Playstation version tho
Only steam
I mean, for a poor mans bans you can always explode the build if the banned block is on there, then display the message "x block is banned" or sth
Fair
Ive seen people not being able to see the mod menu, so...
No i mean the mod ui thingy
Early, late or right in the middle of the day, you never know 😉
Bruh, GUI modding update when? Window.setPixel(x,y) would go a LONG way
Thats good to know. Ive actually wondered whether radars and more andvanced locking could be made for CMM (at the very least a test for the idea) but the font has different size per characters and a giant break between the lines so i cant even make ascii radar display
So i gave up since i had no clue how one would achieve the display of the information
i made a radar display with text and honestly i don’t think the letter spacing isn’t too bad of a problem
couldn’t get the radar part to work tho
Do show
i don’t have any screenshots on my phone
i’ll have to get some later
what if we got access to the dialogue stuff from campaigns
as Einstein once said: "give me access to a big enough text box and html, and i can mod the world"
Frans is just one man, he’s having to play catch-up
All the Devs should work on modding, it's not like they have the rest of the game to work on
I don’t think a shared level editor is within scope of Trailmakers
A lot of the assets I think are baked and packed a certain way within Unity
I'd much rather we had the features to make the level editor ourself
I am honestly of the opinion that too powerful is not a thing, look at Minecraft modding, you can do just about anything, and most of it is good, with some great mods (and some questionable ones), TM should have enough features already that if someone doesn't want to play some mods he can avoid them
Am I saying it's doable? No, am I saying it would be cool? Yes
Time to make players earn me money via cryptomining
I wish we could push data to firebase etc, I know it’s a minefield with data protection etc but one can dream
You could literally set up systems where multiple mod servers could communicate
Time to ask for credit cards when loading mods
Making mods p2w
I accept payment in gift cards
luckily mojang doesn’t allow java mods to be paid for actual features.
Instead they do it with the bedrock version
first is not valid html, and unity is what parses it and that's the only reason html even works in the first place
the devs already have their own tools, and they are far more complex than what players could reasonably use
yes, but since it's unity parsing it it can't be changed
(jk they barely enforce it)
didn’t frans say he’s teaching a few more people the ways of the cursed api?
tbh the tm modding api is more similar to MC datapacks than compared to actual mc mods
If only Trailmakers mods were written in Dreamberd
@formal crane any news surounding transparent textures as its been one of the most requested modding features and you guys probaply already considerd it in some way whilst doing the modding api improvements.
TerrorSoul has made a post about it roughly 2 years ago and i think he is giving some great use cases.
#1126532532339478568 message
I got it working
Wish we could spawn blueprints on behalf of the server so that we didnt run into issues with players pressing backspace
whats this?
Now make them be able to land
Such an odd feeling being in the plane whilst it flies itself
Some sort of combination of code needing optimised and the joys of test branch
how does it work? do you apply a force to rotate it/move it, or do you somehow give off info from the mod to your plane that then turns with logic?
Its using forces for propulsion and torque for steering
Does it work with any plane more or less out of the box or do you need to fine tune the forces for each plane?
Personally think it goes into investigating better material, as in full albedo, normal, specular maps etc. and then good transparency maps with that included.
I wont lie and say I haven't pushed much for it since I think there is other things that are more important. But for every ping like this I do try to reflect over these things.
tldr spam ping frans if you want a certain feature.
Dont
Slow process but yes. There are more people involved 🙂
Its part of my physics library. You feed it a couple of values like force and the rest is handled via a pid
Nice
I never want to make a pid ever again
I heard it's easier once you Laplace transform
God I wish I could push to Mongo
@shadow iris how did you teleport people in the demolition derby mod?
i wonder why it had the spawn bug
There is also GetPlayerTransform(Id).SetPosition(pos)
To tp players
No, but there was no mention of structures
i wonder if only tm.players.TeleportPlayerToSpawnPoint(playerId, spawnPointId, keepStructure) with keepStructure = true does the spawn bug thing
does this teleport while a player is in a structure too?
Nope, you have to first destroy it
can you copy a players structure and then spawn it somewhere else?
No... But it was requested
Would be awesome if we could save a players blueprint to data dynamic
Just dont upload the mod to the workshop, problem fixed
someone makes the blueprint stealer 3000 and steals all the blueprints
And then you would have a lot more people complaining about stolen creations
why can't people just always be responsible with tools 😞
@formal crane Will the new prefabs and modding api improvements be part of the next big update so 2.2?
Would also be interesting to know as to when 2.2 is set to release roughly as the official roadmap on the PlayTrailmakers website hasnt been updated in roughly a year
Yes.
I am not the man with the date, if there is any :p
A month?
if it's a month away, there is likely no date set in stone yet
Can we expect it before gtaVI?
You can expect the end of the world before gta 6

A big update of the Track Creator Plus mod is now live on the Workshop. More info in the new thread here: https://discord.com/channels/296562030624899072/1404642052129423466
-# For anyone still using the old Dynamic Time of day mods; the mod will merge with rainless' mod to avoid duplicates, and the mods i have made will close a week from when the merge is finished to give players time to switch.
Anyone have a good repro on wheels glitching into custom meshes?
I have now tried several maps and configurations but cannot replicate it?
Did it get fixed?
I dont think its fixed, im currently not home but when i tried to generate custom mesh rails the wheels would clip into the rails way more often than if the rails were made out of prefabs by Jess's mod
I just remember driving around on basic custom mesh terrain and it would happen.
Would love some help on finding an easy way to replicate this as I need to move forward for now 💔
Lemme check if i have the mod uploaded to github
Are we talking about wheels dropping right through the mesh surface or wheels just visually deforming in weird ways but with no apparent effect on handling?
Theirs an issue where the wheels physically clip on joints between meshes
But I guess frans means the visual
Yep I'm just not sure which glitch he means
Sorry, it is the visual one!
This is on my Asphalt Valley map near Gale Fortress
yeah thats the jank i am looking for
goofy, thanks. I'll see if I can figure it out!
For what it's worth this glitch is usually accompanied by the sound of driving on sand
Been trying my very best but i cannot replicate it 
Only specific wheels? Could you send me your blueprint?
NEVERMIDN GOT IT
@sturdy iris hows it going?
PC kept crashing sadly
lol how did you manage that
@formal crane Will there be any way that mods can benefit from the terrain rework in the next update?
No.
Aw
the passive agressive dot
I would have thought that it would be common practice to implement the modding api hook whilst revamping certain features as the feature in question would still be fresh in the minds of the programmers. (We know of the added cost of testing a modding api function for 🪰 😉 )
That is unfortunately not the case at the moment 💔
But I can say that this has just been fixed now and it should fix a whole bunch of other weird behaviours that could happens from the same issue.
What was the cause?
I'm hoping it's related to those ghostly convex hulls that get applied to every concave custom object - and that they are now gone
i assume it was a gameobject layer thing
although then it probably wouldve been consistent and not this weird "sometimes works sometimes doesnt" thing
The fix is very easy but understanding what was going on was like 10x confusion.
When a CONCAVE custom mesh was spawned the concave toggle for the MeshCollider, it was ONLY done on the server and never replicated to clients (and late joiners)
So server side the collision was what you expected but the client was still convex.
This would then only break client side collision checks which is mostly particle effects... and wheel deformation!
The wheel deformation only kicks in at certain distance from the colliders. We originally suspected layers, but it didn't make sense AT ALL that it was at a sort of "offset" from the ground.
I guess the physics were OK but visuals were wrong would have been good indicator that about the difference between the two.
Simple had to replicate the information between server and client 🤦♂️
--
Obviously this also fixes a lot of visual/client-side issues with concave meshes.
I was seeing it with the Jetpack beam also being completely wrong when I was flying around a concave meshes.
--
tl:dr Custom Meshes were spawned as concave colliders on server and as convex on clients.
Anyway.. Silly one, but happy to finally have it fixed 
thats what i thought was happening…
i just didnt test it in a server
Ohh this is gonna fix the fire particles colliding with the mesh too :D
had to set everything to trigger to get this to work :(
oh yeah nows probably a good time to say the flamethrower object is missing some shaders, you can see if you look closely
Yeah they are old; there is a task for going through old objects that has been reported as broken #1369074385410982050 and assess what to do with each one.
Just among the... many task
Might also fix repairing on custom maps?
No that is server-side checks 🙂
The issue with that is there is no navmesh baked for custom maps.
I had a talk with Holm about it today.. It is complicated situation since Unity Navmesh is not great™ and cannot do runtime baking.
We want to fix it, but wont be right now (2.2)
could that explain the weirdness mentioned here? #1140936220487192587 message
Yup!
awesome then
Wow if this also fixes mouse clicks on concave meshes it's super awesome!
https://discord.com/channels/296562030624899072/1394493004680659105
it would make sense for those to be caused by the same problem, in which case it would be fixed
Pretty confident. But it does make me realise that the actual raycast then happens on the client which sounds a little silly -- but Ill ignore that for now :p
Just brainstorming - is it at all possible that this client/server toggle issue is also linked to the setIsTrigger problems? (ie wheels and the player character still partially interact with objects that are set to trigger)
This behaviour?
It has been fixed. Was a layer issue.
Yes that! Awesome news!
🫡
yippie
The bug reporting you all have been doing have been SO helpful, so thanks to everyone who has helped with that!
Keep em coming ❤️
Got room for shroom?
🍄 
Just sharing here in case people want to voice their thoughts.
#1126532532339478568 message
Is the wind prefab completely deprecated?
I would be sad if the wind prefab was deprecated without a similar/better alternative to replace it, as it can be used quite effectively.
||(If we could get a better replacement it would be nice to be able to modify the position of the prefab without having to destroy it and summon in a new one at the desired position...)||
I was asks spawning it through Mappers no longer works, I wasn’t sure if it was removed or something else had broken
As far as I know the wind prefab still works in all the sandbox maps EXCEPT Test Zone (I'd love to know why it doesn't work in TZ). In Trailmappers you can place the wind prefabs no probs - unless there's been an update recently?
Ah ok, Jean I was in TZ so that explains that
@formal crane
is there any particular reason why the
tm.physics.RegisterFunctionToCollisionEnterCallback(targetObject, functionName)
does not have a "data" field like the UIButton function?
tm.playerUI.AddUIButton(playerId, id, defaultValue, callback, data)
having a data field like this would make using the TriggerBoxes way more attractive as you could generate the TriggerBoxes automatically and have one central function decide what to trigger depending on the "data" field.
e.g: a mod that automatically spawns interactible doors or whatever could spawn a TriggerBox at its place and link to the globally declared openDoor function that differentiates between the doors using the "data" field.
currently you theoretically can achieve similair behaviour by using the players position to determine at which TriggerBox the player was when triggerd, but that is a lot more jank and a lot less efficient
you can achieve the same thing with closures, but you need to generate unique function names for each
sorry i tried to understand it but i dont get how that is supposed to help identify which action to take?
as in how does the callback know which Trigger it got triggerd by
#1134472573380468848 message
interesting, will certainly use that for now but my suggestion/question still stands :P
I dont have reason for why. I think a lot of the old API we simple didn't know how we could use MoonSharp and we have created better ways simple using native Events (Eg. like OnPlayerJoined, which I think works great)
I actually completely forgot that it worked like that on colliders.. Similar to how key inputs works. Which I hate and wanna create some alternative to in the future.
I am not sure yet I understand the benefits to what Alvaroping is suggesting as compared to events such as OnPlayerJoined.
what i suggested is essentially how events work. At least externally the only difference is whether the callback function is given as value (how events and most other callbacks work, which is preferred) or as a global function name string. With functions as values (closures), passing extra data in a specific parameter becomes redundant, as closures can capture any variable defined in their same scope
Yeah I get that. It is very nifty (and confusing part for me) about Lua.
I do enjoy the events as they are a little more explicit, but I wont judge too hard yet and explore your proposal.
closures are a very common pattern in functional languages, but again, i don't see any difference between events and normal callback functions (OnPlayerJoined also takes functions as values for example)
Never got on the functional programming train unfortunately. Maybe I should consider it for next Advent of Code 🎄
Yeah Alvaro's explanation of the current API workings is how the checkpoints work in TCP. Jess wrote the base code for me all those years ago and I always thank him because I had no idea how to do any of that stuff lol.
any more work on this so far? looks super interesting. im just curious
any chance of someone being able to create a mod to change the exit position on seats?
i personally have no knowledge of coding/mods otherwise i’d try but if there was a mod that made it so you exited exactly on the seat that’d be great
Should be doable, yeah
🙏🙏
here
you’re a goat bro
do note it leaves you EXACTLY on the seat, so you better not have much stuff above it (like 3 blocks at most)
all good i only really needed it for my boats the pirate wheel is notoriously bad with exit spawns
yeah setting distance to 0.000001 fixed that, its a little iffy with some seats, but on the pirate wheel for example, its pretty much seamless getting on and off the wheel.
If you really have issues with the latest version, #bug-reports exists. We are not gonna help you with pirated versions.
I emailed flashbulb and they said there was nothing they could do
also its not like im steal money I've paid for the game and almost all of the DLC's
CTZ try to actually use oldtrails.ludixi.com to get the old version since that should be a lot more legit than whatever you done before
if you don't want to download a tool there is always the manual version https://www.reddit.com/r/Steam/comments/611h5e/guide_how_to_download_older_versions_of_a_game_on/
well I dont think it would change anything besides me not playing on a pirated version
Well thats a pretty big change to us
it would make multiplayer work... but that's not much if noone plays that version
Would mean that there is no reason to delete these messages
wait it would make multiplayer work..?
quite sure, yeah
yeah, you would just need another person on the same version
but you can only play with players on the same version
ok i'm downloading it then so I can see my friends after i force them to download an older version
I havent seen other people in trail for 200 hours just about
so do I take the files out of the folder and put them into the mods folder?
lets go it worked thank you so much
anyone remembers if there is a prefab that does a decent white light? none come to mind
Not that i know
bummer, i guess the guide pages will be dark at night
I mean frans has talked about emission maps in #1126532532339478568 so maybe those guide pages dont need to be dark for long
Also I dont know if our current emission shader actually casts to other objects.
time to make the guide emissive :p
meanwhile, the mod skeleton is about done (removed for reasons)
damn it really was flashbang
and it's not emissive yet
on another note... i'm thinking again about communication between mods
why?
cause this is a modular mod for functional blocks, it would be neat if people could just make a "dlc"
tho it would require being able to call functions in the other mod's environment which i don't know how possible it is
it would make more sense to make the "DLC" just be files added to the data_static/data_dynamic folder
but then either i or everyone else would have to add the file manually, proper communication would allow a second mod to be made that notifies this one, then this one goes to read all the static data of said dlc, i don't have to add stuff, players just have to download it, people who don't want it can totally ignore it (tho this is kinda redundant, as i'm already allowing to completely disable a module)
"maybe"
to pay respects to my mod folder..
seems like way more effort than is worth it for a niche use case
would it be possible to code the seats so all of them work like the diving bell? its kind of hard to make a good looking sub because the bell doesnt really fit anywhere.
no
for what?
Basically V2 of the missile mod, buy it's modular and really easy to add new kind of blocks, even missile unrelated
It sounds super nice
really? you cant just change the value of the seat? i figured it would be as simple as turning up thruster speed
nah
there’s no function to make a seat underwater compatible
unfortunately this is just the modding api, it isnt the same access as just having the unity editor
Nope, we have access only to what the Devs allow and profram,this isn't one of those
ah thats unfortunate. oh well. im hoping they eventually add a better underwater update, it doesn't really make sense how every build automatically gets filled with water
unfortunately water is just a flat plane basically, anything below is underwater and anything above is above water just with waves added in. its really expensive to calculate which areas are airtight, and many other potential issues
even if they just made like a cabin block id be happy with that. like just cubes that were automatically watertight. i get it though its not a huge company
tbh a smaller underwater seat would be neat, any water related stuff is quite large
trying to do something cool but as soon as i get a few meters away from my models, parts of them disappear
the distance changes depending on the players FoV
Do you scale your gameobjects by any chance?
yeah its at 0.75 scale
Mh. As a dirty fix for now you can scale your models very small and resize them in the mod, then culling should happen at a much longer distance.
ah ok, is this something you look forward to fixing in the next update?
Not something planned for next update; I was just by chance looking into LOD culling yesterday with a graphics engineer since we were looking into shaders with transparency.
But I don't think it is handled nicely at the moment.
alright, nice to see you actually invest so much time into reworking the modding api.
Makes me very optimistic for modding in the future
Another technique if you don't want to have tiny models is to add a single polygon to each model that is located several hundred metres away from the rest of the model. This tricks the game into thinking the model is much bigger so it lod's out much further away.
So for something the size of those power poles I'd probably put the poly 300m or so down below.
do note, this will also cause an odd hitbox, but given the shape i'm guessing you are already using convex hitboxes
i think all LOD stuff is also based of FOV
you can notice shadow quality changes and stuff in general when using cinematic cam
Is it possible to make a mod that forces everybody on a server to fpp? Or is there a setting for it?
not possibly directly
but you could theoretically create a custom camera for every player and simulate their 1 person camera by positioning it at their position with the players rotation.
but it is janky and you cant detect mouse movements that should turn the camera
Anyone who can recommend me a Map with A LOT of Custom Meshes?
It is more about amount of objects; they can all be the same mesh, low poly or whatever.
Just needs to be custom meshes specifically.
Ah wait I might actually have made something ages agoooo
If you just need to spawn lots of custom meshes you could use Track Creator Plus Deco Editor and just keep spawning stuff from the Custom objects list 🤷♂️
Might take you longer than just loading a map - I don't know of any off hand though.
I can easily make synthetic test. I would just prefer some practical examples.
yep fair
Antimatter had a map that took like 10 minutes to load for new players, it was exclusively made out of custom objects iirc
Pretty much all race tracks by mikauo use a lot of custom objects (nurburgring, tsukuba and forest)
Suddenly remembered I had made this thing
Give me A.
Couple minutes to get home and I can send you a zip of ironwood. It's entirely made of custom mesh
Mainly cubes tho
Sounds great!!!
Oh might be a good time to ask if you know about tm.physics.ClearAllSpawns() crashing the game if it has to despawn just over 5000 objects?
Can you slam that into #1123915629653667943 as bug report?
Maybe even a test mod? 🙂
Sure can
Probably same reason why spawning them crashes the game. You put too much load in the game->the game takes a long time to process it->the handler for detecting freezes triggers and shows the crash screen
Yep seems so. It also happens just leaving the game or unloading the mod when 5000+ objects are still spawned so it's not really the tm.physics.ClearAllSpawns() function - it's the game.
I've done the staged load and unload in my mod which works but obviously can't do anything about unloading or exiting to main menu/leaving the game.
I should probably send Frans the version without 20,000 tree prefabs
xD
Yes send that - he can use that to test the crash I just explained 🙂
Ight. I haven't fully cleaned up all the trees but it should be clean enough
I know it's over 20,000 because I used a 2000 object sprinkle from sprinkle tool at least 10 times, most likely more
That'd do it
I should really rework that mod, there is a million ways to make it better.
That might be true but you released it right when I needed it so I'm still forever in your debt LOL
I should definently split the sprinkling into multiple update cycles so it doesnt just crash the game as soon as you try to spawn many
yeah def do that. I found limiting spawns to about 3000 per stage works well.
Yeah, that's why I did multiple 2000 object passes
Alr ill see if i can do it today
Anyways. My pc is spun up. Time to package my zip bomb trailmakers map and send it to frans
Cant remember how much of spaghetti the mod actually is
it's easy to make a hook for the spawn functions that makes loading asynchronous almost transparently (assuming you don't need to use the returned references from spawning objects)
if you still need it
this should work
async_spawn.lua:
---@diagnostic disable: duplicate-set-field -- We are intentionally overriding the fields to add hooks
---@type ModApi
local old_tm = tm
---@type ModApi
tm = setmetatable({}, { __index = old_tm })
---@type ModApiPhysics
tm.physics = setmetatable({}, { __index = old_tm.physics })
local queue = {}
local M = {}
local function wrap(f)
return function(...)
table.insert(queue, { api = f, args = {...}})
end
end
tm.physics.SpawnObject = wrap(old_tm.physics.SpawnObject)
tm.physics.DespawnObject = wrap(old_tm.physics.DespawnObject)
tm.physics.SpawnCustomObject = wrap(old_tm.physics.SpawnCustomObject)
tm.physics.SpawnCustomObjectConcave = wrap(old_tm.physics.SpawnCustomObjectConcave)
tm.physics.SpawnCustomObjectRigidbody = wrap(old_tm.physics.SpawnCustomObjectRigidbody)
tm.physics.SpawnBoxTrigger = wrap(old_tm.physics.SpawnBoxTrigger)
function M.update()
for _ = 1, math.min(#queue, 2000) do
local op = table.remove(queue, 1)
op.api(table.unpack(op.args))
end
end
return M
main.lua:
local async_spawn = tm.os.DoFile("async_spawn")
...
function update()
...
async_spawn.update()
end
My map file is perfectly normal
Awesome! I 'hacked' my way to a spaghetti solution but this looks brilliant.
keep in mind the functions no longer return the modobject references, so it only works if you don't need those (which should be fine for common usage). Allowing that would either require changing the api (adding an extra callback parameter) or making a full async runtime for async/await syntax
Ok understood
Be better if the devs could fix it in the way they handle spawning and despawning for mods. That way the game wouldn't also crash when exiting to main, exiting the game or unticking the mod from the list.
Ill probaply try to do it a different way since i would also like to be able to later delete objects that got spawned at a bad spot, and its good to have that visual feedback
Ridicolas & Jess coded a method in the Trailmappers loader which you can have a look at. I've gone a slightly different route that works specifically for my track edge objects. That'll be in my next mod update.
Yeah i think i already have a pretty good idea of what to do
look into the async_spawn.lua's update function and queue, that's basically what you need to do
is there any reason why i shouldnt use just a coroutine with yield() ?
because that seems a lot more simple for my case
Coroutinites are collaborative, so you need to manage them manually. Without an async runtime, they provide no benefit in this case (if you run them instantly when you want to spawn objects, they are still synchronous, and if you run them in the update function you still need a queue and limit how many you run per frame)
yeah that seems very managable for my case, i will just use coroutines
It's essentially the same code in practice
33000 palm fern mediums
makes sense
i had trouble spawning like 5k objects with sprinkle tool at once
let me try 100k
yeah im currently reworking it, im also reworking the UI entirely
lol still at 0%
