#General modding chat

1 messages · Page 2 of 1

dapper jay
#

trailmakers girlfriend mod when

median cobalt
#

Airborne parts were updated, reuploading list

#

Accurate and includes Airborne DLC Blocks now

#

thanks to @volvobomb aka VVB for quickly hopping into a multiplayer server to get all the block info

dry sentinel
median cobalt
#

Soo i looked at some of the forums related to the smoothness of cameras not existing

#

Why is that? Does a smoothed vector not cause correct movement or

#

Is it due to the current way it gets synchronized to players

dry sentinel
#

Whatever it is, it definitely needs to get fixed 🪦 my spectator camera is brutal without preset positioning of the camera, and speed adjustments

near parcel
#

it's because you can only set its position/rotation, which changes it instantly without interpolation due to the camera not being a physics object

blissful jolt
#

Just lower your graphics

median cobalt
median cobalt
#

Also for the lagging behind you could just

#

Add velocity to position a bit

#

Like source's cl_interp and cl_predict

median cobalt
#

rq what does this return
tm.UICallbackData

near parcel
#

Nothing

near parcel
dapper jay
#

why not

formal crane
#

You cannot do client-side code, so you cannot make sure that the camera position is interpolated according the the client pc's framerate -- it will always be serverside, and then ending up being somewhat choppy as it will always be teleported on the client-side.

We haven't had the time to investigate this problem yet, but I agree that this is not ideal!

median cobalt
near parcel
#

it doesn't, it's just an artifact of how the official documentation file is (incorrectly) formatted

#

that line should just be local UICallbackData = {}. You don't get it by accessing the tm global table, you get objects of that class as the argument in UI callback functions

median cobalt
# near parcel Because you can't

also curious why that is impossible, when you could initialize the camera and at the same time send the vector information to a stored value

median cobalt
#

i have no idea how often camera updates are sent to the client though

#

at most

near parcel
#

at best you can get 60fps movement, but that won't be syncronized with the client (even if that client is also at 60fps). If the client is running at more than 60fps, you see the sudden changes as the position/rotation updates without interpolation

median cobalt
#

h

#

how large is the lag

#

is it corresponding to the actual latency from sv to cl or

#

even larger

#

there might be a way to work around latencies if one had access to server to client latency

near parcel
#

again, that's not your only issue.

median cobalt
#

what else should i consider then

near parcel
#

at best you can get 60fps movement, but that won't be syncronized with the client (even if that client is also at 60fps). If the client is running at more than 60fps, you see the sudden changes as the position/rotation updates without interpolation

median cobalt
#

if the client runs more than 60fps the interpolated information shouldnt be that choppy unless having to interpolate two far vectors

#

i do know that this might be an issue for the freecam workover

#

as if you get too fast youll definetly just lag alot

#

maybe ill pause dev on that one until modding updates

#

also i hope we get text alignment flags

#

PLS

formal crane
#

#1123915629653667943 please ❤️

make some request, so we can create proper discussion and keep track of them and collaborate with you all on it

median cobalt
#

oh

#

oh neat

formal crane
#

it is a good way for us to prioritise features as well, as we can both see how much people want them and discuss implementations and designs of them

near parcel
formal crane
median cobalt
#

thank you

median cobalt
near parcel
#

again, you can't do interpolation currently, in any way. You don't have access to the client's fps

formal crane
#

unfortunantly, you might 1 frame get a position from the server that is let us say 20ms behind and then you experience some random lag and then you get the next position and maybe thats 60ms behind.

it is impossible to counter this

median cobalt
#

ohhh so we have actual tick lag

#

i thought it was just ordinary latency

formal crane
#

i was mainly talking network latency

median cobalt
#

so all ticks are uneven in that case

formal crane
#

I don't remember if the mod updates run in fixedUpdate or engine update.

near parcel
#

it's not only latency. The duration of 1 tick in the client and server aren't necessarily the same either, and in the rare case in which they are the ticks aren't necessarily synchronised

median cobalt
#

im guessing this would not work as intended then

#

(wanted to add angle but already realized what the forums said so i didnt want to try more)

near parcel
#

no, because that interpolates server side. The client will still see choppy movement because the amount of interpolated positions won't match the amount of frames in the client for the duration of the movement

median cobalt
#

aight well, knowing the current state of modding altogether i think were asking too much of the current features anyways

#

it isnt as extensively modifiable as the lua im used to

open acorn
#

movement has been disabled

open acorn
#

attempting to move objects around player

#

4th crash of the day HappyCat

open acorn
median cobalt
#

when adding meshes, how accurate is the hitbox applied to it

median cobalt
near parcel
#

except that only works in singleplayer, in multiplayer attempting to do that quickly becomes a mess

median cobalt
#

what function should i use when i want to spawn in a static mesh?

dapper jay
#

either the normal or concave one

median cobalt
#

I just found out the tri limit is not per mesh but global ChirpoStatue

#

I guess no building of actual full on maps

#

Does that also apply to prefabs.. Or

dapper jay
median cobalt
#

Apparently

#

Go over it , softcrash

#

Not even 30k tris

#

I tried to load a whole 330k but it didnt even load chunk 1

dapper jay
#

damn that sucks

#

meanwhile some sm modders be making a 30k tris model for a 3x3x3 block 💀

#

almost 40k actually

open acorn
open acorn
# median cobalt Not even 30k tris

😕 I have always found it to be per mesh, all of my meshes in total for a mod I've been making (space expansion) have a tri count of 52,195

warm canopy
#

The games built-in mesh importer sucks, I’ve said this before, No offence to the devs.

median cobalt
#

yea i tried to make a high detail map

#

dont work out too well

#

a 5km² map with 330k just for the base ground seemed too large

open acorn
median cobalt
#

why so many triangles? because i prefer to not have polygon hitboxes which span 400 metres between vertecies

open acorn
#

this (a text gui being added with a directory that doesn't exist as it's default value) will "lock" the game until you reopen the world, disabling the mod does nothing, might post this in #bug-reports later or maybe it's because it's a directory to a non-existing workshop item be dead, assumption!

dry sentinel
#

I know if you use a string that’s longer than some predetermined limit for UIText, the game crashes

dry sentinel
#

I’m running on wine, so that might cause the crash

#

I’ll give it a check tomorrow though, might be a whole different bug you’ve found

near parcel
open acorn
honest mauve
#

is there a mod for unlimited complextiy

near parcel
#

Yes, but the limit exists for a reason

open acorn
#

velocity vector arrow

regal bear
swift escarp
open acorn
swift escarp
#

Yay

open acorn
#

2 of the same prefab in the spawnables list

open acorn
open acorn
dusty umbra
#

u wut m8

pliant bluff
#

Mod

dapper jay
#

modom

pliant bluff
#

Modomod

open acorn
#

I thought there were 4 skeletons, but they're just duplicates of the previous ones

shy sand
open acorn
shy sand
#

screen flash(optional) and just delete/explode

#

sorry for late reply

open acorn
# shy sand *screen flash(optional) and just delete/explode*

just delete them?

  if player.playerId == 0 then
    tm.playerUI.AddUIButton(player.playerId, "deletebutton", "'nuke' builds", DeleteButton, nil)
  end
end

function DeleteButton(playerId)
  for i, player in pairs(tm.players.CurrentPlayers()) do
    if playerId ~= player.playerId then
      for j, structure in pairs(tm.players.GetPlayerStructures(player.playerId))
        structure.Dispose()
      end
    end
  end
end

