#General modding chat

1 messages · Page 10 of 1

topaz arrow
#

solution to that is simple, make the mod crash before it reaches the end 😄

dapper jay
#

why does clearUI also clear the mouse callback?????

radiant lion
#

I'm quite sure it clears none of the other key callbacks

dapper jay
dapper jay
#

only the mouse ones

#

because i assume its internally lumped in with the ui since its in tm.playerUI(why?)

warm canopy
#

Y’know you could use my library

dapper jay
#

which?

warm canopy
#

The UI one

#

But use the zip I gave sebi as that’s latest

dapper jay
#

i dont really need complex ui

radiant lion
#

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

shadow iris
#

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

radiant lion
warm canopy
#

I tend to just opt for 999999

#

I highly doubt someone’s going to be playing for 11 days straight

radiant lion
#

What if... Math.inf

#

So it's sure to behave oddly

dapper jay
#

why is it not parsing correctly lol

radiant lion
#

What format is value in?

warm canopy
#

Watcha making

dapper jay
#

the ui data is from the mouse click

radiant lion
#

Vector accepts strings !?

dapper jay
#

yeah...?

radiant lion
#

That's news to me...

dapper jay
#

it was like

#

a major feature

#

of one of the modding updates

radiant lion
#

Doesn't seem that major to me

dapper jay
#

i feel like that should work

dapper jay
near parcel
radiant lion
#

Possibly stupid

#

But might it be that for some reason negative numbers break it?

#

I'd say try with some custom strings

radiant lion
#

Honestly expected, but still... I was hoping it was as stupid as the Vs code parser with negatives

dapper jay
#

i tried removing the parenthesis but then it just gave me a pattern match error

near parcel
#

try with integers

dapper jay
#

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

radiant lion
#

This one I'm pretty sure was reported

dapper jay
#

my mouse cursor doesnt become invisible now

#

its just pinned at the center

dapper jay
#

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

regal bear
#

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.

shadow iris
dapper jay
#

kinda sus ngl

shadow iris
#

tf is this goofy LOD

#

its probably 2 variants of the same model on top of each other but i cant actually tell

shadow iris
#

ayy thats a new one

shadow iris
#

@scenic echo please (maybe) fix my bad code that i havent tested in game a single time

scenic echo
# shadow iris

Uhhh, maybe test it? Idk what it does or what your tables have stored

shadow iris
#

thats crazy

shadow iris
#

i lvoe luahh

scenic echo
shadow iris
#

pairs give nothing

#

useful i know

#

for my use i use ipairs if i need the index

scenic echo
shadow iris
#

ah i see hwy its throwing erors

shadow iris
#

cause of this

scenic echo
scenic echo
shadow iris
#

blocks contains ModBlocks

#

ModBlocks is not ModBlock

#

thus, ModBlock.GetName() fails

scenic echo
shadow iris
#

this, works

scenic echo
shadow iris
#

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

scenic echo
scenic echo
shadow iris
scenic echo
shadow iris
# scenic echo ... My brain is ... not comprehending

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
shadow iris
shadow iris
#

what i was doing is storing a list of ModBlocks, which contain ModBlock

shadow iris
#

and then trying to run ModBlock functions on a list instead of a ModBlock

shadow iris
near parcel
scenic echo
dapper jay
#

if we have ipairs why dont we have jpairs and kpairs...

radiant lion
#

What about itrios?

dapper jay
#

would that be a composite key to value pair?

radiant lion
#

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

near parcel
#

