#General modding chat

1 messages Β· Page 12 of 1

ivory agate
#

I see, I couldn't find anything to get it to work though

scenic echo
regal bear
uncut glade
#

does anybody know how to make these buildings?

cinder spruce
junior widget
#

am i not able to just download it on the workshop itself?

cinder spruce
#

the workshop upload is from jess, he'd have to update it
or he'd have to let me upload this version

#

you can just put the mod from this in the mod directory

cinder spruce
regal bear
#

A new update for Track Creator Plus is now on the Workshop. This includes the new StringAlong tool plus a few minor tweaks. Details in the Topic here: #1404642052129423466

radiant lion
#

Same is valid for any future time

cinder spruce
#

oops i did a dumb
max force value doesnt do crap, its stuck at 75

#

ima fix up some stuff then upload it, with thumbnail as well

cinder spruce
#

very poorly made drawing of the settings

junior widget
ivory agate
#

Wait can you do transparency already by exploiting AA?

#

It just depends on what AA the game uses

topaz arrow
#

should i do a modstructure.destroy() or .despose()? i assume .destroy() but am not 100% sure

#

what is the difference between the two?

radiant lion
#

Iirc one is instant, one does the deletion animation

topaz arrow
#

i assume there still isnt a good way to detect collision vs being despawned?

radiant lion
#

Don't think so

topaz arrow
#

πŸ™

warm canopy
#

Dispose I’ve always found more reliable

topaz arrow
#

Is the modding api somewhere online? Like the lua file with comments and whatnot. Was wondering whether i gotta download it for my phone or i can find it somewhere

#

And is there a way for a raycast to not collide with a specific structure, but to collide with everything else?

cinder spruce
topaz arrow
#

Actually, in what ways can a block disappear? Collision, getting its health mowed down with a gun or sth, what else?

topaz arrow
topaz arrow
junior widget
#

@cinder spruce the mod wont switch through the modes i select, its always just the line formation instead of transforming into the others.

cinder spruce
#

alr gimme a sec

cinder spruce
junior widget
#

might be because im only using three aircraft

cinder spruce
#

the V and diamond are identical while using 3 or less aircraft

junior widget
#

yea when i switch to any other formation it always stays as the line formation

cinder spruce
#

are you able to get a video so i can see what you're doing?

junior widget
#

uh idk if ill be able to send it but i can try

#

idk how to record...

junior widget
#

@cinder spruce does the second wingman need the lighter gray color compared to the first wingman needing the darker gray? or is it the same darker gray color for more than 1 wingman

cinder spruce
junior widget
#

yea its bugging out for me

#

yea like i place one more of my growler with the dark gray color behind me

#

idk

#

its just not working for me

#

it is but its not switching through the other formation modes

#

oh yea for me they dont float

#

maybe thats why

#

the height offset doesnt change anything

#

they are still sliding around on the ground

radiant lion
#

Welcome to tm modding, where stuff doesn't work and noone knows why

cinder spruce
junior widget
#

no i am using the eyeball block

cinder spruce
junior widget
#

like when i put on the v or any other formation mode on other than the line

#

they still make a line formation

#

doesnt matter what i change

#

all they do is go crazy

cinder spruce
#

hmm 2 things

  • what settings are you using?
  • where is the eyeball placed on the build?
junior widget
#

i put the eyeball piece as close to center of mass as possible (basically a block behind it) and also the only settings im changing is the distance and the formation modes at best

cinder spruce
#

rq can you unsub and resub to the mod to make sure u have the latest version?
i really dont know whats wrong

junior widget
#

alright

#

still didnt change a single thing

#

i just turned on the mod and changed nothing other than turn it on

#

and 2 of them just try to jump me

#

i tried changing the distance and that did basically nothing

#

so

#

yea

#

idk why this is happening

#

do i have to place them down in a specific order? or does that not matter

topaz arrow
cinder spruce
topaz arrow
#

I guess ill have to double check, but i swear the anti drag block uses that sometimes and works well

radiant lion
#

You can apply force on a structure, yeah, not torque

topaz arrow
#

Ah yes, makes sense

radiant lion
#

But torque still prefers to be applied near com else the com will receive weird forces

topaz arrow
radiant lion
#

If a clockwise (just 2d) torque is applied, let's say to the right of the com the com will be pushed upwards, at least I'm pretty sure in unity it happens like this

#

Same reason as to why putting the tracker close to missile fins turns sharper than otherwise

topaz arrow
#

Wait, so tracker at the back of the missile = good???

#

That is... very unexpected

radiant lion
#

That's how I remember it, yes

cinder spruce
#

i had an interesting idea for a mod the other day

what if there was a mod that can create a recording and save the position and rotation of a build, and replay that recording by moving the creation through the saved points? could be interesting for custom missions with wingmen of sorts. might also be useful while recording videos

i might be able to try and do this using formation mod as a base

cinder spruce
#

alright ive mostly isolated most of the stuff i need, and added a quick way to step through manually defined frames with positions and rotations

strangely it feels kind of dampened when its travelling in the negative direction, is something up with the PID?

topaz arrow
cinder spruce
cinder spruce
#

alr managed to get something
you can see the footsteps where i ran around to record the path

cinder spruce
#

still need a way to save the replay, and maybe a better way for it to loop.
i had to manually fly through roughly the same spot for a decent loop

#

@hollow depot

hollow depot
#

gah daymn

regal bear
cinder spruce
cinder spruce
#

guh

i think this might explain why the wingmen in formation mod sometimes decide to form up 300m away

scenic echo
cinder spruce
warm canopy
#

Man I need your help with the physics api I made lol, you seem to have mastered pid

elfin yarrow
ivory agate
#

At least the lua stuff works but yeah it's definitely a maybe for all the tm stuff

ivory agate
#

Is there like a visual list of all the spawnables?

#

Or would I have to check myself?

elfin yarrow
#

isn’t there a spawnables document in the same folder as the modding documentation or something?

ivory agate
#

Yeah but that's the names

cinder spruce
ivory agate
#

Hence the check myself

cinder spruce
#

oops wrong reply, mb terror

ivory agate
#

Yeah that's exactly what I meant, thanks

#

I'm assuming all transforms apply to these objects, so like scale translation and rotation

willow hamlet
#

anyone know if theres a planet map kind of mod? that has a round world, water, realistic gravity, and potential for orbital mechanics?

elfin yarrow
#

don't think so, there's at least one planet mod but they don't have realistic gravity or water

#

water is actually just a really big flat plane so you can't have water wrap around planets and such, idk about gravity though, i know there's the orb in the middle of space sector but i'm not sure about modding that kind of gravity in

willow hamlet
#

oki thnx

formal crane
serene magnet
#

I mean it sure would give me motivation to expand my map loader

#

Because currently it's just an optimized fork of trailmappers loader but I wanna add path movement support and such to it

smoky sierra
#

please i need help somone i am trying to import a map from somone else into trailmappers he sent me on dc the full zip file that you put into trailmakers but none of the files including the Map file inside of it are able to be imported into trailmappers

#

any ways to do this from my or his end

paper bone
#

Yes, there should be a Map.json file in the mod your friend shared

smoky sierra
#

let me check

#

no json file in the whole thing

#

ill send ss

paper bone
#

You need to put that file into Documents/Trailmappers/Saves/"your_map_name"/

paper bone
smoky sierra
#

i tried that file it recognises its there bc it doesnt say no file found or whatever but when i click import nothing happens

paper bone
#

The import function is for maps from a different format

smoky sierra
#

ah alr

#

thanks man

paper bone
#

No problem

smoky sierra
#