tm.players.OnPlayerJoined.add(onPlayerJoined)```
shy sand
#

(the builds)

#

but that would be funny

open acorn
shy sand
#

oh ok

#

im not smart in coding

#

thats great then :3

open acorn
shy sand
#

if you do make this, seperate button pls

#

XD

#

@open acorn is the mod easy to make?

#

or no?

#

just wondering?

open acorn
# shy sand <@827682206990204970> is the mod easy to make?

go to your trailmakers installation folder, then the folder inside called mods (or go ingame, go to session settings, and click on open mod folder) then make a new folder (with the name of your mod) then inside that folder create a text file, and if extensions is not enabled, enable that, then call it "main.lua" then paste in the code above (that is the script, the code is just an example for a script to acheive the desired effect)

shy sand
#

oh ok

#

have you tested the mod?

open acorn
shy sand
#

would you be able to test it?

#

or are you just going to upload it?

open acorn
shy sand
#

sure lol

warm canopy
#

You know my server utilities has a delete structures button

median cobalt
#

this is gonna be a far fetch on how i imagine mods to be but

#

the peak moment for trailmakers modding would be a real full on large map with a capture-territory gamemode in which creations use up a fictive resource dependant on their complexity and can be spawned only on terminals on buildings owned by the territory

#

the amount of things lua modding can do is insane and i hope we can get to this kind of stuff

#

even tho thats very far fetched for now

near parcel
#

all of that it's already possible in some way

median cobalt
#

well i still have to figure out why the models didnt want to load in

#

wait-- do models crash when theyre only pure planes

#

maybe that was part of the issue

formal crane
#

You only have to add a mesh a once of the duration of the server life. Then the server will automatically ensure to upload that to the other clients as they join.

Ensure you key them uniquely. Otherwise things will break as you try to add a mesh under the same key as another resource. I believe textures & meshes share same resource key names, so also be careful there.

cold knoll
#

What are the prefab names for The logic-related sensors (Distance sensor, Angle Sensor, Speed sensor, Angle sensor, Compass)?

dry sentinel
#

I don’t think we have prefabs for the blocks (though I wish we did)

cold knoll
#

I want the names, so I can modify their behavior (analog sensor mod)

regal bear
open acorn
open acorn
open acorn
# regal bear Prefabs don't include any of the build blocks. As far as I'm aware mods can't in...

🤔 might try to make this (saved in 2 separate parts, and modded blocks can only interact with other modded blocks and the seat (and the structure itself) (simple enable and disable keybinds if connected or not), though it'll need a new build system LaughingDog)

but for this I need to figure out a way to convert local co-ordinates to global around a rotation and back (I have basically everything I need for the rest of it in separate mods)

don't say this is impossible, as I've simplified it to a degree that should be possible

open acorn
#

very fast torpedo CredeScared

#

hmm, custom objects are magnetic

open acorn
#

tm.input.DeregisterFunctionToKeyDownCallback(playerId, functionName, playerId)
and tm.input.DeregisterFunctionToKeyUpCallback(playerId, functionName, playerId) where?
or is there some other way to deregister a key to a... nvm I just realised I could check if a value was true in the function LaughingDog

near parcel
#

You can also replace the function with an empty one, since you just pass the function name as parameter rather than the function itself

radiant lion
#

Iirc it will just call both in that case

near parcel
#

it shouldn't, since there can't be 2 different global objects with the same name

median cobalt
formal crane
#

@median cobalt @radiant lion and I were testing it out some time ago (#modding-archive message) where we were writing procedural OBJs to the dynamic folder data and then loading again at runtime - it was just plain quads with no thickness pretty much.

I see in the mentioned posts that normals were required, do you have them? I believe you also had to define the UVs as well, but can't remember right now.

Otherwise, maybe try and post a sample OBJ + code, then we can look a little deeper. Otherwise it is a little hard to know where the issue might be.

median cobalt
#

When microsoft lets me back in ill get to it

cold knoll
dusky dagger
#

What does mod directory mean when uploading a mod?

shadow iris
#

folder directory should include the folder where main.lua is stored as well

dusky dagger
#

i put in the folder name and its still not wokring

#

o i got it nvm

#

thx

radiant lion
#

(as well as the option to make 3d object out of triangles directly, would skip the annoyingly long loading times)

near parcel
#

good luck writting a png/jpg encoder, it would be far better to just have APIs to create simple textures/objects (solid colors/gradients/geometric shapes/etc) at run time

radiant lion
#

wasn't thinking about making encoders, just procedurally generated textures, for that we can use the API we have rn

near parcel
#

you can only load png/jpg files as textures, so whatever texture you generate at run time currently will have to be encoded as a png/jpg to be able to load it (unless you use a completely separate program to procedurally generate all the textures, in which case it's the same as any other texture)

dusky dagger
#

my trailmapers map eddit isnt loading, any idea why?

dusky dagger
radiant lion
near parcel
#

that would require a new API to create the objects at run time, which was my point, although i didn't know unity supported setting the pixels one by one (which was why i suggested simple things that can be created with a few simple parameters and maths, since that's usually supported)

radiant lion
#

Been a while since I used unity, but I remember using it to make a transparency gradient by setting each pixel, lemme see if I can find it back

radiant lion
#

yep, can find the resulting textures (one of them, where the alpha gets increased by 1 for each pixel) unfortunately i must have deleted the cs script (what a moron)

#

found it, this is it if you are interested

    public void MakeTexture()
    {
        Texture2D tex = new Texture2D(3, 256 * 2 - 1);
        Color color = new Color(0, 0, 0, 0);
        for (int i = 0; i < tex.width; i++)
        {
            for (int l = 0; l < tex.height; l++)
            {
                float New;
                if (l < 256)
                {
                    New = l / 255f;
                }
                else
                {
                    New = (tex.height - l) / 255f;
                }
                color.a = New;
                tex.SetPixel(i, l, color);

            }

        }
        byte[] Png = tex.EncodeToPNG();
        File.WriteAllBytes(Application.dataPath + "/Image2" + ".png", Png);
    }```
open acorn
open acorn
#

why does rotation opposite except Y? probably another weird thing with euler angles, though it won't work correctly with quaternion either, maybe I'm also doing that wrong 🤷‍♂️

dry sentinel
#

Interested to see where this goes.. I’ve been thinking of trying custom blocks for a while, so it’s nice to see someone actually give it a good shot

open acorn
open acorn
#

ok it now better

near parcel
open acorn
#

ModBlock has same rotation returned by GetRotation as it did outside of build mode, should probably get fixed, but not that annoying of a bug

radiant lion
#

We already talked about this, use .forward

#

And .right

#

I can share the code to get the Euler angled given those vectors if you need

open acorn
radiant lion
#

Btw I think it's right, I know we only have access to 4 of the direction vectors, just not sure if the vertical or the left-right axis

#

Still, you can get the last one with a cross product, so not a big issue

radiant lion
#

could someone confirm me this is the current version?

#

i can't find any multiplayer servers

#

verifying file integrity brought nothing

near parcel
#

it is the current one

radiant lion
#

any guess why no servers then?

near parcel
#

i can see 9 pages of servers in the server list in that version

radiant lion
#

any guesses?

near parcel
#

you are on the development backend, remove any launch parameters from steam

radiant lion
#

oh, makes sense

dapper jay
#

is there like a -dev launch param?

near parcel
#

yes, but it only makes sense to use it if you are either a dev or playing on a closed beta and you are requested to use it

open acorn
#

melvin rotate like this in build mode (incorrectly) and melvin rotate like this outside of build mode (correctly), I am using .forward and .right and a cross product into euler angles then into a quaternion for rotation, and outside build I'm just using the structure and block rotation added together because I know it works, what could be the issue then?

open acorn
#

how do I get if a reference to a ModBlock isn't set to an instance of an object? checking if it's nil does nothing (it's never nil) and checking if one of it's values (eg. GetPosition()) is nil doesn't work either (error waterfall), neither does checking if it's type isn't userdata (it's always userdata)

I need to get if it is not set to an instance so I can correctly remove blocks from structures that don't exist or make their rigidbodies non-static

near parcel
#

You can try .Exists(), but i don't think there is a good way to know other than catching the error

cold knoll
near parcel
#

yeah, if you pass a vector3 to the API quaternion constructor it automatically converts euler angles, which is most likely what they are doing

open acorn
#

some sort of build mode thing started (just position, select and add for now)
(although everything is relative to the first block of a structure)

open acorn
#

I ❤️ the differences between build mode and outside build mode with positions, rotations, ect.

near parcel
#

that's probably because outside of build mode you are getting the position/rotation of the weld group the blocks are in rather than of the specific block