you can already use tables as keys and pairs will return them (iirc it hashes the table's contents)

dapper jay
#

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

near parcel
dapper jay
#

hmm i see

shadow iris
#

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

shadow iris
#

how is 57.6 fps = 26

wispy crescent
#

POV, you forgot to click the 'static' box

shadow iris
#

i think i made it more messed up

cinder spruce
shadow iris
#

1724ms

#

frametime vs fps is correct

shadow iris
#

ah shit here we go again

#

@median cobalt

#

23.1k frametime 😎

cinder spruce
shadow iris
shadow iris
dapper jay
#

this is fire actually

shadow iris
shadow iris
shadow iris
# shadow iris 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

shadow iris
#

i might have made my server stability mod too good 😭 any moderately complex build triggers structure clears

#

this is still so funny... 3000ms frametime

shadow iris
shadow iris
shadow iris
#

you can still build and get in/out of vehicles i think

shadow iris
#

i think it freaks out bc im modifying physics speed but it DOES prevent crashes

near parcel
#

You are doing something wrong there, because server fps should never go above 60

shadow iris
radiant lion
#

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)

regal bear
#

Nice

near parcel
#

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?

radiant lion
#

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

#

there aren't many failsafes, so mantissa too high and it breaks, data outside of the 81 bits is lost ecc...

shadow iris
cinder spruce
shadow iris
#

how can i get rid of this?

scenic echo
shadow iris
#

it keeps doing logs automatically

scenic echo
shadow iris
near parcel
#

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

radiant lion
#

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)

shadow iris
near parcel
shadow iris
#

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??)

near parcel
#

iirc it's a direction vector

shadow iris
shadow iris
near parcel
#

asumming y is up (don't remember atm), the first rotation there is 45 degrees. In fact, all of them are

near parcel
#

then in all of those cases arctan(z/x) = arctan(1/1) = 45º

radiant lion
#

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

near parcel
#

does the same thing happen with math.log(-31, 2)?

radiant lion
#

no....

near parcel
#

then you are losing precision at some point and not getting exactly -31

radiant lion
#

wait, wdym math.log(-31, 2) that's not a thing

#

i was thinking math.floor(-31)

radiant lion
near parcel
#

if you implement math.pow manually with a for and multiplications, does it still happen?

shadow iris
#

is it possible to DoFile a lua file within folders within data_static

radiant lion
#

yep

shadow iris
#

how

radiant lion
shadow iris
#

like if i wanna load default.lua thats contained in data_static\maps\Treasure Island\

radiant lion
#

other side slashes

shadow iris
#

and i did try \ and it didnt work

radiant lion
#

you said \ in your message

shadow iris
radiant lion
#

ah, it doesn't like spaces, probably

#

try Treasure_Island or with -

near parcel
#

never use spaces in paths. Always replace them with - or _

shadow iris
#

well then ill have it take the space out of name in this

radiant lion
#

just use gsub

near parcel
#

or just use the ID instead of the name

shadow iris
near parcel
#

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

radiant lion
#

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

shadow iris
shadow iris
#

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.

shadow iris
#

@topaz arrow so confusion

#

oh it really hates me putting a all players subtle message there

#

?

topaz arrow
shadow iris
topaz arrow
shadow iris
#

this used to work before i didnt even change it argh

#

oop ic why

#

oh thats not at all worrying
no errors?

shadow iris
#

mod is functionally basically done :D

dapper jay
shadow iris
near parcel
shadow iris
near parcel
#

Again, that's likely caused by your mod as it's never happened without it

shadow iris
#

the mod hardly works now but it worked last night ofc (my fault still)
arghhhh it is such a mess

shadow iris
shadow iris
#

this subtle message disappearing bug is REALLY annoying for this

shadow iris
#

race conditions my beloved

scenic echo
#

Is there a way to know which player entered a trigger?

radiant lion
#

Yeah, pretty sure the function gets called with the id of the player that entered it as argument

scenic echo
#

ohhhh, it gives 0, 1, 2 so you dont need to put .playerId

radiant lion
#

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)

shadow iris
#

also repairing as well

#

ohh its because im setting it to false when its already false

shadow iris
#

whywhywhy

shadow iris
#

tasty. is there anything i can do about this?

shadow iris
dapper jay
#

are you sure your code isnt doing something weird?

shadow iris
#

maybe it is

#

that is it failing to spawn the player correctly i think

#

but it also mentions oneshotsound?