ah i just needed to convert that file to a json file bc it wasnt one

willow hamlet
#

is there a way or mod to remove clouds on danger zone?

near parcel
#

No

cinder spruce
topaz arrow
topaz arrow
#

What if... you could check for the position of flight control surfaces and engines and whatnot on the build every once in a while, and then limit the forces based on those. Would require making an autopilot that knows how to fly a plane actually, but would make the planes react to damage

#

Would allow the recordings to be more interactive

paper bone
topaz arrow
#

Ye or that, that would give a more realistic feel for it, but would require a lot more math to simulate the angle you wanna have the fins at

radiant lion
#

I've already done that for cars, so applying torque on the surfaces so that they stay at an angle is pretty much done, tho managing to get a plane to go where you want is harder than a car

topaz arrow
# radiant lion I've already done that for cars, so applying torque on the surfaces so that they...

Ngl, i feel the worst part for ai creations flying around would just be having to deal with being a players structure (being able to interact with logic would be nice, but isnt super necessary). Not being able to essentially have a modded player thingy that has their own id for the sake of structures and such would be super painful to deal with, having to check whether it despawned, spawning it back in in the same place, etc

paper bone
#

Yeah using blueprints in mods currently is very jank.
Because the blueprints your mod spawns always need to be associated to a player which causes a whole lot of bugs.
#1385250615340306523 message

topaz arrow
paper bone
#

Yeah would be amazing if we wouldnt have to associate the blueprints to a player.

topaz arrow
#