open acorn
#

I might just have to make a new builder for custom blocks, probably won't have as many problems that way

near parcel
#

you will, because there is no good way to do them currently. Many things simply can't be done

dapper jay
#

this is dumb

radiant lion
open acorn
open acorn
#

quaternion math is funny

radiant lion
#

Truer words were never spoken

dapper jay
#

❤️

open acorn
#

.Exists() just happened to stop working (always returning true now)

open acorn
near parcel
# open acorn quaternion math is funny

You just need to think of a quaternion as a rotation from a given starting rotation to a new one, and quaternion multiplication as composition (performed right to left iirc)

shy sand
#

how does the custom missiles mod work?

#

just wanted to test it out, but idk how to use it

#

oh nvm

#

in dumb

paper bone
#

why does this only set the time once but log the message every tick?

warm canopy
#

Because update runs every frame

#

It’s also setting the time every frame

paper bone
#

but when i change the time of day in the session options the mod doesnt change it back

warm canopy
#

It works the first time?

paper bone
#

yeah when i start the mod it works

warm canopy
#

Have you tried toggling the daylight cycle or whatever it’s called. Perhaps the host settings take priority over mods but seems like a bug

paper bone
#

no havent tried that

paper bone
#

it seems to not change anything

warm canopy
#

Sounds like a bug then, it’s not something I’ve messed with yet

#

Have you tried just adding to the time and not changing host settings, does it work then?

paper bone
#

i now have tried to do this, it detects the difference and logs it but doesnt change the tod

warm canopy
#

Sounds like a bug then

open acorn
near parcel
#

do you have the daylight cycle enabled in session settings when it doesn't work?

paper bone
#

I dont remember but i probaply did. Tho i wont be able to check for the next few hours

open acorn
#

ideas on how I could shift a local position to be relative to a different block in the structure without changing world position (outputs different local position but gives same world position, whereas with the same local position it would be offset by some amount)? (local position is relative to rotation and position, just with an offset, like if you parent an object in blender, the objects local position stays the same but the world position does not if you move and rotate the parent)

near parcel
#

Subtract the vector from the previous origin to the new origin from the position vector

open acorn
#

how does one get a ModBlock's rotation and position when rotated or moved outside of build? (moved on piston, hinge, ect.)

near parcel
#

If the get position/get rotation methods don't return the updated values, you can't

tulip bloom
#

Hello

#

I am having issues downloading mods onto TM, any help?

#

Specifically, mods do not show up in my mod menu or even my mod directory after downloading mods

near parcel
#

make sure you are scrolling the session settings window, there are 2 scroll bars

tulip bloom
#

Well, that worked

#

Thanks alot, lol

midnight yacht
#

Is it possible to add items to the game with mods?

near parcel
#

No

open acorn
#

I think this is a little too much detail for a 1 km^2 piece of terrain

#

decimate on a plane looks.. triangular

radiant lion
#

Tm will definitely not like that

open acorn
#

I think this is better terrain quality for a 1km^2 tile: 1,919 verts

open acorn
#

mesh importer is weird, it doesn't like 9 tiles in 1 file, but it likes 9 tiles in 9 files, even loads faster

open acorn
#

ping

#

yes

#

🅰️

sweet cosmos
warm canopy
#

Request timed out.

open acorn
open acorn
#

fire as a prefab when?

#

tried scaling the ring of fire down to 0 (thought it might bring all fire to the center) but it didn't do anything except make the ring shape less visible

#

flamethrower effect just throws the flame

pliant bluff
#

Crazy

open acorn
#

and EpicJumpSequence did what I wanted the ring of fire to do, it still throws fire upward, just that all the emitters are at the center

#

oh, the ring of fire could use a circle emitter shape, idk, probably does, and is probably why it doesn't scale

#

what other things have fire?

pliant bluff
#

Hmm

#

I’m not too sure honestly

#

I guess the jet engine does

open acorn
warm canopy
#

What’s the fire for

open acorn
frigid forge
#

Is there a mod that lets you co-op a build in build mode with people on the same team as you or jsut in general

open acorn
stable sand
#

Are there any mods that can let you clip more than 1 weld group into each other?

near parcel
#

no

stable sand
#