shadow iris
dapper jay
#

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

shadow iris
#

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

dapper jay
shadow iris
dapper jay
#

weird

shadow iris
# dapper jay weird

exactly!
hey also do you know why OnPlayerJoined keeps getting repeated until another player joins?

dapper jay
#

ive never multiplayer tested my mods so no

#

never had it happen in singleplayer either

shadow iris
#

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

dapper jay
#

are these issues also present in singleplayer or only multiplayer?

shadow iris
#

def not my fault

shadow iris
dapper jay
#

now that is really inconvenient

shadow iris
#

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...

dapper jay
shadow iris
#

fuck it im enabling single process, GIVE ME ALL THE ERRORS!!

shadow iris
shadow iris
near parcel
shadow iris
near parcel
#

0,0,0 is probably a default location, probably all objects in the queue go there before being actually moved

dapper jay
#

you should place the check in the update loop instead

#

maybe

near parcel
#

yeah

shadow iris
shadow iris
shadow iris
#

at least its being honest now

radiant lion
#

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)

regal bear
# radiant lion i feel it's related to the other setColor bug, since to fix this one you have to...

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...

▶ Play video
regal bear
shadow iris
regal bear
#

even that chicken

radiant lion
cinder spruce
#

welp CMM is only gonna be available on airborne then

topaz arrow
shadow iris
#

its available on stranded too no? cause of the seagulls

shadow iris
#

once again! ModStructure.Destroy() just deletes the seat!

dapper jay
#

is that a reoccurring issue?

shadow iris
#

it used to work at some point this year iirc

dapper jay
#

how are you getting the structure?

shadow iris
#

replace dispose with destroy

dapper jay
#

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

dapper jay
#

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

paper bone
dapper jay
#

wait theres Dispose and Destroy?

#

why

radiant lion
#

Iirc one plays the animation

#

The other just deletes

shadow iris
paper bone
#

Dispose actually disposes a structure and destroy sets the health of all blocks to 0 iirc

dapper jay
shadow iris
radiant lion
dapper jay
paper bone
radiant lion
regal bear
shadow iris
regal bear
shadow iris
#

should add Destroy() to #1123915629653667943

regal bear
shadow iris
#

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

shadow iris
#

whatd i do wrong this time

formal crane
formal crane
radiant lion
#

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

shadow iris
shadow iris
formal crane
formal crane
shadow iris
shadow iris
#

oh, and, good morning frans 👋

dapper jay
#

i was not spamming

#

no example then!

near parcel
#

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#

formal crane
#

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 🙂

near parcel
#

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

GitHub

An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities. - moonsharp-devs/moonsharp

shadow iris
#

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

shadow iris
#

because i can get the ModStructure?

#

but then i cant

#

idk

#

and this still doesnt work

shadow iris
# shadow iris

i "solved" this by comparing the block counts instead of the structure

serene magnet
#

For maps like Ironwood I've split my terrain into at least 50 pieces to save on load time and triangle limits

shadow iris
#

for an ocean map it could maybe work if there aren't many steep slopes

serene magnet
#

Oh, as a reference that works fine LOL. If you were using it as actual terrain I would definitely have suggested splitting it

shadow iris
serene magnet
#

Very true

shadow iris
#

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

shadow iris
topaz arrow
shadow iris
formal crane
#

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.

radiant lion
#

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

scenic echo
formal crane
#

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.

formal crane
#

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 😄

cinder spruce
formal crane
#

oh god... up/down transform missing from ModBlock DoggoScream

cinder spruce
#

wait wasn't that a problem when biwi was trying to modify CMM to work with different blocks, and those directions just didnt exist.

topaz arrow
cinder spruce
formal crane
radiant lion
#

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)

formal crane
#

Anything input is terrible to my knowledge :p

cinder spruce
#

yeah im pretty sure tm has a really weirdly built input system not well made to work with
like anything else

radiant lion
topaz arrow
cinder spruce
#

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