Or, give us a modded player (like an id of -1 or sth

cinder spruce
#

@paper bone seperated tracks
took a lot more work than i expected wonky

paper bone
#

Ayyy nice

cinder spruce
cinder spruce
#

hmm
does json not play well with vectors?

i cant seem to get it to save properly

radiant lion
#

It might save the dot in the number as a comma instead and that breaks it

paper bone
#

Yeah i believe you can do something like this:

local jsonString = json.serialize(data)
jsonString = string.gsub(jsonString, "(%d+),(%d+)", "%1.%2")
tm.os.WriteAllText_Dynamic(savePath, jsonString)```
willow hamlet
#

Imagine if we had graphics mods or shaders that would be so cool

hexed hawk
#

anyone know if its possible to change the emission strength of the headlamp block through modding? they are never bright enough

paper bone
#

nope not possible

hexed hawk
#

aw that suckss

ivory agate
radiant lion
#

@cinder spruce scrapman used the formation mod v2

#

he forgot to mention it was your version tho

cinder spruce
#

2 scrapman features lsgo

radiant lion
cinder spruce
radiant lion
#

I'm guessing he started with the base one, then realised how unwieldy it is

cinder spruce
#

he had the new version loaded in at the start so maybe he just had the wrong one open on steam

#

anyway i have a few things to change/add
i want to try out a ground mode for ground vehicles so it doesnt shove into the floor

radiant lion
#

Should be as easy as disabling y axis, the code might already be there if I stole everything from the missile logic

rancid epoch
#

Hey, is there a way to interact with functional blocks? Like spin a servo or get the number on a number display through a mod? Or at least send inputs to a creation?

radiant lion
#

Interacting with logic was suggested, but it's not yet implemented

rancid epoch
#

Ok thanks, that would be super cool

radiant lion
#

If need be you can control servos by adding torque and read values with some servo or something+checking the rotation of a block on it, but they are not easy/compact

near parcel
#

You can also spawn objects in front of sensors, but it easily breaks with movement

smoky sierra
#

anyone know if there is a alternative mod to block editor like to get custom colours because the mod just corrupts builds it hasnt worked for a while

cinder spruce
#

don't use the set all or any of the options that say "use at your own risk"
they are kinda unstable and are the ones that corrupt builds

as for the color its an issue with modding which is getting patched in the next update

hexed hawk
#

So im interested in working on modding tm, ive looked around but i could finde how to make a mod using the lua

#

i found it

#

question, i dont think so, but is it at all possible to change the color of bullets? i doubt it but itd be cool

#

is there a list somewhere of the blocknames for modding?

cinder spruce
warm canopy
#

Anyone know the dimensions of maps, like test zone etc. Grid squares. Its been discussed before but I cant find it

paper bone
#

Test zone is 15000 x 15000 iirc

fallow fox
warm canopy
#

test zone square you mean the large grid squares?

fallow fox
#

its from center of the black line to the center of the black line on the other side

warm canopy
#

I think this scale is ok, from looking ingame its about 4 barrels per small square

warm canopy
#

Do you happen to know the y heights of the maps?

fallow fox
warm canopy
#

No I mean the spawn height

#

like test zone I think is y 300

fallow fox
#

test zone is 300, dont know about the other maps but the water is always at 0

formal crane
warm canopy
#

Going to call it approx 200 for stranded

topaz arrow
radiant lion
#

Can't confirm it tho

#

Unless that was from the bottom of the sea

karmic oxide
#

oof, sorry bout that trailmakers 😬 first time mod maker, tried making a team sensor block

#

I've realised where I went wrong, wont do that again πŸ˜…

uncut glade
#

anybody know why my cone is purple?

radiant lion
#

These latest updates the Devs have been removing some unused assets from the game files, I'm guessing they removed the texture but not the model

regal bear
#

Are you running the game with low quality settings? Some prefab assets have missing textures at lower quality settings.

sturdy iris
#

hey im trying to make my first mod but im having a hard time making the main.lua file and idk how.

fallow fox
sturdy iris
tribal gate
#

I'm trying to make a mod that spawns a line at a block and rotates it so it aligns with it's face but I can't figure out how to rotate it correctly does anyone know how to get the line to be positioned and rotated so that it looks similar to the red one image

hexed hawk
tribal gate
hexed hawk
#

coolio

tribal gate
#

If i finish it i'll upload it to workshop if you want

hexed hawk
#

up to you

cinder spruce
tribal gate
#

that code is a temporary solution, it spawns multiple lines in different directions instead of one line in the right direction. and I removed the code for rotating since it wasn't working and I needed to fix other things

cinder spruce
tribal gate
#

thanks I found it

cinder spruce
#

also you should use SpawnObject for spawning prefabs, iirc SpawnCustomObject is for custom 3d models

tribal gate
#

also I have just checked and GetRotation is only accurate when in build mode, once the block is out of build mode GetRotation will still get the rotation of the block but it will only return the rotation the block was in when it was last in build mode

sturdy iris
#

what did i do wrong?

cinder spruce
formal crane
sturdy iris
cinder spruce
#

yeah the button setup looks like this, you dont need anything in data if you dont have any value to pass on

formal crane
#

i am forgetting how lua works but could also be you need to define your SetGravity function before the AddUiButton reference.

sturdy iris
#

thank you frans!

cinder spruce
formal crane
#

right haha

near parcel
near parcel
cinder spruce
# tribal gate I'm trying to make a mod that spawns a line at a block and rotates it so it alig...

here's what i think you should do,
this model is just a simple cube, 1 x 0.1 x 0.1, with its origin at one end of cube
makes it a bit easier to position and orient the line, since the origin is at the end.

you can load it with tm.physics.AddMesh("line.obj", "line") and spawn it with tm.physics.SpawnCustomObject(pos, "line", "")

as for the block rotation, i believe it is in local space strangely

cinder spruce
# tribal gate also I have just checked and GetRotation is only accurate when in build mode, on...
function GetBlockRotation(block)
    local forward = block.Forward()
    local right = block.Right()

    local relativeX = forward.x
    local relativeY = -forward.y
    local relativeZ = forward.z

    local angleradY = math.atan2(relativeX, relativeZ)
    local relativeangY = math.deg(angleradY)

    local relativehori = math.sqrt(relativeX * relativeX + relativeZ * relativeZ)
    local angleradX = math.atan2(relativeY, relativehori)
    local relativeangX = math.deg(angleradX)

    local W0 = tm.vector3.Create(forward.z, 0, -forward.x)
    W0 = W0 * W0.Magnitude()
    local U0 = W0.Cross(forward)
    local Angle = math.atan2(-U0.Dot(right), W0.Dot(right))
    if Angle < 0 then Angle = Angle + math.pi * 2 end
    local relativeangZ = math.deg(Angle)

    return tm.vector3.Create(relativeangX, relativeangY, relativeangZ)
end

here i made this function based off something from jess's mods, it gets rotation from a block in world space from the forward and right vectors

tribal gate
radiant lion
#

But if it works it works

sturdy iris
#

how would i go about making it so that i kill all players alive?

paper bone
#

using a for loop and looping over the table that is returned from tm.players.CurrentPlayers()

sturdy iris
paper bone
#

with a for loop
maybe look at the lua documentation for a introduction to the language

formal crane
# sturdy iris but how do i make it so it goes through the list/table?

quick lua from memory so might be wrong

--first get the player list
local players = tm.players.CurrentPlayers()
for i, player in ipairs(players) do
  -- now `player` is one element in the players list

  -- you can get the playerId from the player object
  local playerId = player.playerId

  -- then call KillPlayer for _that_ specific player
  tm.players.KillPlayer(playerId)
end
-- this will be done for each element in the `players` list
sturdy iris
formal crane
#

first trryyyyy

elfin yarrow
#

will there be thingy to do block bans in the next update?

elfin yarrow
#

aww

#

would be great

formal crane
#

(but i very, very much wanna look into it)

warm canopy
#

I also would love that feature

elfin yarrow
#

can i just shove like a null value or something on that last one, i don't want a sprite

warm canopy
#

Yeah

#

You can just leave it as ""

elfin yarrow
#

oh okay

#

it still fails to invoke ui callback lol

cinder spruce
#

just remove the last argument entirely

elfin yarrow
#

i mean, yeah it worked with only 2 parameters (header and the second thingy) but someone said to fill all 4 parameters to fix invoke ui callback

near parcel
scenic echo
paper bone
#

Whenever we suggest a new modding feature to frans we now must always present how it specifically would make it easier to make campaign mods :P

elfin yarrow
#

with the persistence of data on the mods (idk what it's called, where you leave a session but the mod still keeps track of stuff) you can probably make a block ban presets mod too

#

but for now, i'm gonna try making a mod to reload custom unguided weapons like bombs by spawning the blueprint under the player with an adjustable offset

that's the plan at least, i don't have the slightest clue as on how to implement that

topaz arrow
warm canopy
#

The current method of destroying peoples builds if they use the wrong block is a very rough approach

formal crane
elfin yarrow
paper bone
formal crane
#

just give me a tech tree mod man

#

KSP style researching or whatever

topaz arrow
elfin yarrow
paper bone
#

If we could change the skybox we could make a better more realistic space map

topaz arrow
#

having builds belong to no player/modded player could allow for custom enemies on the map... (if this was possible i would so make AI enemies for the Custom missile mod)

topaz arrow
# paper bone Or traffic

that too, tho for enemies i think its even more clear, as stuff like locking on with autolock wouldnt work on builds from the same player (maybe? am actually not sure, but i assumed so since same team and whatnot)

paper bone
#

No i think it only doesnt target a build when there is a player of the same team inside (atleast from my in game experience)

topaz arrow
#

maybe, i dont remember, havent used autolock in a while

paper bone
hexed hawk
#

just wondering before i start later, but is it possible to adjust the power of the propellors? ive seen it for the jets and thrusters, but never seen one for the propellors at all

warm canopy
#

ModBlock.SetPropellerPower(power)

sturdy iris
#

how do i make it so i can use the ModStructure.AddForce(X, Y, Z) i have tried alot but i can manage to get it to work can anyone help? and just in general the ModStructure

radiant lion
#

Can you be a bit more specific? What's the plan? All modstructures or a specific one? What about the modTransform, that has nothing to do with structures

sturdy iris
#

and with modtransform i mean modstructure my bad

radiant lion
#

Ok, that's decently straightforward, you have to call tm.players.GetPlayerSeatBlock(playerId) to get the seat a player is in, it will return either nil or the ModBlock of the seat (add a check), at that point you can do ModBlock.GetStructure() and add force on said structure, if you want a constant force do it in the update function, else do it wherever

sturdy iris
#

im trying but i dont know how to continue from here.

radiant lion
#

Do you have the docs at hand?

sturdy iris
radiant lion
#

ok, that's good

radiant lion
# sturdy iris im trying but i dont know how to continue from here.

first tho, here tm.players.GetPlayerSeatBlock(playerId) returns the seat as a ModBlock, you are gonna have to store it somewhere, same for the structure, so either do something as simple as

local structure = seat.GetStructure()```
or you could do directly 
```local structure = tm.players.GetPlayerSeatBlock(playerId).GetStructure()```
sturdy iris
radiant lion
#

just structure.AddForce(x,y,z)

#

in the docs the name ModStructure is a placeholder for whatever variable that contains a ModStructure you have

#

same for the other classes

sturdy iris
#

it works! thank you so much ive been trying to figuer it out for the past 4 hours.

sturdy iris
cinder spruce
topaz arrow
cinder spruce
#

@warm canopy
?

elfin yarrow
sturdy iris
cinder spruce
#

i believe whatever host he's using kicked him out

sturdy iris
#

hmmm why is it not working? it should work i think but i keep getting failed to invoke UI callback

cinder spruce
#

playerid doesn’t have any functions, its just a number

#

i believe you can get transform from a function under tm.players.GetPlayerTransform or something

#

i cant check docs rn cuz terrorsouls site is down :(

formal crane
#
tm.players.GetPlayerTransform(playerId).GetPositionWorld()

something like that

sturdy iris
scenic echo
cinder spruce
sturdy iris
#

okay it now works. i used: tm.players.GetPlayerTransform(playerId).SetPositionWorld(TeleportX, TeleportY, TeleportZ)

sturdy iris
sturdy iris
#

hmmm it only works when im not in a seat is there anyway to make it with the whole vehicle?

cinder spruce
#

only apply forces, which is what formation mod does pretty much

sturdy iris
radiant lion
radiant lion
warm canopy
#

Don’t panic I’ll fix it when I’m home. I’ve been out all day

#

Hosting autobill didn’t go through so they suspended my account temporarily

cinder spruce
#

rip

warm canopy
#

Should be fixed now

scenic echo
scenic echo
#

@warm canopy I didn't know you could submit guides on your website, that's super cool

regal bear
sterile escarp
#

YO can a trailmaker get some help

radiant lion
#

The preview image has to be less than 1mb

sterile escarp
paper bone
#

there should really be some more instructions when uploading a mod lol

radiant lion
#

Or at least better errors...

radiant lion
#

Loose some quality, but it's no big deal

sterile escarp
paper bone
#

Changing things in that folder wont make a difference

sterile escarp
#

so I need to find it in trailmakers directory somewhere

near parcel
#

install_dir/mods/mod_name

paper bone
#

You need to change the preview image that is in the folder with the name of your mod here

cinder spruce
#

that looks like a peak map might have to check it out later

topaz arrow
#

ok, in what units is the force? newtons? what is the gravitational strength (at 1.0 gravity)?

from my experiments, power of around 2.1 (2.1*deltatime applied every update) seems to make a 0.8kg pipe levitate, but the acceleration seems to be 14 m/s^2, at least if my acceleration based on velocity based on position shows, but like, that is incredibly chaotic and weird and idk if units are wrong or if im a dumbass or whats going on

cinder spruce
#

14m/s/s is the correct gravity in TM

topaz arrow
#

hmmm, that is very weird

#

ok, so eyeball math:
V/0.8kg=14
V=11.2
2.1*X=11.2N
X=16N/3

so one TrailNewton (as in the unit strength you use in the addforce function) is roughly 16/3 newtons

#

but measuring it with a different method gives 4.97ish as Newton to TrailNewton ratio?

topaz arrow
#

crisis resolved, the weight was actually 0.15, not 0.8

cinder spruce
#

wth

scenic echo
hard shore
radiant lion
#

Shows up here

formal crane
scenic echo
#

I see it now too, i guess it just took a long time

cinder spruce
hexed hawk
#

will we ever possibly get a way to make custom light sources for maps?

scenic echo
hexed hawk
scenic echo
hexed hawk
#

specifically a LED floodlight

cinder spruce
#

theres only a few objects that give off light,

  • Chest
  • Lava
  • Flamethrowers
  • Salvage
  • Power core crate

you could try experimenting with those

#

at least those are the ones i found

hexed hawk
#

only the powercores give off blue light, and i need white

#

8 powercores to make that light

cinder spruce
hexed hawk
#

its better...

#

i wish there were more colors, but i also wish alot of things, thanks for the tip AJ, it it greatly appreciated

#

also, AJ, these give off a small amount of light too

cinder spruce
cinder spruce
#

nah this doesnt feel like trailmakers anymore

cinder spruce
radiant lion
#

You are forgetting angle of the light cone

scenic echo
#

can anyone give me an example of how to read information from a file and write it into a table with mods? i haven't really used it so idk how to do it.

near parcel
#
local content = tm.os.ReadAllText_Static("foo/bar.txt")
tm.os.WriteAllText_Dynamic("foo/bar2.txt", content)
cinder spruce
#

i suppose a spotlight could be something seperate

cinder spruce
# scenic echo can anyone give me an example of how to read information from a file and write i...

the moonsharp json lib is probably what you need

you can use json.serialize(table) to convert a table to a json string, and you can use the functions given by alva to actually write the data to the data dynamic folder.

to read the data and convert it back to a table, you can use the read function, and use json.parse(string) to get the table back.

local data={}

function saveData()
    local jsonString = json.serialize(data)
    tm.os.WriteAllText_Dynamic(β€œsave.json”, jsonString)
end

function loadData()
    local jsonString = ReadAllText_Dynamic(β€œsave.json”)
    data = json.parse(jsonString)
end

something like this i think

scenic echo
fallow fox
cinder spruce
#

i probably messing something up i did that from memory

#

uhh

cinder spruce
tribal gate
#

Does anyone know why the object spawns farther ahead of the block when the player isn't near the build. It only spawns correctly if it either isn't moving or the player is near it.

near parcel
#

objects far away from the player update less often

tribal gate
#

then should I make it have an offset that scales with the distance

#

wait but if they update less often when are they in front of the build instead of behind

hexed hawk
#

is it possible to affect player fov in first person with a mod?

fallow fox
#

is there a list of all spawnable object names?

radiant lion
#

tm.physics.SpawnableNames()

fallow fox
#

thx

cinder spruce
#

i think in 2.2, spawnable names, audio names, and docs are auto generated in the mods folder from now on

neat

cinder spruce
#

imagine we could have space sector render distance in other maps
you could literally see stuff from miles away

willow hamlet
#

is there a mod to lower some drag of blocks?

topaz arrow
# willow hamlet is there a mod to lower some drag of blocks?

afaik not a dedicated one, but it can be done with mods. the experimental branch of the custom missile mod has something kinda like it, but its done in a janky way and is meant for building missiles only. i know that @radiant lion is messing with a properly made custom drag blocks for the new custom missile mod, but its not yet available.

if you have some basic knowledge of modding or just programming, it shouldnt take long to make a mod like that yourself

formal crane
#

@cinder spruce told me this was great reveal, so sharing Stino's clip here to show the new UI option πŸ™‚

scenic echo
sturdy iris
#

peak cant wait for that new UI

radiant lion
scenic echo
#

Is there a way to know the drag of blocks without having to calculate it?

elfin yarrow
topaz arrow
scenic echo
#

does ModBlock.GetMass() give the weight of the blocks? i'm having trouble using it, like the weight is around 5 times less than the in game weight

elfin yarrow
#

-# disclaimer: untrusted source, me

formal crane
#

Sounds pretty correct
-# disclaimer: I actually dont fully know, but I can see it returns the RigidBody Mass but I dont have the full overview of what "weight" actually yet. You might be missing some additional value to figure out the actual "weight".

scenic echo
#

on the block 1x2 it's accurate if i do ModBlock.GetMass() * 5 but for straight suspension i have to multiply by 10 to get the accurate weight

#

why does everything have to be inconsistant

fallow fox
scenic echo
fallow fox
scenic echo
ivory agate
#

how does parenting work? since you can't set the transforms yourself you'd have to do something else

#

Do you need to like make the matrices then convert them back so you can supply the r, t and s manually?

radiant lion
#

Parenting was suggested, but as of now that's the best you can do, set the transform values every frame based on those of the parent and an offset you give

serene magnet
#

More UI!!!

hexed hawk
#

at some point would someone be willing to help me set up the modding stuff? i haven't been able to figure it out

fast oyster
#

what is an acceptable amount of vertices for a custom map?

fast oyster
#

guys my map isnt mapping

#

@cinder spruce do u know the problem?, sorry for tagging u if ur busy or something

paper bone
#

Thats too many triangles

#

At some point if the model has too many triangles trailmakers will just do bs like that

fast oyster
#

whats the max amount?

fast oyster
paper bone
#

I dont actually know

fast oyster
#

i guess trial and error is the only way

#

10k tris works fine

sturdy iris
#

I think it's like max 1 mega byte but idk

scenic echo
fast oyster
#

is there anyway a icould anchor a 3d model to a build?

scenic echo
cinder spruce
#

1000 workshop mods πŸŽ‰

hexed hawk
cinder spruce
hexed hawk
#

oooh, too bad i thought you were cooler lol

(this is a lie, youre sick xD)

#

anyways, can someone tell me how to access the modding API? i cant figure it out

#

ive been given links to the Wiki page, it dosent help

#

please someone?

#

ok, ummm, how do i save the code and get it into trailmakers? i found the mods folder and saved my mod to it, but its not showing up ingame

#

@cinder spruce how doeth i get a mod ingame?

topaz arrow
#

this is how u enable them

#

in the mods folder, add a folder, name it sth, then into that add a main.lua file

hexed hawk
topaz arrow
#

the code of the mod

hexed hawk
#

it now shows up in game, but it didnt work, im cheking my coding now xD

hexed hawk
#

does anyone have a list of all the blocks/ what they are called for modding? im trying to detect if someone uses more than 2 large flak

#

i cant find the block ID

sturdy iris
#

I don't exactly remember how

topaz arrow
topaz arrow
ivory agate
#

I don't remember if that was tri count or unique vertices

paper bone
#

no idea

cinder spruce
ivory agate
#

Why would it be singed?

#

Thats actually so weird

fast oyster
#

Is there anyway I could get ps5 grass on pc?

gritty jasper
#

do you guys have any menu api or yall use the unity debug UI?
I think I might port mine and make it open source, tho it uses ML

sturdy iris
#

it uses lua

gritty jasper
#

alr

candid crescent
#

Is there any way to make a mod that allows you to use any seat underwater?

topaz arrow
candid crescent
sturdy iris
ivory agate
radiant lion
#

It's for the preview image

ivory agate
#

How fast is it to set the position rotation and scale for an object? I'd like to have an idea before even bothering with some ideas I have

#

(I can precompute the transformations so that part is not a big issue)

#

(the project in question is kind of related to this :3)

scenic echo
ivory agate
#

Oh

#

Id need like at least 100

radiant lion
#

You can try but I doubt 100 will be very good for performance

ivory agate
#

It might not be possible then unfortunately

#

They'd need to be updated at least 30 times per second unless there is like a way to do lerping at a native framerate

fallow fox
#

how do you upload mods? mostly how do you set the thumbnail and description?

warm canopy
#

If the custom object is a rigidbody then you’ll get much smoother frame rate

ivory agate
#

It won't need phyiscs

#

As I said, all movements are known

#

Unless that somehow changes things

warm canopy
#

If it’s a custom object though even if it’s static , if it’s a rigidbody it’ll sync with the physics engine

#

Much smoother movement than if it wasn’t a rigidbody

ivory agate
#

Okay so would keyframing be "static"

#

or a rigidbody?

warm canopy
#

What are you trying to make?

ivory agate
#

Just something that can replay animations

#

So given
Pos A at time 0
and
Pos B at time 1
I would need to interpolate linearly between them

warm canopy
#

Okay, but what I’m saying is that if it’s a custom mesh and set to rigidbody. You won’t get the teleporting affect like you do when it isn’t

ivory agate
#

So what does it look like when using a rigidbody? can you explicitly tell it how to interpolate or does it just do it automagically?

warm canopy
#

You can use the lerp function

radiant lion
ivory agate
warm canopy
#

tm.vector3.Lerp(vector, otherVector, t)
Linearly interpolates between two vectors.

Parameters:
vector ModVector3
otherVector ModVector3
t number
Returns:
ModVector3

ivory agate
#

Wait I don't see how this would make it smoother? since this is just lua side right

warm canopy
#

If you are just updating the position normally every frame but the object is set to rigidbody it will be smoother

#

Try it

ivory agate
near parcel
#

It's a function on vectors

exotic nacelle
#

Are there any guides floating around on how to make a custom map?

#

Probably won’t actually end up making one but I’d love to give it a try

exotic nacelle
#

Ty!

exotic nacelle
#

are custom maps constrained to the borders of the test zone?

#

im guessing so

scenic echo
exotic nacelle
#

Alr

ivory agate
#

There's no way to do stuff in clip space right? I know I'm asking weird questions but like I'm mostly just thinking about stuff

Would mostly need that since it's not possible to get all the variables that go into defining the camera right? I guess the best I could do is just get the camera data and have all the data I can't get be manual for the player to adjust or something

#

Though I didn't see anything on how to get the camera data

#

and you can't seem to get the mouse position (only when it's down or up), hm

warm canopy
#

You have to do something really janky to simulate mouse controlled look direction

ivory agate
#

Yeah that's what I thought

warm canopy
#

You have to basically create a camera rig seat that uses mouse input for movement then measure the players rotation

ivory agate
#

guh

formal crane
ivory agate
#

Added function to interpolate between colors
tm.color.Lerp(ModColor a, ModColor b, float t)
Is this just (a + b)/2 or is it the square root correction thing that literally no one gets right

serene magnet
ivory agate
#

Okay yeah then it's probably the "incorrect" (but standard) one lmao

formal crane
#

But yeah colors always bad everywhere

ivory agate
#

Well this is another version but I see no reason why they would ever change it

radiant lion
#

pretty sure a few minor things are missings

formal crane
#

Forgot the fixes DoggoScream
#1441041011970281533 message

#

But they added now

radiant lion
#

like the getDefaultDrag or quaternion equals

ivory agate
#

But I'm not sure

radiant lion
#

no, i mean from the changelog

ivory agate
#

oooh okay

#

nvm

#

my bad

formal crane
radiant lion
#

also the set wind is missing

formal crane
#

DEAR LORD

radiant lion
#

:)