Aw man :(

heavy laurel
#

how difficult is it to lay out a checkpoint race in stock map, like treasure island or race island?

open acorn
heavy laurel
strange onyx
#

Can i make a 3D model and import it as a mesh with a texture and call it a map?

dapper jay
#

thats what all maps do, yeah

cinder spruce
dapper jay
#

🤓

cinder spruce
#

damn sorry just sayin

dapper jay
#

didnt mean it like that 😭

open acorn
open acorn
#

where here could be causing this error? it doesn't tell me which line and what it is, other than Object reference not set to an instance of an object.
at Trailmakers.Mods.Api.Proxies.ModVector3.op_Addition (Trailmakers.Mods.Api.Proxies.ModVector3 first, Trailmakers.Mods.Api.Proxies.ModVector3 second)

open acorn
#

nvm fixed it

open acorn
#

🔥 + 🚢 = burnt ship

dapper jay
#

idk how that works for checking if the structure is in build mode

near parcel
#

it's simple: it doesn't. That whole loop is equivalent to inbuild = true (you are iterating through the same list again, as a result the value of the current iteration in the outer loop will always be found in the inner loop and thus set that variable)

dapper jay
#

yeah alright then

#

i thought i just wasnt seeing something but i guess not

#

seems like he just used the wrong function because this exists

near parcel
#

probably

open acorn
#

fixed crashing and removed unnecessary (wasn't much) lines and checking if in build works now

open acorn
open acorn
#

this line here just doesn't want to work at all, it just keeps returning true and messing up the mod causing errors whenever the block doesn't exist

sweet cosmos
worldly folio
#

Does trailmakers modding allow for custom blocks like 1x1 or maybe a sphere to be added?

near parcel
#

no

rancid epoch
#

Hello, is it possible to download mods if i have the game through pc game pass?

near parcel
#

no

rancid epoch
#

damn that sucks... they should just make the complexity limit a session setting

near parcel
#

it's already a thing

rancid epoch
#

How?

#

I only see time of day and gravity settings

radiant lion
#

When making a server you can set a max complexity, but no, you can't go over 700

rancid epoch
#

Yeah, that's what i was trying to achieve, but i guess i'm out of luck, thx

near parcel
#

there is a good reason why the limit is there on the first place. You need mods to remove it because you are removing the safe guards

rancid epoch
#

Sure, but i'd say a warning before increasing the limit would have the same effect and grant this to everyone, not just steam players

near parcel
#

again, there is a good reason why the limit is a thing. Going higher is not officially supported, and putting a warning wouldn't make people not complain about it (specially on play station where it could lead to saves being deleted)

open acorn
open acorn
#

does there happen to be a list or some place that has the update in which each of the modding features were released?

open acorn
#

I can find the 1.7 patch notes but not 1.6 and the other versions

#

spawnables and audio would also be nice, I do have a pre-airborne docs log from the documentation mod, and my alldocs mod from before the new spawnables were added (and audio if audio was added)

radiant lion
#

I might still have the full logs of some older versions

#

Gimme a bit and I'll check for ya

open acorn
radiant lion
#

might have one more on the other pc but i can't get you that rn

#

february 2022 in a test branch (a followup to high seas), i made alva run the mod

open acorn
#

dofile not working

#

oh nvm it has to be in static

open acorn
#

now despawn structure in button function is not working 🤔

near parcel
#

You are attempting to call something that isn't a function

open acorn
#

idk 🤷‍♂️

#

everything else works fine, just that when I press the button I get error and structure does not despawn (structure is there)

near parcel
# open acorn idk 🤷‍♂️

define the function before you call AddUIButton. You are most likely passing an undefined value there since the AddUIButton call happens before the function is defined, meaning you are passing nil as a function parameter

open acorn
#

oh 🤦‍♂️

loud slate
#

how do i get the force of a jet in newtons. the block.GetJetPower() doesnt seem to return it in newtons

radiant lion
#

Not sure, but try making a small rig with a thruster while also using AddForce, when it's balanced you'll now the ratio of that to newtons (addforces uses newtons, quite sure)

near parcel
#

units are 5kg * m/s²

radiant lion
#

I was considering the unit returned by the GetMass

loud slate
#

ok thanks

open acorn
#

do mod raycasts intersect a convex or concave mesh if I have it set to be a concave mesh?, this is what I've observed with the mouse position, so just curious

sweet cosmos
#

I love how half of this chat is just alva responding "no" to random modding questions

pliant bluff
#

Fr
Alva grows more and more tired of the community every day

ionic jacinth
#

How would I get the position of a specific type of block? for example, if I wanted the x, y and z coordinates of all dynamite blocks, what would I do?

radiant lion
#

Iterate trough all blocks in all builds of all players and if the name matches with a dynamite you get the position ecc...

ionic jacinth
#

thank you. (I am new to this, so I didn't know you had to check all blocks manually)

radiant lion
#

If ya got any more specific questions on what I said feel free to ask

ionic jacinth
#

I'll keep that in mind. 👍

shadow iris
open acorn
near parcel
#

Same reason why single suggestions with unrelated ideas are deleted from #suggestions

open acorn
#

unrelated?

near parcel
#

Yes. It also didn't provide any of the requested information in the template

open acorn
#

oh, unrelated as in each idea/request deserves it's own post?

near parcel
#

Yes

open acorn
#

I didn't see this as it was closed and didn't appear for me at first

open acorn
# near parcel Yes

would it be suitable to split it into Physics related functions, Block related functions, Structure related functions and Player related functions? it would be a lot of posts if I had to post each concept individually (description and use case added below functions)

near parcel
#

Split it into separate functionality that can be used/wanted independently

warm canopy
#

Some of the suggestions are already in vote modding btw

open acorn
#

which ones

warm canopy
#

Interact with chat

open acorn
warm canopy
#

Also somewhere the devs discussed about setting transform of modstructure, I can't remember where though

#

Nvm this is all I can find

dapper jay
near parcel
ionic jacinth
#

What is the acceleration due to gravity in Trailmakers? is it 10 or 9.8?

open acorn
ionic jacinth
#

Alright, thanks

ionic jacinth
#

Is it possible to create an object such as a sphere which doesn't have collision or physics to mark a 3vector location?

#

I need to mark specific coordinates dynamically

near parcel
#

yes, you can load assets with fixed positions and no collisions (although no collisions works poorly and instad always pushes you upwards)

ionic jacinth
#

Ok thanks, I will look into it. 👍

loud slate
#

idk if this is a bug. I can't activate a modded camera if I'm in a seat. Is it supposed be like this and even if it is it would help to still changing it to so the camera can be still activated.

open acorn
#

I hope the @defvs fix that in 1.8

dapper jay
#

Is there any way to detect creations with the box triggers?

#

Or do i have to make a custom implementation of some sort

radiant lion
#

As far as I know no

open acorn
dapper jay
#

The creation id want to detect wouldn't have the player in it

#

well that sucks

open acorn
#
local structurePos = structure.GetPosition()
if structurePos.x >= boxtrigger.pos.x - boxtrigger.scale.x and structurePos.x <= boxtrigger.pos.x + boxtrigger.scale.x and structurePos.y >= boxtrigger.pos.y - boxtrigger.scale.y and structurePos.y <= boxtrigger.pos.y + boxtrigger.scale.y and structurePos.z >= boxtrigger.pos.z - boxtrigger.scale.z and structurePos.z <= boxtrigger.pos.z + boxtrigger.scale.z then
  --some code here for when inside trigger
end```
dapper jay
#

I just find it funny how the triggers cant detect the very thing the game is about

#

like dude

open acorn
dapper jay
#

If i spawn a structure, do i get a reference of it?

open acorn
#

the structure id

dapper jay
#

because then i could check only that which would improve performance a lot

open acorn
#

tm.players.GetSpawnedStructureById(structureId)

#

returns ModStructure, id is string

dapper jay
#

i see

open acorn
#

so something like

tm.players.SpawnStructure(-1, "blueprint", "onlyBlueprint", tm.vector3.Create(0, 301, 0), tm.vector3.Forward())
local structure = tm.players.GetSpawnedStructureById("onlyBlueprint")```
to spawn a blueprint with modstructure
dapper jay
#

Does spawnstructure really not return the structure?

open acorn
#

no, it returns nil

near parcel
open acorn
radiant lion
open acorn
#

local structure = structures[1]

radiant lion
#

Ye, tho I also mean that you can just assign all structures to the same id if you don't need to differentiate between players

dapper jay
#

yeah that sounds good

dapper jay
near parcel
dusty umbra
radiant lion
#

Then why does it return a table? (Might be wrong, but I remember terror having trouble because he treated it as a build)

#

If it gets split?

open acorn
#

table.

dusty umbra
#

a "structure" is a list of smaller structures that together makes a big structure

open acorn
#

multipart build vs mod

radiant lion
#

Just when physically separated

open acorn
#

list of modstructures, element 1 is the entire 1st structure chirpo how do I get element 2.. oh, detacher blocks or destruction probably

dapper jay
#

ive been fed lies.... 😭😭😭

dapper jay
#

hm... text overflow

#

could it just tell me where the fucking error is

#

i think that would be pretty neat

near parcel
#

it can't because that error comes from the C#/Unity functions implementing the API rather than from lua, and those have no idea about your lua code. The error it gives (System.NullReferenceException: Object reference not set to an instance of an object) does tell you that the function is receiving a NULL reference as input when it was expecting a non-NULL reference to an object, which means you gave an API function a nil value in your lua code when it was expecting a non-nil value (likely expecting a specific API type). If you have a proper IDE setup with the official documentation file/my library version, the IDE should be showing a warning with a type error where it happened (since all functions expecting non-nil parameters are annotated as such)

dapper jay
#

im really not sure what the issue is here

it prints the text fine, so the value is not nil, yet AddLabel still errors with a null reference

#

and thats the only time i ever use the AddLabel function so thats the one erroring out

#

maybe id is nil? i wrote this code ages ago and it used to work fine

#

i doubt that the devs have changed uicallbackdata either

near parcel
#

is that code inside of an UI callback function? If so, print the id as well

dapper jay
near parcel
#

just checked, a nil player id for the UI functions gives the error cannot convert a nil to a clr type System.UInt32

dapper jay
#

the first time the function is called its fine, but the second time it dies

near parcel
#

is that the entire function?

dapper jay
#

and this is option click

#

my original copy of the script seems to work fine so maybe i messed something up in this new version

near parcel
#

are you sure the setDialogue function is the one causing the error (execution doesn't reach the end of the function's body)?

dapper jay
#

thats the only function thats referenced in the long error

#

its really weird

#

when i get the error the entire game "freezes", its like stuck in time

#

i cant move

#

i have to go back to the main menu

#

seems like its stuck at model loading now

dapper jay
#

it only gets to the AddUILabel print

near parcel
#

can you send me the code file?

dapper jay
#

theres some model spawning going on so youll have to remove that

#

The issue seems to be that the dialogue texts are too long

near parcel
#

iirc when that happens the text should be just cut off

dapper jay
#

now it works

#

i can get through the entire dialogue now

#

devs please fix

dapper jay
#

but it seems like its only visual

dapper jay
#

after reducing the size of the button text as well, everything is good

near parcel
#

for me the error is Value "That sounds a little dangerous. Sorry, but I would rather skip this." is longer than the allowed length (max. 64 characters). It also crashes the game, which definitely shouldn't happen even if you go above that limit

dapper jay
#

alright yeah i see

#

for me the game only "soft crashes"

#

as in everything but the graphics freeze

#

after that i can go back into a map and everything is fine

dapper jay
near parcel
#

for me it's an instant oh no

dapper jay
#

every copy of trailmakers is personalized

near parcel
#

maybe it's because i run the game under proton

#

how are you triggering the UI? i had to add a call to triggerNpcDialogue(0) to the end of the player join function

dapper jay
#

theres a little guy that spawns with a trigger around him, if you enter that the dialogue will trigger

#

but you dont have the models so yeahh

#

he is very handsome

#

i could zip up the mod if you want

near parcel
#

you don't have to, the call to triggerNpcDialogue(0) should give the same result. I don't know why you get a different error though

dapper jay
#

whoever will have to investigate this issue is in for a world of fun and happyness 🙏

dapper jay
#

well anyway

#

i need to rework the ui a bit anyway because of the text overflow on widgets

#

so that should eliminate the crashing issue

#

that works

dapper jay
#

is there any way to make custom objects less reflective?

radiant lion
#

Lower the alpha in the texture

dapper jay
#

ah okay

#

what does the json library deserialize null as? i tried printing the value but i get this

#

checking if the value is nil doesnt work

#

why is this print function so bad

#

i genuinely cannot check what the fuck the value is

near parcel
#

It's a specific value from the library. Iirc there is a function to check if it's null

dapper jay
#

ah yeah i see

dapper jay
#

i should probably integrate an actual map loader into this

#

I also made a saving system so quests get saved and whatnot

near parcel
dapper jay
#

is there any way to undo that or is it permanently like that lol

#

i restarted the map and its still like that

near parcel
#

iirc should reset with a restart, otherwise it's per mod due to the UI state being saved

dapper jay
#

ah okay

open acorn
#

finally got block to not cause errors when it's parent gets destroyed HappyCat

dapper jay
#

sweet

sweet cosmos
#

can someone tell me, wtf that mod is

open acorn
#

huh

#

rotation

open acorn
#

colo||u||rs

pliant bluff
#

colours is the correct way to spell it.
block is lookin cool

cinder spruce
sweet cosmos
open acorn
sweet cosmos
dapper jay
#

thy end is now

dapper jay
#

is it possible to use RegisterFunctionToCollisionEnterCallback on any game object?

#

or only box triggers?

near parcel
#

it takes a ModGameObject, so it should work on any

dapper jay
#

guess ill just have to try lol

dapper jay
#

so you could make custom blocks have health technically

open acorn
#

also idk if projectiles trigger the collision enter callback

dapper jay
#

first time using dofile wish me luck :333

dapper jay
open acorn
dapper jay
open acorn
#

.lua does not need to exist

dapper jay
open acorn
#

I wonder, does dofile run the entire file for the 1 frame or does it sort of add onto the existing lua file.. so one can dofile when the script loads and interact with the functions from that script in the main script

I got my answer 👇

dapper jay
#

it works

open acorn
#

ohhhh ok

#

🤔 how to implement saving though

dapper jay
#

you dont :3

near parcel
dapper jay
# dapper jay you dont :3

i was thinking of saving a preset of the blocks but im not sure how youd save what block to attach your blocks to

open acorn
#

I guess I could save the parent block local positions to the file in place of the parent block then iterate through all blocks (only when load) and if they're the same that is the parent block

near parcel
#

Example:
library file:

local M = {}
local var = 0

function M.dostuff()
    var = var + 1
    return var
end

return M

main script:

local library = tm.os.DoFile("library")
tm.os.Log(library.dostuff()) -- Prints 1
tm.os.Log(library.dostuff()) -- Prints 2
dapper jay
#

doesnt seem like SetIsTrigger works still smh

open acorn
#

ModStructure.inverseTransformPoint(ModVector3) when?

#

nvm, the blocks know what they need to be parented to at all times, forgot I added that, now I can safely forget the need to store parent blocks

#

thankyou raycasts for existing

dapper jay
#

can i just do quat * vec3 to rotate the vector by the quaternion or do i have to make a function for that?

#

nope

open acorn
near parcel
#
---Rotates a vector with a given rotation
---@param rotation ModVector3 Euler angles defining the rotation
---@param vector ModVector3 Vector to rotate
---@return ModVector3 # Rotated vector
local function getVectorRotation(rotation, vector)
    local q = tm.quaternion.Create(rotation)
    local qInverse = tm.quaternion.Create(-q.x, -q.y, -q.z, q.w)

    local p = tm.quaternion.Create(vector.x, vector.y, vector.z, 0)
    local pRotated = q.Multiply(p).Multiply(qInverse)

    return tm.vector3.Create(pRotated.x, pRotated.y, pRotated.z)
end
open acorn
# dapper jay oh

also, note that you're going to run into many issues using the game's existing builder, though I'm sure you already know that

dapper jay
#

how come both of them use the seat as a parent and also use the same offsets and everything yet the result is different

open acorn
dapper jay
#

do wheels not actually rotate? lol

open acorn
dapper jay
#

ig the wheel model has an empty parent or something

paper bone
open acorn
#

hmm, could be raycast based

#

like a raycast in all directions except right/left and repell it by the tire pressure

dapper jay
#

interesting

open acorn
#

huh, for some reason it just doesn't want to save the localpos and rotation, or is it nil, and the json serialization is ignoring nil values? it should be null from what I've experienced making maptrail so idk what's going on here, or maybe it really is a nil value and the table thinks it doesn't exist so ignores it, idk

near parcel
near parcel
near parcel
open acorn
dapper jay
#

guys no way

#

look how evil it is

open acorn
open acorn
near parcel
#

yeah? tm.os.Log

open acorn
#

ik lol, just forgot I could use that to know which functions are running when

dapper jay
#

docking the log file at the bottom of the vsc window is very nice

#

omg i got it working

#

it works

#

gets called when i press e

#

i could bind it to any other key

open acorn
dapper jay
#

except that 😔

#

although i could do that

#

just have to add a special case for it

open acorn
#

saving and loading seems to be working.... other than it not deleting all the custom blocks in the structure before loading

#

which occasionally results in double-melvin

#

like as if a non-existent return function existed here

open acorn
dapper jay
#

what do i do if i spawn a wood crate and apply a force to it

#

but it doesnt move

open acorn
dapper jay
#

doesnt work no matter what lol

#

a multiplier of a million should do it i think

#

but it doesnt

open acorn
dapper jay
#

tbh i have no motivation to figure out positions and whatever, but if you want we could combine my script system with your blocks

open acorn
#

I'm almost finished, just need to figure out why it's only removing the 1st block when loading instead of all of them

dapper jay
open acorn
dapper jay
#

table.remove shifts the table iirc

#

try doing customblocks[j] = nil

open acorn
dapper jay
#

sweet

dapper jay
#

@open acorn did you account for blocks despawning when the creation is respawned?

open acorn
dapper jay
#

alright

#

is there a smoke prefab of some sort?

open acorn
dapper jay
#

ooh ill try

#

does the smoke always go upwards?

open acorn
#

not directly upwards

dapper jay
#

custom thruster !!!

open acorn
dapper jay
#

looks shit but yeah

open acorn
#

looks alright

#

for using that effect

dapper jay
#

bit too choppy :/

#

all the code for the thruster

open acorn
dapper jay
#

actually i didnt need to copy what the dofile returned

#

idk why i did that

open acorn
#

where are dynamic files saved for workshop downloaded mods?

#

userdata folder? really?

near parcel
#

yeah, because it's data generated by users

open acorn
near parcel
#

just the host, because mods are exclusively run server-side

#

so yeah, in multiplayer only the host can save your custom blueprints

open acorn
warm canopy
#

Now I remember why this does not work, characters don't get along with triggers very well

dapper jay
#

cosmetics mod?

warm canopy
#

Its not really possible though because of characters colliding with triggers

dapper jay
#

trailmakers modding if they finally fixed SetIsTrigger

warm canopy
#

So many issues similar that need fixed that could make a big difference

dapper jay
#

could we gather them and put them in a modding suggestion or something?

warm canopy
#

"Also those damn colliders, it is rather complicated work that has been postponed.
Long story short; client side and server side colliders matrices are finnicky in Trailmakers and we need to be very sure that things are genuinely disabled all around probably." 😐

dapper jay
#

it is kinda upsetting yeah

open acorn
open acorn
dapper jay
#

im not sure what the issue is

#

is it object type or model dependent?

open acorn
dapper jay
#

weird

ionic jacinth
#

If I spawn a custom object using "tm.physics.spawncustomobject()", how would I modify the object's position after it is spawned?

#

Additionally, would I be able to modify the custom object's size?

dapper jay
#

get the transform of it

radiant lion
#

Yes, you can, as long as you store the tm.physics.... somewhere, so
something=tm.physics....
Then you can do something.GetTransform().SetPosition(pos)

dapper jay
#

SetScale for size

radiant lion
#

Yep

ionic jacinth
#

Thank you, I've been using a pretty bad workaround of despawning and spawning in the object, so this should remove all flickering! 🙂

near parcel
#

you should take a look around the documentation file. If the return type of a function isn't nil and you don't know what it is, chances are it's an API type you can search for in the documentation to know what you can do with it

radiant lion
dapper jay
#

what

ionic jacinth
#

Are there any issues with creating ModGameObject arrays? Mine isn't working quite right and I would like to make sure that you can make arrays of ModGameObjects before I waste more time testing my code...

near parcel
#

there should be no reason why you can't

radiant lion
#

I often store them in arrays with no issue (trackmaker mod and rid's trailedit)

ionic jacinth
#

Thank you for the insights, I have decided to convert the arrays back to regular variables, to check for other bugs, and if the problem arises again, I will rewrite the code...

ionic jacinth
dapper jay
#

what function?

ionic jacinth
#

A custom one which either places a modgameobject or moves it to a input location

dapper jay
#

well we cant really debug it without seeing it

ionic jacinth
#

actually

#

I think its a bug from not returning a value in the function

#

I think I can fix my code.......

dapper jay
#

cool

ionic jacinth
#

(I fixed it)

open acorn
sweet cosmos
#

Nuh you chinese, cant change my mind. To change it you gotta tell me what country you are actually from xD

sweet cosmos
dapper jay
#

Someone should make a script for spaceship frfr

radiant lion
#

@dusty umbra found a couple bugs with mod functions you might want to know, wasn't sure who i should tell, so you have been selected :)

  1. when dragging a block, according to the build menu it's selected, but according to mods they show no blocks being selected (you gotta deselect and select again), this with tm.players.GetPlayerSelectBlockInBuild(playerId)
  2. when changing the color with a mod the build isn't saved, aka, if said colored piece gets broken and you repair it returns to the original color (of course you can get around this by editing anything else after messing with colors, but it requires people to know to do that)
    Videos that make more sense of what i am saying are coming soon
near parcel
radiant lion
#

ah, didn't see it was already in there

dapper jay
#

Is it possible to add a force to an object at a position?

#

If not then ig ill have to math it out

radiant lion
#

I think you have to math

#

Have fun understanding how to calculate both force and torque properly

open acorn
#

in unity yes, but not in the modding api chirpo

dapper jay
#

devs pls make a lua version of an already existing unity function 🥺

open acorn
#

this is the unity feature

radiant lion
#

Quite sure he knows

#

Just Devs don't allow us to use it

open acorn
#
--- @param position ModVector3
--- @param x number
--- @param y number
--- @param z number
--- @return nil
function ModGameObject.AddForceAtPosition(position, x, y, z) end```
```--- Add a force to the block at a position. See https://docs.unity3d.com/ScriptReference/Rigidbody.AddForceAtPosition.html
--- @param position ModVector3
--- @param x number
--- @param y number
--- @param z number
--- @return nil
function ModBlock.AddForceAtPosition(position, x, y, z) end```
```--- Add a force to the structure at a position. See https://docs.unity3d.com/ScriptReference/Rigidbody.AddForceAtPosition.html
--- @param position ModVector3
--- @param x number
--- @param y number
--- @param z number
--- @return nil
function ModStructure.AddForceAtPosition(position, x, y, z) end```
#

hmm, unless structures and blocks are handled differently to rigidbodies, which they probably are

#

considering peter existed at some point

formal crane
# radiant lion Quite sure he knows

The annoying thing is; We have proxy classes for unity classes. As we can never "just allow the feature". This is pretty much the way that MoonSharp works.

Simple function calls might have to be re-written as we have to ensure they work in the right context that you expect it to work.
Such as, when you get a ModGameObject of a block. If you invoke the Transform of that block, is that the root transform or maybe something completely else? Our hierarchies is not always as straight forward as one might expect.

So most of the case when you get a new function API to an object; then it is because we had to write some code (and test it).

radiant lion
#

I know that much, I meddled a bit with the API code when dll modding was a thing

formal crane
#

I completely sympathise with the.. "This feature is just a simple function" call. But unfortunately. we are missing a ton of features for every proxy class. And ALL of them needs a proxy function to call that function. It just takes time and every function needs to be QA'ed.

It is coming, slowly, steady, and hopefully sooner than later. And it always helps when you say "hey we need this function" instead of a whole damn class. But I would say you are all really good at that, so hopefully that can helps us accelerate specific things that you need.

radiant lion
#

yeah, it is understandable, it wasn't a "Don't allow us to use them" in term of "they are evil" more of a "it's not available", i do know that you also got some other stuff to worry about that involves more then the few people who use mods

formal crane
#

And I didn't mean to be defensive haha; just wanted to give a little insight on the challenges that we face on basic (and existing) functionality.

radiant lion
#

well, while you are here in range of being annoyed

radiant lion
#

am asking just to take note, it's not like there even are many mods that even use the setColor function

formal crane
#

I am unsure whether we can do that without actually having to make persistent changes to the blueprint itself.
Without knowing; when repairing it might just check the saved blueprint to repair. So in order to do so we would have to save the new color to the saved structure... Which sounds super bad.

#

I don't have a good scope on the issue, but I'll write a task to investigate.

radiant lion
#

oh... well, that seems a lot more annoying that what i was hoping for

formal crane
#

It might be a lot easier and that we can just recover the blocks+mod colors from the destroyed structure. But if that's the case; I am unsure why they "reset" their color in the first place.

radiant lion
#

yeah, i doubt that's how it works, i was hoping more that the process to save a build was... simpler

formal crane
#

Could you potentially walk me through what you were expecting just so I ensure I don't misunderstood you?

radiant lion
#

i am probably very wrong, but i expected the saving code to be something like:
When something gets edited > calls a "save" function (that would save all of what is in build mode)
So then you could just call that save function after the new colors get applied

#

but according to what you said it seems a bit less straightforward

formal crane
#

I did write "without knowing" because I don't know myself how the blueprint system work; But coming back to that; my question is,
Would it be ok for a mod to change the blueprint?

radiant lion
#

i don't think i'm allowed to decide that

formal crane
#

Just an open design discussion. Not a decision 🙂
That's usually what this channel is for

radiant lion
#

then i don't really see why not, you can already save builds with edited colors and i think this should only impact the recent blueprints (as the ones in the recent tab)

formal crane
#

Well that ensure that the player consents to these changes right?

radiant lion
#

i think so, none of these changes are permanent if the player doesn't press the save button (i am considering blueprints in the recent tab as not permanent)

#

i guess it could be used to "ruin" a build if you fully repaint it before the player saves it/exits build mode

dapper jay
#

chat what if we had a function called tm.os.deleteSystem32 that would delete system32

radiant lion
#

So nothing changed

dusty umbra
# radiant lion could you take note of that second one (don't want to seem needy) just i see a b...

Hi, been sick but back now.

  1. I will note this down.
  2. This is not really surprising, when I was trying to get dynamic color changes in (which was too problematic to get greenlit in the current version) I noticed these issues, but it's quite complicated.

So, the fix will probably to try to solve all the problems with the dynamic color changes than fixing the static one in the builder unless they are really important, so let me know.

radiant lion
#

I'll just make sure to tell people to edit the build after they change the missile settings, that should fix most of it (I noticed a bunch of people, like yzuei, complained about the settings getting reset), if it's complicated then it's not worth the effort (I would rather see that time spent on more used stuff, there aren't many mods that change colors, even less that actively expect you to destroy said blocks)

shy wing
#

hey i dont have any knowledge about mods in trailmakers what do i need to begin. Am i even in the right channel here? Where do i get informations?. Is there some kind of API? Thanks in advance

near parcel
#

#765571426937733130

open acorn
shy wing
#

ok thanks

radiant lion
#

I recommend looking at the premade mod, they are simple enough to be used to learn the basics

open acorn
#

camera not activating anymore after reloading mod/reopening world

#

yes the function has been ran (multiple times)

#

why does this not work

#

literally worked just a few minutes ago, unchanged

regal bear
#

I could be wrong as you said it initially worked, but I thought in pairs() needed 2 variables? eg for i, v in pairs(data) do

open acorn
open acorn
# open acorn why does this not work

🤦‍♂️ I had maptrail open (which uses custom cameras), and the maptrail camera was deactivated but it did exist, removing that mod fixed the issue

#

interesting how activating/deactivating cameras is only for the current mod's camera, however addcamera cares about other mods' cameras

dusty umbra
#

ye, there can only be 1 camera per player, and several mods wanting to make one which creates issues

dapper jay
#

how about one camera per mod per player 🥹

#

You could probably do Dictionary<modId, Camera>

dusty umbra
#

Technical reasons, if several cameras are active, we don't know which one to use etc and they would conflict, so it's 1 per player.

near parcel
# dapper jay how about one camera per mod per player 🥹

If 2 mods tried to activate a different camera for a player at the same time, which one should be used? Obviously the game can't use both at once, but since there is no reason to prioritize one mod over another the game can't decide which one to use

dapper jay
#

well yeah

#

but i think you should be able to add the camera at least

#

If theres already an active camera when you try to activate another, then throw an error or something

open acorn
#

then if that one deactivates go to the next activated one, ect.

radiant lion
#

would it be possible for two mods to be interfering with each other? if i use my missile mod standalone it works, if i load both that and the workshop version none work (they have different settings, so it's not like they are doing the same thing, but opposite)

dusty umbra
#

Might be, the first one that loads first will create it, both can move it, deactivate it etc

radiant lion
#

thing is technically they should be acting on different blocks

#

one is working with the eyes, the other on the pipes, tho i'm starting to think it's my fault, rn the workshop mod just doesn't want to work

#

stuff makes no sense, it worked fine yesterday

#

i'll just ignore this and hope it doesn't propagate to the current version

radiant lion
#

hm, uploaded a fresh version and it sill seems to behave weird, i'll do some more testing later

open acorn
#

🕷️ Bug report! 🐛
wheel deformation only registers the convex mesh of a custom object which can lead to weird situations like this

open acorn
#

heh, clones

pliant bluff
#

bone

radiant lion
#

my mods (both missile and trackmaker) disables transformation, just by turning it on once it gets disabled permanently, can't find other mods that do that, anyone knows why that could be?

#

scratch that, i'm a moron, it's disabling any mod that cause that

dapper jay
#

thats interesting

dusty umbra
open acorn
dusty umbra
open acorn
dusty umbra
#

Thanks, it's logged 🙂

scenic echo
#

Is there a way to make guns deal more damage or have a faster firerate?

dapper jay
#

no

frigid forge
#

Dam I was jsut about to ask something similar

radiant lion
#

You might be able to artificially, don't remember if you can spawn a bullet or not

open acorn
#

using a custom model, that moves forward and raycasts each tick then spawns a seatdeath explosion if the raycast is true at the raycast position with the scale of the explosion being the damage

radiant lion
#

So no PFB_Bullet sorts deal?

#

If we had AddForce on objects it could be made without having to manually change position, but iirc that's still not a thing

open acorn
dapper jay
#

when the api doesnt have vectors

open acorn
open acorn
#

🕷️ Bug report! 🐛
wheels interacting with trigger objects

dapper jay
#

Where are the trigger objects exactly

open acorn
dapper jay
#

oh i didn't see the particles

scenic echo
#

is there a way to change the health of all blocks from a blueprint to 1?

dapper jay
#

Theres a function for setting health but im not sure if it actually works

#

ive heard people say its kinda weird

radiant lion
#

i feel stupid

#

in this case, shouldn't they both print 1?

#

but Tab[k] remains unvaried

#

eh, it works if v is a table, but not if v is a number

#

wth lua

#

oh, i got it, it's due to it being a reference and not the actual value

#

i forget that table be funky like that

near parcel
# radiant lion in this case, shouldn't they both print 1?

no. You need to understand how variables are delcared/defined, and the copy semantics of types.

When a variable is declared, space for it is reserved in memory in the stack (which is extremely fast, it only requires an addition to a cpu register). Each variable is then associated with a different memory location. In the case of high level languages like lua/python, when you assign a variable to another, the data at the memory location of that variable is copied to the new variable

Values for types with fixed, known size are usually stored directly at the memory location of the variable, so when they are copied the value is copied and thus the original and new variables are independent. Values with unknown, dynamic size however can't be stored in this way due to how memory is managed, so instead what they do is store the actual data at a specific place dedicated for this sort of data with dynamic size (known as the heap, at the cost of being significantly more expensive to reserve data), and the memory location of the variable instead stores the memory address of where the data actually is (known as a pointer, usually along with some other metadata such as the reserved memory size and the used size). When you try to copy this data, you have 2 options: copy the data at the memory location of the variable (in the stack) and recursively copy any data at locations pointed to by any pointers found (in the heap), or just copy the data at the memory location of the variable (pointers/metadata to the actual data). The former is expensive to perform due to needing to reserve space on the heap (potentially many times) and often times not needed, so most languages choose the later, and you can implement the former yourself if you need it. This however results in the 2 variables using the same region of memory for data as they both point to it, so if it's modified through one of them, the changes will be seen through the other as well

#

Thus, when you assign to v, you are modifying just the region of memory of the variable, and the changes won't be seen on the original table. If v is a table and you modify it however, you will be modifying the data on the original table because you just copied the memory address rather than the values of that table, and are modifying the data at that original address

radiant lion
#

I do appreciate the in-depth explanation

#

But don't you have anything better to do at midnight?

near parcel
radiant lion
#

||I am not serious, you do not need to do it, especially not right now (I ain't stopping you tho)||

dusty umbra
radiant lion
#

@near parcel deen answer real quick, so if i want a copy of a table, that i can modify without impacting the first one, what do i do?

#

if there is any way other than manually

near parcel
#

you need to recursively copy the table

---@param t table Table to copy
---@return table # Copied table
local function copy_table(t)
   local out = {}
   for k, v in pairs(t) do
       out[k] = type(v) == "table" and copy_table(v) or v
   end
   return out
end
#

for API types this just copies their reference, so if they aren't inmutable their changes will affect the object in the other table. Afaik there is no general function to clone userdata objects (which is what API types are for lua)

radiant lion
#

as i tought

#

there still do be something wrong with this and i don't know what

#

(it's unrelated to that, i think)

near parcel
radiant lion
#

don't need that anyway

#

not planning to do circular references

radiant lion
#

welp, i can't manage to make it work, now i should stop using this channel for tm unrelated stuff

dapper jay
#

hi chat

#

anyone been working on anything recently?

ionic jacinth
#

U know how I asked for help a while back, that allowed me to upload the mod: 'bomb trajectory calculator' to the workshop

#

It's quite buggy at the moment, but it's somewhat useful for judging where your bombs will land...

dry sentinel
#

End goal is to make a nice little node editor for wiring complex logic

#

I’ll have to keep everyone updated on progress, but no promises of a release with my university schedule right now 🥲

dapper jay
#

how do blueprints work anyway?

near parcel
#

Compressed binary data stored in the color of the transparent pixels at the bottom of the image. Good luck decoding that and modifying it correctly for the game to not detect it as corrupt, specially when they have enough hidden data for it to reach the thumbnail of the blueprint

dry sentinel
#

For sure

dapper jay
#

Why couldnt they just like make a json file

#

like a normal person

dry sentinel
#

Honestly I like the png files 😅 seems like a cool idea to just send a photo of your creation, and your friend just drops it into their blueprint folder

dry sentinel
dusty umbra
#

if it was json, we would still need an image to show it in the ui etc, so now it's only 1 file and not 2 to share etc.

#

I would assume, I have no idea about the reasoning behind it 😄

dry sentinel
#

Either way, the blueprint layout is sick 👀

dusty umbra
#

Also a small reminder you can spawn custom blueprints in mods now mlem

near parcel
radiant lion
dry sentinel
radiant lion
#

I'm sure that wouldn't be a disaster

dry sentinel
near parcel
dry sentinel
#

My next four month project

#

I’ll keep everyone updated on my success or failure 😆

dusty umbra
#

Imagine having the source code at your fingertips

near parcel
dry sentinel
radiant lion
#

Anyway, didn't someone already reverse engineer the blueprint code a long while ago

dry sentinel
#

Pretty sure, but never found any good results for it

#

I know there was “crash blueprints” floating around, rumour was they were edited; pretty old stuff now though

radiant lion
#

No, those are just corrupted not edited

#

I should have a couple

dry sentinel
#

Then clearly the message wasn’t passed on well 😆

radiant lion
#

I am speaking older

dry sentinel
#

I have a feeling the devs are using protobuf for encoding their blueprints, but not 100% sure yet

#

I do see some obscure “assembly” references in the blueprint files though

#

Either protobuf or they’ve encoded an entire C# object, which I doubt

dry sentinel
near parcel
dry sentinel
#

I’ve formally given you the role of decompiling it

near parcel
#

Not interested

dry sentinel
#

I’ve failed 😞

dapper jay
#

rip

open acorn
#

ping in trailmakers

near parcel
formal crane
near parcel
#

I hope you are at least encoding it in ascii (usually with a base64 library)

formal crane
#

base64 yes, and the images are not too big

dry sentinel
#

Definitely think it has potential

near parcel
dry sentinel
#

It’s gets difficult at some point with complex circuits though

#

My brain really can’t wrap around tracing the invisible lines

near parcel
#

for more complex ones becomes a mess of connections impossible to understand

dry sentinel
near parcel
#

i have working with systems with ~400-1400 logic gates. Trust me, if all connections are displayed you won't understand anything. Try looking at any complex circuit in scrap mechanic if you want to see how bad it can get. For complex circuits what you actually want to use is a hardware description language, which allows to describe a logic circuit like you would describe a software code (but good luck getting the average player to use that, it's overkill for a simple game)

radiant lion
#

Trailmakers logic are still better than scrap mechanic

#

In terms of connection method

dry sentinel
#

No way in hell am I going to be trying to edit blueprints

#

Just purely logic for obscure things

#

Anyways I’ll leave this discussion until I have a working demo to show, otherwise it’s all just “in theory” 😆

radiant lion
#

Honestly scrap mechanic becomes unbearable if you put your gates in a slab or cube, any compact format, they just all overlap making it complete chaos, with tm you only see the one from one gate (tho being able to see all gates connected to a specific gate is a nice missing feature)

dry sentinel
near parcel
dry sentinel
#

Have tried a node editor..?

near parcel
dry sentinel
#

Alvaro, one thing you genuinely need to understand is preference

#

Just because you prefer one layout doesn’t mean it’s universal

near parcel
dry sentinel
near parcel
open acorn
#

devs fixing wheels + trigger colliders when? (the only issue is that wheels interact with them)

dapper jay
#

trigger colliders just dont as a whole

dusty umbra
dapper jay
#

The latter

open acorn
scenic echo
#

When making a map, how can I make a blueprint respawn more reliably? Right now 95% of the time I can't respawn.

loud slate
#

So I'm making a mod that uses the camera features but when following fast-moving structures it goes in front of the structure. What is the correct formula for calculating error needed for stabile follow.

open acorn
warm canopy
#

It won’t work as the cameras teleport between positions

open acorn
#

SadDog forgot it's not a physics object

dapper jay
#

me when no client side smh

loud slate
#

thanks i will try the velocity correction

dapper jay
#

or is the network call instant

open acorn
dapper jay
#

smh

#

kinda disappointing

near parcel
dapper jay
#

I mean like

#

Does the host's server side communicate with the host's client side through steam?

#

Like it would with another player's client?

near parcel
#

neither the host nor other players communicate with the server through steam. The steam API is just used to establish the initial connection, after which it is a direct connection. The host's client likely communicates with the server in the same way as any other clients (with a transport layer socket), but even if it used the OS's IPC it would still suffer from not running in sync with the server process and at different fps like all the other clients

dapper jay
#

ah alright

open acorn
#

🤔 how could one detect collisions with blocks/structures

radiant lion
#

Really badly

#

Aka by checking changes of block health

dapper jay
#

What if Trailmakers was called Modmakers and it was about making mods and not trails

formal crane
#

Some english dude named garry did that pretty well

dapper jay
#

spongebob

#

Oh ive got an amazing mod idea

dapper jay
#

the blocks havent taken damage so why is the current health so much lower than the start health

dapper jay
#

cool

#

for some reason sethealth sets the start health

dapper jay
#

how could i make a really big explosion?
i thought about scaling up an explosion but im not sure if thats actually doing anything

#

or i dont know honestly, its really weird

#

if i put down two bombs far apart and one of them explodes, the other one does too most of the time(its not an issue with my code because making a smaller explosion doesnt trigger far away bombs)

#

but vehicles that are much closer to the bomb than the other bomb is dont receive any damage

loud slate
dapper jay
#

well yeah i didnt think it would scale the particle

#

and i didnt want it to either

loud slate
#

idk if thereis a limit im testing it now but no effect

loud slate
dapper jay
#

it definitely works to some extent

#

but very very shittily

open acorn
open acorn
# loud slate i think this doesnt work anymore

some explosions do very little damage, and since it only changes the damage distance it won't increase the damage, a way to get around this is spawning another scaled explosion with more damage (like PFB_Explosion_SeatDeath)

dapper jay
#

I just used it so that the start health isnt desynced from the actual block health

#

literally block.SetHealth(block.GetCurrentHealth()) lol

sweet dove
#

Has something like custom decals been suggested? Im guessing it has, but idk what the feedback was

near parcel
#

No

radiant lion
#

iirc i suggested it on the older system

sweet dove
#

Oh hi jess, havent seen you in a while

sweet dove
#

Could be nice as an integrated feature, redirecting you to your pc files. But if ot could work with mods, that'd be great too

radiant lion
#

how i saw it working was like: if you have the mod it adds said decals (by looking at the pictures, perhaps each requiring a certain id) and if someone without the mod loads said build they just don't show up

sweet dove
#

Are you saying that as a possible problem or solution

radiant lion
#

as a possible way for it to be implemented

sweet dove
#

Got it

#

Is it possible to write on the grey boxes that appear with mods and their options?

#

In game

radiant lion
#

i don't think so

#

you can have the lil messages on the right tho

sweet dove
#

Right, so you'd have to be directed to the file. I was thinking writing the file name on the box, and the mod would find it and create a decal

#

Then as the decal was created, it was assigned to the build, so that of someone without the mod downloads the build from the workshop i.e., they'd just have to activate it and the decal appears

#

Not sure if this is possible this way tho

near parcel
#

Mods can't access files outside of their own folder

dapper jay
#

mods SUCK 😡😡

open acorn
formal crane
#

Is TrailCity broken for anyone else? @warm canopy
I am getting constant Failed to call update due to trying to SetScale on a nil object or something like that.

radiant lion
#

It probably used a now purged asset

formal crane
#

Purged assets should return an empty object with a transform to mitigate that exact problem.

radiant lion
#

Then try logging every time it spawns an object, the problematic one will be right before the error

formal crane
#

Yeah I am mainly just bringing it up as this haven't been reported to us by anyone (to my knowledge!) -- so I was just wondering if it was something on my end.

warm canopy
#

Odd as it wasnt broken before

#

This is on live branch?

formal crane
#

Yes.

warm canopy
#

I tested it last when the concave collisions got added

#

And it was working fine then