cinder spruce
radiant lion
topaz arrow
formal crane
cinder spruce
radiant lion
#

i am not gonna ask for raycast to return the modGameObject they hit... i know i'll abuse that

formal crane
cinder spruce
radiant lion
#

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)

regal bear
regal bear
regal bear
dusk finch
shadow iris
#

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

shadow iris
shadow iris
radiant lion
shadow iris
radiant lion
shadow iris
#

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

radiant lion
shadow iris
#

ok the water/infinite floor its actually fine cause we can set position i hope

radiant lion
#

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

shadow iris
#

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

shadow iris
shadow iris
#

sets vertical scale of water

#

new intense wave setting invented

formal crane
shadow iris
radiant lion
#

Should I not have mentioned it... thinking_guy_tm

formal crane
#

It will be SO broken hahahah

shadow iris
#

i want custom maps man

#

the campaigns i could make

#

113hr past 2 weeks straight into mapping, it would be so good

radiant lion
#

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...

formal crane
#

In general it is also OK. But from experience it will result in ton of confusion and absolutely weird behaviour

shadow iris
#

mfw i accidentally hit the menus gameobject and everybody cant escape

formal crane
#

Anyway, fun fun :=)

radiant lion
#

It is probably the most cursed thing that could come to TM modding

shadow iris
radiant lion
#

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

paper bone
#

Having the ability to load textures and meshes from datadynamic would be nice

near parcel
#

unity's dynamic asset creation APIs would be a far better solution

paper bone
cinder spruce
near parcel
#

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)

formal crane
radiant lion
#

Right, sometimes I forget about the whole multiplayer thing, I bet it's not as simple as setting the gameObject parenting for the host

formal crane
#

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.

radiant lion
#

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

near parcel
radiant lion
#

I intended it just as "people joining after things have been done"

paper bone
# near parcel

Sometimes i forget alva is human,
then he posts something like this out of nowhere xD

shadow iris
# near parcel

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

near parcel
#

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

novel maple
dusk finch
# near parcel

just simply don't let people join, my genius new solo multiplayer idea

shadow iris
novel maple
#

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

radiant lion
#

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

cinder spruce
#

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

cinder spruce
regal bear
# shadow iris *how* though

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.

dapper jay
#

yeah just select each of the 4 quadrants and separate by selection

radiant lion
#

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

formal crane
topaz arrow
near parcel
#

It's not possible because the camera is on the client but mods are run only in the server

topaz arrow
#

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)

near parcel
#

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

radiant lion
#

I'm also decently sure the cameras for each mod are separate

topaz arrow
#

Oh god

#

That sounds even more chaotic

near parcel
#

multiple mods trying to control the camera at the same time will always be chaotic, regardless of how it works

formal crane
topaz arrow
# formal crane What would the exact use case be for this? EDIT: what problem are you trying to...

I cant think of many specifics roght now, but at least 2 come into my mind:

  1. 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
  2. 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
near parcel
#
  1. if the camera moves due to something client side, the server is not aware of it
  2. 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
topaz arrow
# near parcel 1. if the camera moves due to something client side, the server is not aware of ...

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

near parcel
# topaz arrow What can move the camera that is client side? I thought mods are server side and...
  1. 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
  2. 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
topaz arrow
# near parcel 1. I'm assuming there is something (or you want it to work with normal cameras),...
  1. 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

  2. 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

near parcel
#
  1. 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
  2. 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
radiant lion
# topaz arrow I cant think of many specifics roght now, but at least 2 come into my mind: 1) b...

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

native hatch
#

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)

radiant lion
native hatch
#

are you talking of superprop?

radiant lion
#

Superprop?

native hatch
#

but am not "modifying" the DLL, am adding a new one (I think)

native hatch
radiant lion
#

Did not hear of that, so no

native hatch
#

whatever then

radiant lion
#

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

native hatch
#

ye, and am pretty sure modifying existing DLL are against the EULA

radiant lion
#

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

warm canopy
#

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.

native hatch
#