formal crane
#

Done!

radiant lion
#

serious question, how are the changelog made? memory, some list stored somewhere...

formal crane
#

We are actually talking about how do do it better overall for the game.. As it is hard to parse commit messages into changelogs. And sometimes things are a registered task.. Sometimes it it made adhoc.. So it is REALLY hard to track changes.

radiant lion
#

i see

formal crane
#

The formatting completely fucks up copying from Confluence to Discord so that is intensely annoying.

radiant lion
#

time to make a script that converts from comfluence to discord then

formal crane
#

I would love to know how other game companies does it πŸ‘€

formal crane
radiant lion
#

i was thinking more of an external app where you paste the stuff from confluence and lets you copy a re-formatted version for discord

near parcel
# formal crane I would love to know how other game companies does it πŸ‘€

In OSS projects at least semantic commits work well. Tldr: enforce commit messages to follow the syntax <type>(<scope>): <description> (it's a bit more flexible than that), then you can use pre-made tools that take those commits and split them into lists of features, fixes, breaking changes, etc, potentially divided by scope

formal crane
#

You also have to remember more than half the commits are artist doing "Updated model.fbx" or whatever and you can only get SO FAR with semantics like thos

near parcel
#

chore(models): update X.fbx. Then it's a simple filter (usually tools already filter out all chore commits, also works for formatting, refactor, update libraries, ...)

formal crane
#

It took us 2 years for people to add links to the related task URL so not sure how long this would take for people to get in the habit of :p

radiant lion
#

while here can you explain this

Player userdata will now contain Player Id, Player Profile Id and Player Name.
pretty sure the logs don't explain what the components of userdata are and stuff like .name .username or .profileId isn't working

near parcel
#

If you want to get changelogs somewhat automatically, you need to enforce some consistency somewhere. If you can only assume commits are random letters you can't do much without and over-engineered AI that can generate descriptions from raw diffs. There are tools to automatically validate things if they don't match the syntax to help enforcing it

formal crane
#

The docs will include this in later version; I just haven't landed the new docs yet!

ivory agate
scenic echo
#

Did setting health get fixed?

ionic jacinth
#

These modding additions are very interesting and will probably get me to do modding again.
The setdrag functions for blocks will be especially useful for rebalancing certain blocks using an excel spreadsheet and for incentivising players to use certain blocks over others: e.g adding drag penalties for thick wings so that gliders have skinny wings like in irl (aka narrow 'wing chord').
The wind function will also be super useful, although a per player version would still be appreciated!
Overall this is the right direction for trailmakers to head in!

formal crane
warm canopy
#

Updated the functions on my modding site

surreal junco
#

After update, spawn locations on custom maps are broken

scenic echo
surreal junco
#

my map oflex offroading experience extended

#

it is spawning at 0 instead of at the spawn point

#

not sure how to fix it

#

I used trailmappers

#

it is only failing on the first instance

#

after that, holding backspace lets you get to the right spot

#

just thought it was an odd behavior

warm canopy
#

Havent had this issue even with trailmappers maps

surreal junco
#

that is the message every time someone joins

warm canopy
#

Whats the error in the your mods folder (.log file)

scenic echo
surreal junco
scenic echo
surreal junco
# scenic echo it's in the mods folder

2025-11-20T13:03:51.4714219-05:00 failed to invoke OnPlayerJoined
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.

formal crane
surreal junco
# formal crane 1. send link with map 2. write me exact steps to reproduce it will check it out ...

Thank you https://steamcommunity.com/sharedfiles/filedetails/?id=3563372295 To reproduce it, start the map, with the name 0ff Roading w/banned blocks, turn on player deaths, ban all the blocks that are flight or gyro blocks, and closed seats. then when people join, it has them join at 0,0 instead of the spawn point, and has the error message Failed to invoke on player joined. Could be an issue with the spawn location piece in trailmappers

#

That token has always been weird anyways. It makes people spawn on top of each other, no error handling.

near parcel
#

what is tm.color.RGBToHSV supposed to do? It takes rgb values as input, but since it returns a mod color you can only get rgb values out and it should behave exactly like the normal .Create() constructor (specially since the alpha arg on that is optional). Currently it seems to always return RGBA(0,0,0,0) as well

radiant lion
near parcel
#

my IDE docs have been updated

sturdy iris
#

im trying to randomise a vector 3 for the new wind function but i recieve this error

formal crane
#

also you invoke randomWind() with no args, meaning no numbers, which throws your error

sturdy iris
#

okay i fixed it now (i shouldnt have asked GPT for help)

warm canopy
sturdy iris
#

i will upload my whole project when im done and have published it :)