as am saying, am not trying to modify a DLL, just add one

radiant lion
#

I'd say try first to get bepinex to work

native hatch
#

sure

near parcel
near parcel
near parcel
radiant lion
#

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

near parcel
#

even if you want to go with that technicality, the EULA doesn't just forbid DLL modification

native hatch
#

but then no mods are alloued

#

like the old map maker used to be a 3rd party tool

near parcel
#

mods using the lua API are explicitly allowed

native hatch
#

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)

cinder spruce
native hatch
#

thats right

#

but why is this then?

near parcel
#

that's just a code editor, you could use notepad if you hated yourself enough

cinder spruce
#

vs code doesn't modify the game at all,
its literally just an IDE

native hatch
#

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)

cinder spruce
#

logs do show up in the mod folder which usually tells you what went wrong

shadow iris
cinder spruce
#

pranking 0.1% of the playerbase

shadow iris
#

also are you available rn to test demolition derby

radiant lion
regal bear
topaz arrow
formal crane
#

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

paper bone
#

RegisterKeyCallbacks would activate even when chat is open, but that isnt really an issue

radiant lion
#

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

paper bone
#

Frans dont start the modding thing before im back from vacation ||pls||

formal crane
#

Dont worry it is not planned at all 😆
I just pitched something to Johannes some time ago. Not sure when we could do it.

shadow iris
#

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
cinder spruce
near parcel
regal bear
dapper jay
#

does anyone have any cool mod ideas?

paper bone
#

Make a working camera that outputs a black/white pictures based on distance using raycasts. Export said picture in png format

#

@dapper jay

dapper jay
#

hmm a depth buffer camera

#

can we even make pngs?

paper bone
#

I dont see why we wouldnt be able to

#

Oh actually yeah it might not be possible

dapper jay
paper bone
#

well thats for you to find out

paper bone
#

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

near parcel
# paper bone Oh actually yeah it might not be possible

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
dapper jay
#

i watched a video on how png compression works not too long ago and im definitely not touching that stuff

paper bone
#

xD feel free to pick any other image format

near parcel
#

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

paper bone
#

@dapper jay ||forgot to ping again||

#

Could also be fun to make logic creations that try to solve these mazes

dapper jay
#

hmm intereating

#

could make it so it uses trailmappers maps for each room

#

randomly generated trailmaker master trial

scenic echo
paper bone
#

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

radiant lion
#

That could be a start

paper bone
#

I havent even touched lua since then

radiant lion
#

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

dapper jay
shadow iris
#

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

#

🔥

scenic echo
shadow iris
radiant lion
#

I do have a car chaser ai

scenic echo
shadow iris
scenic echo
shadow iris
#

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

scenic echo
#

nice

shadow iris
#

so for maps like gcf

#

in the current system id have to decide between ground, air, or water combat

scenic echo
shadow iris
#

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

native hatch
native hatch
#

mabe, I'll have to ask Whemplar what mod he was using

scenic echo
native hatch
#

I'll have to try it out again then

paper bone
shadow iris
#

disposing a structure when it has a looping sound playing (e.g. a siren) causes that sound to never stop

shadow iris
radiant lion
#

Where's the fun in that?

shadow iris
#

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.

ionic jacinth
#

I have released a mod called: "glider's toolbox"
Try it out if you like gliders.

regal bear
formal crane
#

It is currently 90 new ones (Not all have passed QA, so list may shorten) at the moment.

radiant lion
#

I'm starting to think a trailmapper-like mod would be quite nice... Should be doable with raycast gameobjects

radiant lion
#

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)

cinder spruce
#

overlay UI is kinda impossible also

paper bone
#

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

radiant lion
#

Hmm, can we get cursor screen position

#

Aa in pixel?

paper bone
ionic jacinth
#

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.

formal crane
#

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.

near parcel
#

@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

radiant lion
thorny sparrow
#

Oh heck yes. chirpowow

formal crane
#

c u r v e d

paper bone
#