hoary skiff
#

Holy Jesus over 11k messages in this forum chat I never check

warm canopy
#

Having issues with hosting provider, they randomly decided to rollback the whole server overnight 😠

warm canopy
#

Fixed. Lost some snippets that I added but thats about it.

scenic echo
scenic echo
scenic echo
warm canopy
#

Yeah, host has really made this complicated

warm canopy
#

Try now?

scenic echo
warm canopy
#

Functions area got updated, now relying on alva's functions since they have more info. Also various other additions to the site to hopefuly make it a useful resource

tribal gate
scenic echo
#

No idea, i can't either

scenic echo
tribal gate
#

thanks

sturdy iris
warm canopy
surreal junco
#

Is there going to be a new trailmappers mod at some point with the new assets? I would love to be able to make my own snow or ice map.

serene magnet
#

It's being worked on but will take some time as hampta seems to be pretty busy

stiff falcon
#

i need help

#

whats the gravity call i would add to a mod that will take the world gravity value

sage orbit
#

is stinos sled mod available?

fallow fox
regal bear
stiff falcon
hoary skiff
#

I never read this chat before

formal crane
sturdy iris
#

ive been trying for a bit but i cant seem to get a simple looped timer going that works with a Boolean and then call a function can anyone help me with that?

scenic echo
scenic echo
#