||lame i can generate that inside the game already ChirpoSmirk ||

#

Jk new assets are very much appreciated

thorny sparrow
#

Yes, they're big boys.

near parcel
#

@radiant lion do you remember the mess you had to do to convert floats to binary? about that...

radiant lion
#

welp...

#

wait,no, i'm confused

near parcel
#

bit32 is a non-standard but commonly available module for bitwise operations, seems to be supported in moonsharp

radiant lion
#

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

near parcel
#

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

radiant lion
#

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)

thorny sparrow
#

Pioneers fence and a wooden crate from a cut merchant iirc 👀

paper bone
#

Will there be any way that mods can benefit from the terrain rework in the next update?

vernal cedar
#

No built in mod manager?

near parcel
#

there is NaniCat

paper bone
topaz arrow
#

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

cinder spruce
radiant lion
#

we need some new apparent messages

#

just straight up the race start font

cinder spruce
cinder spruce
radiant lion
#

as Einstein once said: "give me access to a big enough text box and html, and i can mod the world"

warm canopy
#

Frans is just one man, he’s having to play catch-up

radiant lion
warm canopy
#

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

radiant lion
#

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

warm canopy
#

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

radiant lion
#

Making mods p2w

warm canopy
#

I accept payment in gift cards

cinder spruce
warm canopy
#

Instead they do it with the bedrock version

radiant lion
#

They get a cut there

#

Totally different

near parcel
#

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

cinder spruce
cinder spruce
cinder spruce
paper bone
#

If only Trailmakers mods were written in Dreamberd

paper bone
#

@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

warm canopy
#

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

dapper jay
warm canopy
#

A plane following a path

#

Got bank angle aswell

paper bone
#

Now make them be able to landWideJamie1

warm canopy
#

Such an odd feeling being in the plane whilst it flies itself

warm canopy
#

Some sort of combination of code needing optimised and the joys of test branch

topaz arrow
warm canopy
#

Its using forces for propulsion and torque for steering

paper bone
#

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?

formal crane
paper bone
#

tldr spam ping frans if you want a certain feature.
Dont

formal crane
warm canopy
paper bone
#

Nice

warm canopy
#

I never want to make a pid ever again

radiant lion
#

I heard it's easier once you Laplace transform

serene magnet
scenic echo
#

@shadow iris how did you teleport people in the demolition derby mod?

#

i wonder why it had the spawn bug

radiant lion
#

There is also GetPlayerTransform(Id).SetPosition(pos)
To tp players

#

No, but there was no mention of structures

scenic echo
#

i wonder if only tm.players.TeleportPlayerToSpawnPoint(playerId, spawnPointId, keepStructure) with keepStructure = true does the spawn bug thing

scenic echo
radiant lion
#

Nope, you have to first destroy it

scenic echo
#

can you copy a players structure and then spawn it somewhere else?

radiant lion
paper bone
#

Would be awesome if we could save a players blueprint to data dynamic

#

Just dont upload the mod to the workshop, problem fixed

scenic echo
#

someone makes the blueprint stealer 3000 and steals all the blueprints

paper bone
#

Distributing the mod yourself be like:

near parcel
cinder spruce
#

why can't people just always be responsible with tools 😞

paper bone
#

@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

formal crane
paper bone
#

A month?

near parcel
#

if it's a month away, there is likely no date set in stone yet

paper bone
#

Can we expect it before gtaVI?

warm canopy
#

You can expect the end of the world before gta 6

paper bone
regal bear
median cobalt
#

-# 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.

formal crane
#

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?

paper bone
#

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

formal crane
#

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 💔

paper bone
#

Lemme check if i have the mod uploaded to github

regal bear
warm canopy
#

Theirs an issue where the wheels physically clip on joints between meshes

#

But I guess frans means the visual

regal bear
#

Yep I'm just not sure which glitch he means

formal crane
#

Sorry, it is the visual one!

regal bear
formal crane
regal bear
#

Happens in a few different places on my custom curved asphalt areas