how can i get the forward drag from ModBlock.GetDragAll() and from ModBlock.GetDrag(aerodynamicBoxIndex)? i'm having trouble with them

formal crane
willow breach
#

Hello does anybody want to help me with track switches? Im not very good at coding. The reason why, I have a two month map project that sadly does not work after the update. If someone could help me to make a custom train switch, where the player can decide where to go, would make my day.

upper niche
#

Would it be possible in any way to let a VR headset and/or controllers control a build? Totally not because I want to turn into a Dreadnought I made

paper bone
#

Not through the modding api. You could try and use some kind of layer to translate your controller inputs into something readable by the game. But i dont really know much about how that works exactly

regal bear
regal bear
#

It might be easiest to simply switch "setIsTrigger" on and off for parts of your switch tracks depending on which way you want the train to go

sturdy iris
#

@warm canopy the libraries on your website dont work btw (translated: File was not available on the site)

warm canopy
scenic echo
#

right now i kind of want to make a mod the adds stalling to trailmakers, just really simple if the aoa is over 25 degrees it makes all blocks have 20% of the drag up and down but the thing that i don't really know how to do is modifying the up and down drag of the creation without modifying the forward and backwards or sideways drag of it. So if i change the bottom drag of every block it will change the bottom drag of every block but if a block is rotated it will not be the the bottom drag being changed, compared to the vehicle

radiant lion
#

Easies way is probably to compare block rotation to player rotation, and you either just use some Ifs for the 90Β° if you want something simple, else you'd have to use sin and cos to also get the odd-rotated blocks

scenic echo
radiant lion
#

Oh right, yeah, you can do that

#

Not exactly sure how it works with stuff on hinges tho

regal bear
#

@formal crane Just to confirm - we can't use SetIsTrigger() on objects spawned with tm.physics.SpawnCustomObjectConcave right?

formal crane
regal bear
formal crane
warm canopy
#

Do you think people would be interested in a faction-like territory mod? It requires using my trailbridge client for the server host. Basically factions would have territory that they can claim etc. Not sure how Id fully handle whats considered territory etc

dusty umbra
#

Ok that sounded mean, just we might get more cool stuff next year that would make that idea cooler. (not confirming anything, just speculations so far)

elfin yarrow
dusty umbra
#

I said to much, I'm out, Frans save me

warm canopy
#

Id love some sort of way of mods storing to a central data point that. It opens up a bunch of possibilities. My trailbridge app all it does is read an inbox.json file and an outbox.json file

near parcel
#

I would rather that not be a thing at all. Too many security/privacy considerations to be worth it imo

warm canopy
#

As in what?

#

If you are filtering the data server in between

near parcel
#

It's essentially a reverse proxy into a network. If you can connect to an arbitrary network server, you can also connect to anything that's exposed in the LAN as well, or any other process on localhost

warm canopy
#

The app doesnt open any inbound ports etc

#

Mods cant tell the app where to connect either

#

Unless you are referring to how the devs would implement it

near parcel
#

The mod has to be able to, and that runs locally on the server process. If the mod can connect to an arbitrary 3rd party server, it can open a connection to anything visible by the computer running the mod (LAN/local processes)

#

The mod can't work as a server for your central DB because it would be behind a NAT pretty much always

warm canopy
#

Thatd be like peer to peer though

near parcel
#

The only option would be for the DB to be the normal backend, but you would only get a key-value store at best as the devs obviously won't allow you to run arbitrary code on their server, and good luck managing which mod should access what data with a single DB server

near parcel
warm canopy
#

Currently trailbridge implementation is a key-value store. Its not ment for large peices of data being shared. Its done like this for security. Im not sure on how the devs could implement a solution, was just throwing the idea out their. It would be a nice-to-have in terms of allowing for native sharing of leaderboards etc

#

I have seen it successful implemented in games like roblox with data stores etc

#

I guess one issue is that the main.lua can be viewed by anyone

near parcel
#

What it implements is irrelevant. You need to store data somewhere, and the only options for that are:

  • Use a central, 3rd party server: mods need to be able to connect to it, and since it's not known ahead of time mods need to be able to open connections to anything
  • Use a central server hosted by the devs: you wouldn't be able to run any code in the DB server, and key management would be a mess since mods don't have IDs to scope keys. It likely could also only be used within the game
  • Use p2p, decentralized connections: you aren't gona have a global view of the data, so not much different from each host having their own data (specially since you have no way to syncronize clients, so at best you would just be able to write on clients of the tm server)
near parcel
warm canopy
#

Could the steam id of a mod be used as a unique identifier

near parcel
#

No, because you can have local mods

warm canopy
#

The way I do it currently is I have an api key. But idk. Yeah 3rd party server not a good idea nor is p2p

cinder spruce
scenic echo
#

in what way were custom models limited in tm?

regal bear
scenic echo
sturdy iris
scenic echo
sturdy iris
#

65536

sturdy iris
#

does ModBlock.SetDragAll only affect aerodynamics or also things like grip with the ground?

formal crane
sturdy iris
#