formal crane
#

goofy, thanks. I'll see if I can figure it out!

regal bear
formal crane
#

Been trying my very best but i cannot replicate it DoggoScream
Only specific wheels? Could you send me your blueprint?

#

NEVERMIDN GOT IT

paper bone
#

@sturdy iris hows it going?

sturdy iris
paper bone
#

lol how did you manage that

paper bone
#

@formal crane Will there be any way that mods can benefit from the terrain rework in the next update?

paper bone
#

Aw

topaz arrow
ionic jacinth
#

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 🪰 😉 )

formal crane
formal crane
# formal crane NEVERMIDN GOT IT

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.

warm canopy
#

What was the cause?

regal bear
#

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

dapper jay
#

i assume it was a gameobject layer thing

#

although then it probably wouldve been consistent and not this weird "sometimes works sometimes doesnt" thing

formal crane
#

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 DoggoScream

cinder spruce
#

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

formal crane
#

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

warm canopy
#

Might also fix repairing on custom maps?

formal crane
#

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)

dapper jay
dapper jay
#

awesome then

regal bear
near parcel
#

it would make sense for those to be caused by the same problem, in which case it would be fixed

formal crane
regal bear
#

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)

formal crane
regal bear
formal crane
#

🫡

dapper jay
#

yippie

formal crane
#

The bug reporting you all have been doing have been SO helpful, so thanks to everyone who has helped with that!
Keep em coming ❤️

regal bear
#

Got room for shroom?
🍄 Melvin

formal crane
#

Just sharing here in case people want to voice their thoughts.
#1126532532339478568 message

wispy crescent
#

Is the wind prefab completely deprecated?

ionic jacinth
# wispy crescent 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...)||

wispy crescent
#

I was asks spawning it through Mappers no longer works, I wasn’t sure if it was removed or something else had broken

regal bear
#

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?

wispy crescent
#

Ah ok, Jean I was in TZ so that explains that

paper bone
#

@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

near parcel
#

you can achieve the same thing with closures, but you need to generate unique function names for each

paper bone
#

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

near parcel
#

#1134472573380468848 message

paper bone
#

interesting, will certainly use that for now but my suggestion/question still stands :P

formal crane
# paper bone <@904666716032868364> is there any particular reason why the > tm.physics.Regis...

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.

near parcel
#

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

formal crane
#

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.

near parcel
#

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)

formal crane
#

Never got on the functional programming train unfortunately. Maybe I should consider it for next Advent of Code 🎄

regal bear
cinder spruce
haughty edge
#

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

radiant lion
#

Should be doable, yeah

haughty edge
radiant lion
haughty edge
radiant lion
#

do note it leaves you EXACTLY on the seat, so you better not have much stuff above it (like 3 blocks at most)

haughty edge
haughty edge
near parcel
#

If you really have issues with the latest version, #bug-reports exists. We are not gonna help you with pirated versions.

tawny jetty
#

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

paper bone
#

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

radiant lion
tawny jetty
#

well I dont think it would change anything besides me not playing on a pirated version

paper bone
#

Well thats a pretty big change to us

radiant lion
#

it would make multiplayer work... but that's not much if noone plays that version

paper bone
#

Would mean that there is no reason to delete these messages

tawny jetty
#

wait it would make multiplayer work..?

radiant lion
#

quite sure, yeah

scenic echo
radiant lion
#

but you can only play with players on the same version

tawny jetty
#

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

radiant lion
#

anyone remembers if there is a prefab that does a decent white light? none come to mind

paper bone
#

Not that i know

radiant lion
#

bummer, i guess the guide pages will be dark at night

paper bone
#

I mean frans has talked about emission maps in #1126532532339478568 so maybe those guide pages dont need to be dark for long

formal crane
#

Also I dont know if our current emission shader actually casts to other objects.

radiant lion
#

time to make the guide emissive :p

formal crane
radiant lion
#

meanwhile, the mod skeleton is about done (removed for reasons)