once again getting this and i dont have a clue how to fix it... C:/Program Files (x86)/Steam/steamapps/common/Trailmakers/Trailmakers_Data..\mods\Choas Mod 0.1\main.lua:(101,4-60): cannot convert a userdata to a clr type System.UInt32

dapper jay
#

what is playerId?

#

it should be a number but it probably isnt

#

@sturdy iris

upper niche
#

Has anyone tried to make a mod to add actual armor against explosives?
AKA, explosions can't hit stuff behind blocks
To make them less stupidly OP

sturdy iris
dapper jay
#

can you show how you are calling Nofriction?

dapper jay
#

Nofriction gets called with a UICallbackData

#

not just a number that represent's the player's id

#

so youd have to do

function Nofriction(data)
    local structure = tm.players.OccuipiedStructure(data.playerId)
    --blah blah
end
sturdy iris
sturdy iris
upper niche
#

aight

dapper jay
#

cant edit the explosion code so its impossible

sturdy iris
dapper jay
#

make what?

#

your own explosions?

sturdy iris
dapper jay
#

i dont understand how that would solve anything?

#

that would still just use the games's own explosions(which we want to replace)

radiant lion
#

I guess you could spawn a bunch of tiny explosions at the end of the rays, but it doesn't seem neat at all

scenic echo
elfin yarrow
scenic echo
sturdy iris
scenic echo
sturdy iris
#

i mean i could try to make em or we

topaz arrow
scenic echo
#

Now, with the new api i should try remaking it

dapper jay
#

Whats different in the new api

elfin yarrow
dapper jay
#

wow thats crazy

scenic echo
# dapper jay Whats different in the new api

Stuff, i know you can now get the name of a player, you can read chat messages and send chat messages, you can check the drag of blocks and set it, coloring now can color every block, there is new ui that makes big text in the middle of screen appear and other stuff i dont remember

dapper jay
#

i see

paper bone
narrow acorn
#

tysm

scenic echo
narrow acorn
#

doesnt have sound in 2.2 at least

scenic echo
narrow acorn
#

ye oke

#

and i dont know what current keybind is suposed to do doesnt do anything in 2.2 it seems

#

o nvm

scenic echo
#

Is there any sound that sounds like a gun? Also is playing sounds every tick a good idea?

tribal gate
#

Does anyone know if there is a way to check whether or not a raycast hit a ModBlock without going through every block.

dapper jay
#

no :)

tribal gate
#

No as in you don’t know or it isn’t possible

dapper jay
#

not possible

tribal gate
#

Is is possible to check if it hit terrain instead then since that would also be less laggy

dapper jay
#

also no

sturdy iris
#

You have the options:
Didhit > boolean
Gethitnormal > no idea what that does
Gethitposition > modvector3
Gethitdistance > float
Tostring > no idea what that does

radiant lion
#

The normal is basically a vector perpendicular to the surface.
To string will make it into a string, not sure how it's formatted, but it's likely a combination of the other datas

paper bone
#

To string will always return: "Trailmakers.Mods.Api.Proxies.ModRaycastHit"

dapper jay
#

that doesnt sound very useful

near parcel
#

it's likely the default implementation

topaz arrow
warm canopy
#

Can't edit existing messages

scenic echo
topaz arrow
warm canopy
#

Nope

scenic echo
dapper jay
#

has anyone tried putting ascii art in chat

scenic echo
sturdy iris
scenic echo
sturdy iris
scenic echo
sturdy iris
scenic echo
warm canopy
regal bear
scenic echo
#

What is the difference between ModBlock.GetDragAll() and ModBlock.GetDefaultDragAll()?

radiant lion
#

Current Vs default drag

formal crane
radiant lion
#

@scenic echo here's what i use to store data, there aren't many comments, but the most important functions are the encode/decode ones, they want the modBlock, start bit (1-81) and some other parameters depending on what you are storing

scenic echo
#

I found something interesting, if you set the health of blocks to 1 for example, from guns they will still take the same damage but from collisions they act like they have 1 health

formal crane
scenic echo
formal crane
#

It is in the backlog of coming changes, just been a lot of things in works lately πŸ™‚

latent pine
#

can tm mods have header files or does everything have to be included in the main?

formal crane
latent pine
#

ah nice

#

that should clean up my structure quite a bit

near parcel
dapper jay
#

someone should make a mod that lets me tell chatgpt to generate me an awesome sportscar only for it to be a brick

latent pine
#

is making a new label the only way to have multiple lines in a ui element? using \n or \r\n seems to get ignored (including the text after it)

latent pine
#

would be nice to be able to have text blocks that are multiple lines, adding seperate labels leaves quite a bit of whitespace between them

radiant lion
#

You can see this if you scale the text, top and bottom will be cropped

latent pine
#

so if I make the text very small it would fit WeSmart

sturdy iris
dapper jay
#

we can do better than that

#

world's first llm written in lua

scenic echo
elfin yarrow
#

random inquiry, if i don't call ui everytime a new player joins, does it make the ui host-only?

dapper jay
#

you can check if the player id is 0 to make it host only

warm canopy
#

Player id is 0 btw for the host

latent pine
#

yeah they're 1 lower than the in-game list shows

#

lua is one of the only languages where indexes start at 1 instead of 0 so you actually have to account for it lol

sturdy iris
#

i set up a github for my chaos mod so i can work on the move. but i get all these errors. i did set up the library's and workspaces correctly but why do i still get these?

latent pine
#

are the playerid's from tm.players.GetPlayerProfileId(playerId) hex numbers or alphanumeric?

dapper jay
#

i assume it returns the steamid? which is just a number

latent pine
#

yes i know that but from looking at it it looks like a hex value

#

602812b96f7bff6f59ceda4c
this is mine for example

sturdy iris
latent pine
#

it is, but i wanna know if it is hex characters only instead of just some string

formal crane
latent pine
#

yes thanks

#

that makes filtering a bit easier

formal crane
latent pine
#

i'm adding a blacklist function to my mod so i want to store player id's along with their username

#

need to grab them from a file and filter out what is an id and what is a name

near parcel
#

Just store it as csv/json

latent pine
#

yeah that's what I'm gonna do lol

warm canopy
#

I still wish for steamid since that player profile id can be reset

latent pine
smoky sierra
#

can somone help me with settinga thumbnail for a workshop upload

#

ive downloaded steamCMD and have everything set up but its returning with Preparing update...ERROR! Failed to update workshop item (File Not Found).

#

ive checked the file is the right vdf type the loacation of the image file is correct

warm canopy
#

Put a .png named Preview in your mods folder

#

Then upload the mod ingame

latent pine
#

that's a lot easier than for blueprints lol

smoky sierra
#

its a map im uploading

smoky sierra
smoky sierra
latent pine
#

not that hard but it is annoying

smoky sierra
#

how do you do it for a mod

latent pine
#

apparently

smoky sierra
#

it says its missing a lua file

#

wait he mightve meant in the map's folder

near parcel
#

you need to export the map as a mod first, and modify the exported mod

hexed hawk
#

i nees assistanewith 2 things, the keys between s+f an x+v have stoppe working, unrelate, trailmappers wont let me edit any of my maps, or ccreate new ones

#

the main issue is the trailmappers thing

sturdy iris
sturdy iris
# hexed hawk laptop

I mean you could change your keyboard of your laptop yourself for like 20 bucks or send it to a repair shop for like 30-40 and you can always use an external keyboard on your laptop

hexed hawk
#

i have $2

regal bear
ivory agate
latent pine
#

steam api also doesn't risk corrupting the blueprint

hoary skiff
#

ADD TO XBOX

latent pine
hexed hawk
regal bear
hexed hawk
elfin yarrow
#

what's a modvector3

regal bear
regal bear
elfin yarrow
#

i was hoping to just slap a number for wind speed and wind heading but this seems a little bit trickier than i expected

hexed hawk
cinder spruce
elfin yarrow
cinder spruce
#

vectors are used a lot everywhere, they should honestly be taught in schools a lot earlier tbh

in the context of tm modding they're used for representing positions like xyz coordinates, directions like in the wind speed, scale for objects, and tons of other things

elfin yarrow
cinder spruce
elfin yarrow
#

ok so the code is basically the ComplexityMod code but i edited it a bunch
context: chatgpt is trying to get me to log the defaultValue parameter on the UIText's
my goal rn is to have 3 input boxes (windX, windY, and windZ) and then combine them into one vector3 before feeding that into the SetGlobalWind
the commented out ones are unnecessary at the moment according to the clanker itself

#

i hope that's at least somewhat legible

cinder spruce
# elfin yarrow ok so the code is basically the ComplexityMod code but i edited it a bunch conte...

alright so immedietly the first thing i notice is your parameters on the mulitple set wind functions

there is this neat little thing called ui callbacks. it is data that gets sent to the function as a single parameter, so instead of having playerid, id, value, data in the function, you can replace it all with just one parameter callback

you can use this callback in the function to get all that information by using callback.value, callback.playerId, or callback.id

#

something like this

elfin yarrow
cinder spruce
#

chatgpt doesn't know anything about the modding api so it isn't quite helpful

elfin yarrow
#

on an unrelated note, does the code placement matter? like does stuff change if i put a function above something else?

#

compared to below

cinder spruce
#

i believe it does
the function should be defined before you add it to UI

although your add ui function is defined before the others, it is actually called later in the onPlayerJoined function (i assume) which is fine

elfin yarrow
#

how do i actually use a vector? i want to put it into the tm.os.log for now but i'll use it to set wind later

cinder spruce
# elfin yarrow how do i actually use a vector? i want to put it into the tm.os.log for now but ...

i think i see a better approach for this

you can just create a variable at the top that is the vector, instead of the x y z components of them
have a local windVector = tm.vector3.Create() at the top and remove the old variables

for each of the functions, you can set the individual x y z components by doing

windVector.x = callback.value
windVector.y = callback.value
windVector.z = callback.value

this way, you can completely remove the createWindVector function and ui
instead you can do it in the applyWindVector() through something like this

elfin yarrow
#

it gives a invoke ui callback error everytime i type anything into the UIText, also fails to invoke the onPlayerJoined function, no clue why

cinder spruce
#

might also not be a bad idea to fix the weird indenting

regal bear
#

You can log a vector3 directly using the tostring() function:

tm.os.Log("myV3: "..tostring(myV3))```
elfin yarrow
latent pine
#

if anything more about (standard) vectors and a little bit of matrices, they're used in basically any higher level education related to physics or math

regal bear
sturdy iris
elfin yarrow
elfin yarrow
formal crane
sturdy iris
elfin yarrow
#

how do i like "refresh" the UI elements? i want the numbers in the in-game mod menu to show windVector.x/y/z numbers when the wind vector is applied but calling addUiForPlayer inside the applyWindVector doesn't seem to do anything

latent pine
#

you can either remove specific ui labels or clear the entire ui and add everything you need back

formal crane
#

Call

function tm.playerUI.SetUIValue( playerId , id , value )

When you need to update it.

You can do it every

function update()
-- get wind speed
-- make it into string or whatever
-- call tm.player.UI.SetUIValue() for your player and the specific UI id
end
elfin yarrow
latent pine
#

oh yeah I forgor about those

scenic echo
near parcel
#

iirc clearing/recreating the entire ui was a expensive operation as it freed the entire context and had to initialize it again, you shouldn't be doing it on each update

elfin yarrow
latent pine
latent pine
#

are there any restrictions for adding images to tm.playerUI.AddSubtleMessageForPlayer()?
currently using a 256x256 .png, both adding it to data_static or the main folder doesn't seem to work

mint grove
latent pine
#

whuh

#

how do i do that? can't find anything about it in the docs

#

is it tm.physics.AddTexture(filename, resourceName)?

near parcel
#

yes, the docs should tell you

latent pine
#

hmmm
i think i did something wrong

dapper jay
elfin yarrow
latent pine
mint grove
mint grove
#

Please

#

I need this

smoky sierra
#

if somone could help me id really appreciate it my trailmappers crashes every single time i try go into a map i have tried everything i know like verifying game files reinstalling clearing old saves so i dont think there could be anything corrupt but when i try go into a map after a few seconds on the loading screen it freezes forever

smoky sierra
#

please any possible solutions

elfin yarrow
#

curious question, is there a way to make math.random lean towards one end of the range more than the other?

latent pine
elfin yarrow
latent pine
#

square root

elfin yarrow
latent pine
#

this makes it lean more towards 1

#

you can play around with functions in geogebra or desmos until you get something with the distribution you like

latent pine
elfin yarrow
#

i currently have -25 to 25 but i want something like -100 to 100 with a lean at 0

latent pine
#

maybe lua had a normally distributed function lemme check

#

you can take the same formula but with -100 and 100 instead

elfin yarrow
latent pine
#
function norm()
   local x 
   repeat
      x = math.ceil(math.log(1/math.random())^.5*math.cos(math.pi*math.random())*30)
   until x >= -100 and x <= 100
   return x
end

this will probably work

#

you can change the *30 to change the standard deviation if my interpretation is correct, lower values means values are closer to 0 on average and higher further away

#

@elfin yarrow does it need to be an integer?

latent pine
latent pine
smoky sierra
#

nope i was literally on trailmappers yesterday

latent pine
#

wth is this 😭

#

i'm trying to include a header file again since i really want the structure that gives me but i keep getting errors

i have a file called header.lua in the same folder as main.lua, and neither require("header.lua"), DoFile("header.lua") nor tm.os.DoFile("header.lua") seem to work

same if i just use "header" instead of "header.lua"

near parcel
#

submodules are searched in the static_data folder, and you don't have to specify the extension to tm.os.DoFile

latent pine
#

i get the same error when it's in data_static

near parcel
#

post the code and error

latent pine
#

if i do

require("data_static/header.lua")

or

require("header.lua")

i get this error code
C:/Program Files (x86)/Steam/steamapps/common/Trailmakers/Trailmakers_Data\..\mods\terminalMod2\main.lua:(1,7-33): attempt to call a nil value

near parcel
#

don't include the data_static path, and use tm.os.DoFile

#

tm.os.DoFile("header")

latent pine
#

ah that worked

#

thanks

warm canopy
#

Yeah dont put the file ending in the DoFile

regal bear
#

I've added a video showing the rail switching and signal system that is being implemented into samjr01's map:
#1446840402274684968 message

mint grove
#

I can't get my obj to export with textures

#

Wait how can I ad my texture to my obj in trailmappers

dapper jay
#

you load the texture and then spawn your object with your mesh and texture

mint grove
#

Ok 5y

#

Ty ty

regal bear
#

You can select your texture after you've placed the object too.

Also you can drag a texture from the custom objects bar onto an object in the 3d window.

mint grove
scenic echo
#

@latent pine in your command mod you should add a rules and a setrules command. I think this would be great for easily explaning stuff to new people who have joined. Also a command that allows you to set commands that run when someone joins would be also useful

latent pine
scenic echo
latent pine
#

they're good ideas :p

tight crag
#

does anybody know why my missile turns my plane (custom Missile mod)

latent pine