formal crane
#

damn it really was flashbang

radiant lion
#

and it's not emissive yet

#

on another note... i'm thinking again about communication between mods

near parcel
#

why?

radiant lion
#

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

near parcel
#

it would make more sense to make the "DLC" just be files added to the data_static/data_dynamic folder

radiant lion
#

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)

paper bone
warm canopy
#

Fkey to pay respects to my mod folder..

near parcel
haughty edge
#

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.

near parcel
#

no

radiant lion
#

Basically V2 of the missile mod, buy it's modular and really easy to add new kind of blocks, even missile unrelated

haughty edge
# near parcel no

really? you cant just change the value of the seat? i figured it would be as simple as turning up thruster speed

cinder spruce
radiant lion
#

Nope, we have access only to what the Devs allow and profram,this isn't one of those

haughty edge
#

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

cinder spruce
haughty edge
radiant lion
#

tbh a smaller underwater seat would be neat, any water related stuff is quite large

paper bone
#

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

formal crane
paper bone
#

yeah its at 0.75 scale

formal crane
#

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.

paper bone
#

ah ok, is this something you look forward to fixing in the next update?

formal crane
#

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.

paper bone
#

alright, nice to see you actually invest so much time into reworking the modding api.
Makes me very optimistic for modding in the future

regal bear
paper bone
#

ok

#

thanks

regal bear
#

So for something the size of those power poles I'd probably put the poly 300m or so down below.

radiant lion
#

do note, this will also cause an odd hitbox, but given the shape i'm guessing you are already using convex hitboxes

cinder spruce
uncut sinew
#

Is it possible to make a mod that forces everybody on a server to fpp? Or is there a setting for it?

paper bone
#

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

formal crane
#

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.

paper bone
#

@serene magnet

#

Sounds like a job for you

formal crane
#

Ah wait I might actually have made something ages agoooo

regal bear
#

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.

formal crane
#

I can easily make synthetic test. I would just prefer some practical examples.

regal bear
#

yep fair

paper bone
#

Antimatter had a map that took like 10 minutes to load for new players, it was exclusively made out of custom objects iirc

radiant lion
#

Pretty much all race tracks by mikauo use a lot of custom objects (nurburgring, tsukuba and forest)

formal crane
#

Suddenly remembered I had made this thing

serene magnet
radiant lion
#

Mainly cubes tho

regal bear
# formal crane 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?

formal crane
regal bear
#

Sure can

near parcel
regal bear
#

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.

serene magnet
#

I should probably send Frans the version without 20,000 tree prefabs

paper bone
#

xD

regal bear
serene magnet
#

I know it's over 20,000 because I used a 2000 object sprinkle from sprinkle tool at least 10 times, most likely more

regal bear
#

That'd do it

paper bone
serene magnet
paper bone
#

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

regal bear
#

yeah def do that. I found limiting spawns to about 3000 per stage works well.

serene magnet
#

Yeah, that's why I did multiple 2000 object passes

paper bone
#

Alr ill see if i can do it today

serene magnet
#

Anyways. My pc is spun up. Time to package my zip bomb trailmakers map and send it to frans

paper bone
near parcel
#

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)

near parcel
# near parcel it's easy to make a hook for the spawn functions that makes loading asynchronous...

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
serene magnet
#

My map file is perfectly normal

regal bear
near parcel
#

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

regal bear
#

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.

paper bone
regal bear
paper bone
#

Yeah i think i already have a pretty good idea of what to do

near parcel
paper bone
near parcel
#

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)

paper bone
#

yeah that seems very managable for my case, i will just use coroutines

near parcel
#

It's essentially the same code in practice

paper bone
#

33000 palm fern mediums

cinder spruce
#

spawned at once?

paper bone
#

spawned at the press of one button

#

spread across multiple game ticks

cinder spruce
#

makes sense
i had trouble spawning like 5k objects with sprinkle tool at once

paper bone
#

let me try 100k

paper bone
paper bone