#General modding chat
1 messages · Page 7 of 1
ah that could be
I couldnt get noco to work though
it seemed the same as the first one I think in 1.9.5
although that could have been trailedit's fault
is the team aware that quite a lot of pfbs have broken (in most cases shiny) textures? I'm sure you noticed kungfuflaglol is broken though lol
The bush appears when viewed from a distance - lower lods (or mipmaps?) are visible.
A new version of Track Creator Plus is now live on the Workshop. More details here:
#1242291936715608205 message
Updated, https://trailmakers.ludixi.com/info
Improved on the way it filters the modding functions, added ability to favourite functions, added dark-mode for the cave dwellers
Information on Trailmakers Modding Functions, Spawnables and Audio IDs
how can i change the rotation of a custom object?
.GetTransform().SetRotation(Rot)
ohh no, does it have to be a tick after it was spawned? (these custom objects are my weakness)
i tried this and it did nothing
If you want to set it as it spawns, just specify it in the spawn call
No
by spawn call you mean in the function? like in here tm.physics.SpawnCustomObjectRigidbody(position, meshName, textureName, isKinematic, mass)?
sorry, i misremembered that function having a field for the rotation
No, you should be able to do it the line right after. Maybe share the code?
function SpawnBullet(block, playerId)
local PosOld = BlockPosOld[block]
local Pos = block.GetPosition()
local Rot = block.forward()
local Rotz = math.atan2(Rot.x, Rot.z)
local Rotx = math.atan2(Rot.y, math.sqrt(Rot.x^2+Rot.z^2))
local sinz = math.sin(math.pi/2-Rotz) * math.sin(math.pi/2-Rotx)
local cosx = math.cos(math.pi/2-Rotz) * math.sin(math.pi/2-Rotx)
local cosy = math.cos(math.pi/2-Rotx)
local PosOld1 = tm.vector3.Create(PosOld.x + cosx*4, PosOld.y + cosy*4, PosOld.z + sinz*4)
local Pos1 = tm.vector3.Create(Pos.x + cosx*4, Pos.y + cosy*4, Pos.z + sinz*4)
local Vel = tm.vector3.Create((Pos1.x-PosOld1.x)*Tickrate,(Pos1.y-PosOld1.y)*Tickrate,(Pos1.z-PosOld1.z)*Tickrate)
local Bullet = tm.physics.SpawnCustomObjectRigidbody(tm.vector3.Create(Pos.x + cosx*4, Pos.y + cosy*4, Pos.z + sinz*4), "bullet", "roadtex", false, 1)
Bullet.AddForceVelocityChange(Vel.x+cosx*PlayerDataTable[playerId].BulletSpeed, Vel.y+cosy*PlayerDataTable[playerId].BulletSpeed, Vel.z+sinz*PlayerDataTable[playerId].BulletSpeed)
Bullet.SetIsTrigger(true)
Bullet.GetTransform().SetRotation(Rot)
table.insert(Bullets,Bullet)
end
this is the function that spawn the bullets
it gets the rotation from a block with .forward() on first four lines
and then does Bullet.GetTransform().SetRotation(Rot) and the rotation of the bullet does not change
the last 5 lines spawn the bullet
i have a bit of a issue with the ui, it disappears when i respawn or backspace and when i press esc it comes back
I deleted one line of text and now it flickers
I think .forward just gives you a vector3 direction not a vector3 rotation. Maybe you could just get the rotation of the structure instead?
can you get the structure from the block?
For the UI check all the places you've got the function tm.playerUI.ClearUI(playerId). It looked like each time you repaired it refreshed the UI but changed what parts should be visible.
Didn't you get the block by first first finding the structure it was in?
this is my ui
yeah but i put it in a table and then i use the value from the table
OK. I don't know if you can get the block's structure that way (others may know if it's possible) but you can get structure attached to the seat that the player is currently in if that helps.
local plrSeat = tm.players.GetPlayerSeatBlock(playerId)
local plrStructure = plrSeat.GetStructure()
i'm just going to use a ball for the thing i have so i don't need to rotate it
or do that 🙂
a ball is a good idea
the ui is the thing i just don't understand, all the ui stuff i have is in the photo i sent and it does wierd stuff
Are you sure a keybind isn't interfering?
Well something is running the function that you have your UI elements in everytime you repair
checked again and it's only called once per tick in the update() function
don't buttons have to be ran every tick?
All events use callbacks
then i'm gonna doing it only when it needs to update
Also you can update the value of each UI element without refreshing the UI
tm.playerUI.SetUIValue(playerId, id, value)
this is cool
Yep it sure is. My racing UI makes extensive use of it. You can update subtle message values too which is also cool.
iirc you cant change icon tho? what about header too
I doubt you can change icon, since it has to be given when when sending the subtle message and the update value function only works with strings
So no, no bad apple in the subtle messages
so is it just me or is SetHealth broken
it's broken
but what about sending multiple subtle messages that are each the length of a frame or something like that
You could but because new messages slide in from the screen edge and old ones take time to slide away it would not be a smooth animation.
if you use three settings to set health that works most of the time, I'm wondering if you can only set the health in build mode
Yes the header can be updated too
Where do I find the names of blocks? Like specifically the minigun?
Use block editor mod in Trailmakers, it’ll give you the block id when you select the block in build mode
Just wanted to pop in and ask if you could set the gravity of a player and their creation separately from everyone else
So like one player has normal gravity and another has zero gravity
Only if you manually simulate gravity by adding forces
are you able to use os.time() in tm?
dont believe you can
but i think theres something similar in the api
tm.os.GetTime()
yeah i just need to use os.time with coroutines to create a wait function
update: yes. you can use os.time im just stupid
I've uploaded a new map to the workshop called Asphalt Valley. Check it out 🏁
https://steamcommunity.com/sharedfiles/filedetails/?id=3438907666
Also I should just announce that I'm working on an extensible mario kart framework. (If possible) it will allow map builders to add my custom objects to their tracks and my mod will handle all the heavy lifting of making them functional
Building it to work with trailmappers (sorry Lua map makers)
Trailio Kart perhaps? 😛
did 2.0 add any modding functionality? for example, enabling fuel consumption?
one can dream...
Nothing in terms of modding in 2.0, Thats not to say we won't get any additions in later patches
One can only hope
when we finally get good ui for mods I'm making it work with TSX
Well, it is certainly possible to make a fuel system, by using the keyboard input system. However this is a workaround, and ideally we modders should be given tools to allow us to view the logic states of blocks!
TSX?
Interacting with logics is honestly one of the things I wish for the most
Less after 1.9, but still enough
I notice we've lost some sound FX in the update. Not sure if it's intentional or not.
So with the addition of transfering damage between transforms , does this confirm the devs have found out a way to properly handle saving damage data
And if so, does this open the portal for a gun capable of undoing damage from a damaged creation
Is there any 1x1 rotating servo mod? Or is that even possible with the current modding tools?
it's not possible
I've created list of broken audio prefabs so please post there if you find any not listed:
https://discord.com/channels/296562030624899072/1348118768395485204
Thanks, it has been logged
i am going slowly insane. i just need to texture it and i should have this map ready for TM
its a new race course im working on called Neoterra City
A drive through of my progress on Neoterra
still have to do texturing and fix some holes in my geometry
it takes almost a minute to load... and thats with models and textures cached...
are we able to create custom light sources through the api?
That looks incredible! Wow!
Nope. Have to use prefabs like salvage, power core crate, lava, etc.
my texture designer is going off. this is the uphill tunnel
you can mix existing lights though in different ratios, e.g. power core crate + flamethrower
This track looks fun to drive with high speed cars ~260kph
problem
Didn't see the jump x_x
yeah the corners are also tight
the stuff is meant more for smaller kart league stuff
i could simply scale up the models to make them work for larger vehicles
Wipeout vibes. Looks awesome!
No way, Lego drome racers in tm (stile is surprisingly similar)
lemme see if i can get a full run in a faster vehicle
2 Laps on the course done in The AMT Sakura
my drivings not the best but its good enough to show high speed on the current course
(BG music is People by Half Alive)
gonna be making a version for karting with boost pads on the arrows and item boxes on the X's
Yeah that is just so cool 🙂
trying to figure out lighting for the tunnels rn
i found exactly what i need. now to find how to get it
you cant use any object in the game; you can only properly use existing prefabs if you want to use official assets
Yeah I figured that out... I'm now gonna go cry
That single asset is perfect for what I need and it's not prefab but I can acquire a ton of plants instead
Yeah, especially these latest updates that haven't been adding too many of the used stuff
Edit: tho of the space map we got almost everything
Also the lamps might be part of the space station itself
I'm also realizing how much I need transparency and opacity for my ideas. Holograms? Nah, they look bad being solid. Light beams? Nah, they look bad being solid. 2d trees on the side of the road to help rendering? Nah, have to have a black background
I've used this pipe for tunnel lights before
Yeah that's what I was thinking for the side lights
Hello modding gods, I am here today to ask if Lua has a require/import function and if so does it still work in the thing that is trailmakers lua
Like how in python you can take functions and classes from other files
tm.os.DoFile(filename) executes a given file as a module. Anything declared local at the top level of that file will be private to it (can ony be accessed from that file, not declaring things as local is not recommended). You can add a return statement to the top level of the module to return anything you want to be public (typically a table of elements), which will be returned by the tm.os.DoFile() call
What are the drawbacks with not declaring variables as local, and if I make them local how best to make them available across multiple separate scripts? I ask because I've used dofile but made many variables non-local so that both scripts could access them. I still have a lot to learn about this stuff 🙂
you will get very unorganized code that's very difficult to reason about (specially as the code size grows), since you will have to always keep in mind how any other part of the code could mess with each component. You also can run into name collisions unintentionally, causing all sort of seemingly weird errors. The better way to do things is to return a table of values which form the public API of the module, and make everything else local. That way other parts of the code can only interact with the module through that API, allowing it to control what can and can't be done to the module. A good rule of thumb is to keep everything local unless you have a good reason to make it part of the module's public API
Locals are also faster to access than global variables, as moonsharp stores tables internally as linked lists
Locals are just stored as an index in an array (vector?) for the scope
Thanks I'll see if I can figure that out
hang on, is this a portover from a BallisticNG map? did you get allowance from Vonsnake for these?
I do not see you on his server, i dont know if this map would be considerable as allowed on the workshop, but i can ask vonsnake
Yea hold on this is just Dover, exported from the track editor
This isnt your own track, be responsible and give credits to vonsnake at minimum
Hello this is a controversial question, but I know that the EULA prohibits modding outside the API for good reason. I want to do modding that can’t be achieved using the API. if I use it ONLY in single player and I don't use it for leader bord manipulation ext. also if I do this then I won’t upload it online what is the rules on that? if you say I can’t then I won’t. I want to make a mod to make logic gates more efficient and make a performance mod of sorts.
very probably not allowed but somebody else who's more sure will probably answer soon
^ and even ignoring the EULA, it's extremely unlikely you would be able to improve performance in any significant way
Unlike Minecraft the devs actually optimize their own game, Mojang should take notes
what the heck is a GetStackableBox call? my autocomplete keeps trying to get me to use it same with a vector2 instead of a vector3
is it possible to add new blocks with mods?
not in any good way
There is custom blocks pack by Noiro which has it's own builder separated from the in game one. But besides making a completely new builder, which isn't great or easy, there are no ways to add custom blocks.
they should add this function
Yeah, this would be incredible
Considering how complicated adding that feature would be I’d expect to see a built in level editor first and we’ve already been told not to hold our breath’s for something like that…
Still waiting for ui mod support so we can begin making gamemodes
Maybe with that editor itll bring a bit of stuff
Funnily enough the gamemode part itself is not difficult to make - the ui just wouldn't allow you to do much
You can make a custom model and create a camera for the player who opend the UI in front of this model.
Downsides:
- No simple way to display Text either all Hardcoded in your models or you make your own "Font" alphabet of models which you need to painly assemble.
- to use the cursor on this UI the player first needs to press F4 by themselves
- probaply more Issues which i cant think of rn
It would certainly be great if we could force the players cursor to be unlocked with the api.
(And hide it again)
if you want to overlay UI on normal gameplay:
- no easy way to do it well really
- if a player is in a fast vehicle it can look jittery if it is following them
- other players are able to see the models
This part is what im referencing
id love to introduce a whole custom ui with trailmakers ui assets to just make a neat little KOTH or Conquer Territory type gamemode
im fairely sure once we have 2.5 or 2.6 we might have a sneak peak into that stuff
im also fairely sure that then we also get the ability to maybe get better object support (meshes that dont implode after 2048 or a total of 32462 vertecies)
I had put a post in vote-modding-features asking for the toggling of the cursor to be controllable via the API. But who knows how-long or even if this feature will be added... 🥲
its after 32767 verts not 32462 verts
it breaks before the short limit
how so
weird extra metadata seems to be added onto it
i have no idea what they use for 3d model imports from unity
whatever it is, its optimization is comparable to the optimization of most UE5 games
yes
yeah using track creator plus by krunch
I meant forever, like if someone downloads the map from the workshop, he'll have that race track!
you can make a mod for it
tcp x trailmappers crossover when
I don't know how :\
wait. is that why my meshes keep imploding?
im currently on crash 286
need to update my textures to fit the new theme of the map but heres a 32 tile base test with the Foliage Meshes loaded
well part of it because the replay didnt save all of it and i dont wanna open OBS rn
It's worth giving modding a try. You might find you can master a few tricks in lua. Creating checkpoints in the lua code isn't too hard and you can look at mods like mine to see how it can be done.
Alternatively you can place checkpoints using Track Creator Plus on an existing track very easily and then save them to a file. You could even include that file in the map with instructions on how to move it to the right place for loading.
So if I simply load 5 meshes at a time by having the player click a button to manually load them whenever their pc catches up the game doesn't die. Let's go
That being said just the third of the map I have in game would cause a potato pc to spontaneously combust
i might have just figured out how to do some vague form of subsurface scattering looking stuff, hang on
maybe not
yeah probably not
I think Jess and Rid (maybe others too?) created staged loading for their mods a while a back. It might be in the Trailmappers loader too. You might find you can implement that, saving the user having to click too many buttons.
The trailmappers loader causes the game to crash. I'm working on an autoloader but it's a delicate balance. The manual loader allows the user to load things slower to save the game from imploding
The problem with the autoloader is it doesn't care if the game is overloaded. It will continue to try and load more models
Can you check the delta time and make the loading wait until the game is running faster again?
I could try
I have around 500 total assets I need to load though so I gotta be incredibly careful
Think I'm gonna be closer to 580-600 by the time I'm fully done
Here's a really old file I have:
Change the i % 25 to change amount loaded, also may need to make changes, no clue what's new with modding api
how do i change the steam workshop thumbnail of a mod?
i don't think you can do so easily
unless you can do wizard tricks with steam console that i dont know
unfortunate, wish that was added somehow, seems like a rather useful thing to be able to do (unless there is an easy way that i somehow missed)
Isn't it done by just putting the png in the mod folder called Preview.png or something and it gets done automatically?
Or is there another kind of thumbnail that I'm forgetting about
that only works for the first time you upload the mod i believe
after that the steam workshop thumbnail is never updated
2023 is "really old" ? 😭
pretty sure replacing the file works
^ I think so too, pretty sure I changed mines a few times
Yep, my gravity mod definitely changed thumbnail
Huh, will have to try that tomorrow
Yes. It is Preview.png. just adding a file named that works
Pre-programming comments me was interesting
I mean. You don't need comments if you write good code
You don't need comments if you abandon your code
||I mean: comments are good, sorry obojętnie||
True
And comments are great but the best way is to have readable code. Just name your functions and variables in a way that you know what they do
Splitting the code into file is also something that can help quite a bit
Basically to say don't name your variable x
Very true
If you can write modules and call them from a main script that works great
just
don’t abbreviate anything tbh,
you don’t need to shorten everything rlly
Exactly
Name your variable AdvertisementSpawningProgressCounter
Its long but you know exactly what it does
But... Long to type
PPointing is the best i can offer
(i don't remember what the p stands for)
Point possibly
Yeah. The long to type kinda sucks and there are better ways to do it but that's the basics of readable code
PPointing function is legendary, I still find myself using it
Yeah, the file with all those useful functions is probably the best thing in my mods folder
TargetRot my beloved (I pretty much know them all by heart now)
and then there's math
"rlly" << I see what you did there 😛
C h i c k e n f i n g e r s
chicken jockey
mmmm. i finally have a single piece of the new map done. im going to bed
i made a Mod which sprinkles selected Prefabs onto a map and exports it into Trailmappers format
cant upload it rn but i will try to later today.
its still pretty limited and there are many qol features i have yet to add
this is a great while we wait for ridicolas to come back and add it to trailmappers
any reason why it just ignores the decimal point?
and how could i fix this?
local objectDataPath = "objectTable.json"
local objectTable = json.parse(tm.os.ReadAllText_Static(objectDataPath))
local object = objectTable[math.random(1, #objectTable)]
local spawnedObject = tm.physics.SpawnObject(spawnPos + tm.vector3.Create(object.offset), object.name)
spawnedObject.GetTransform().SetRotation(spawnRot)
spawnedObject.GetTransform().SetScale(tm.vector3.Create(object.size))
maybe its only uniformly scalable?
Are you passing in a vec3 for rot?
if you want to create a vector from a string, you are missing the parenthesis
oh lol
Where would those need to be?
in the string i assume
basically change
“offset”: “0, 0, 0”
to
“offset”: “(0, 0, 0)”
Any other ideas?
You could do something like having the values multiplied by 100 and then in the code they get devided by 100
Maybe that works but its janky
Don't know why it's not working for you. I don't do it that way. In my saved files I separate out the vector3 values. When I read the file back in I use the tonumber() function on each value as I recombine them into a new vector3.
Yeah i guess seperating them should most likely work better, will probaply do that then
can distance sensors detect custom objects set as trigger?
does anyone know something that emits proper light in trailmappers? or is it possible to make a custom model that emits light?
No idea. Good question.
take this with a grain of salt but i don't think they can?
The salvage prefabs emit a yellow light (I use "PFB_SalvageItem_Timed" as it has just a non-collideable light cone that can look nice)
The Powercre Crate emits a blueish light
i usually use extremely small flamethrowers and sometimes mix it with powercore crate for a cooler (literally) light
The lava prefabs emit orange/red light
but i will try that salvage timed trick
very strong light yeah
btw the lava light scales with the prefab i think
which is unique to it
I find all the lights tend to LOD out fairly early too, so you have to get quite close to see them emit.
idk why but the yellow flashing arrow sign has early LOD
i used a scaled physics cone as a back cover for it
apparently some of the small desert rocks (small desert rough/smooth in tmmm i think?) also disappear at distance for some reason
That makes sense though - they are small
but i realized flashbulb uses desert pointy lumpy for the rocks along the bottom of cliffs (e.g. by the tunnel on treasure island)
and actually uses pointy lumpy along the sides of cliffs too
strangely flashbulb use desert tall lumpy extremely rarely if at all
i swear that didnt happen before though
thanks
gonna put this here, theres a mesh splitter for 2.79 i might be testing out later to see how far i can push loading alot of smaller segments of a map to make something look proper
The error suggests the code is expecting at least one modifier. Here is hopefully a tweak that checks if there are any modifiers before trying to access the first one: MeshSplit1.1.1.zip (1.8 KB) Do bear in mind that it’s been a few years since I wrote that, and it was written for v2.79, which I’m not using since 2.8x is the current versi...
this splits meshes by 3000 polys so it might need to be changed to 2000
I have a script that I use for mine that splits my meshes into 500 polygons each but it have to change parameters by hand each time so it's probably not great
i tried to color distance sensors with custom colors but it seems like they have the same issue as thrusters =(
with in game colors it's fine but with custom colors it does not work, i tried multiple times
i mean instead of using R, use G or B. or instead of secondary, use primary or sth
cuz the vast majority of CMM experimental works
distance sensors only
only on distance sensors i've found this, and i tried all r, g, b values
like how it's bugged for thrusters
so its different with different blocks 😭
wth is the bug?
from what i know and experimented rocket thruster, space thruster and distance sensor have this issue, it may be all thrusters but i havent tested all
So all thrusters and all logic blocks cannot be given custom colors with mods but can be given in game build mode colors with mods
thats some truly weird stuff. i sure hope when/if they fix it, they will tell us what caused that behavior
Do you mean the coordinates?
You could "apply all transforms" in blender to center the origin to 0 0 0
hmm
i could try that
i havent been splitting my most recent stuff because its low poly but i might need to
any idea why the function configure Object does not know what my key value is?
--UI creation:
for key, object in pairs(objectTable) do
tm.playerUI.AddUIButton(playerId, "btn"..object.name, object.name, configureObject, key)
end```
```lua
function configureObject(callbackData)
tm.os.Log("Configuring object: "..callbackData.key)
end
cannot access field key of userdata<Trailmakers.Mods.Api.ModApiPlayerUI+UICallbackData>
i had to use CallbackData.value and not CallbackData.key
silly me
oh actually it is .data to get the index and not the text
Yep I've done plenty of 'oopsies' like that too 🙂
Quick question: is there any way to change the grip of a model? I wanna make a snowy map but wanna make it be more slidey than normal custom models
Either the grip of the model or just the grip of tires overall
on custom models no
but if you want, snow prefabs do actually have snow surface on them, so you can try and place them on your model and just make them invisible
red large mushroom prefabs also have grass surface
and the airborne grassy islands have grass too
Sick
I can try that
~~i guess the Raycasts really dont like the Trailmakers terrain ~~
easy fix apperently there are some kind of triggerboxes there
exports nicely,
all thats missing now are instructions and then i will release it
DOes anyone know all of the rgb values of the colors in buildmode?
I think you could just use a color picker, iirc the color picker from gimp can pick colors from anywhere on your screen
i'm just gonna quickly make a mod to get them instead
Ye, and the game may put a filter the screen, so i wouldnt trust gimp for that
i seem to already have a mod that gets the colors 
i very much would love this code right about now LOL. i gotta build a forest
damm
lol
less excitement
lets gooo
you are a fuckin lifesaver
all i gotta do is replace it with my models and clean up the roads
you have genuinely saved me hours of work
:D im happy it already has been usefull for somebody
it currently only supports prefabs but i guess it should be possible to change it to also support custom models, but that will have to wait
i was just gonna edit the data myself since its in trailmappers format
Fair, btw it always exports with a data footer that includes things like Trailmappers Camera position and things like that, keep in mind that you will have to remove that when merging the files
Yep
does anyone know where downloaded mods save their dynamic data? it isnt near the lua file so i was wondering
ah found it
#modding-archive message
lovely display of the great Modding UI
yeah. i run into limitations pretty much every single day
ill add another soul to my list of offers to the devs if we can just get transparency for textures
like i can just make all my models formed to my textures to eliminate transparency but that adds so many extra triangles that it hurts performance
and god knows performance already hates me enough
if only we could rescale the window...
or even just get the lines of text closer
seems like barrels not despawning was fixed sometime after 1.9.5!!
Wait what? Really?
yeah it was working for me with trailmappers map
Repair Restrictor Mod is now updated. Here's the new topic/thread for discussion and feedback: https://discord.com/channels/296562030624899072/1358589856992858428
Not working for me. I used my test mod to spawn some barrels. I then deleted them all but they instantly respawned.
weird. works for me when I export a map while it's active and when I disable the mod. maybe it's half fixed?
@regal bear mod idea: inactivity kick - kick inactive players after x minutes
or maybe despawn their builds
i forgot if disabling repairing was per-player or not
OK - nice idea
Yeah disabling repair is per player
maybe could do a mod where players are only allowed to repair under a certain speed (remove in-motion repairing effectively)
Funny I thought of that exact thing the other day when updating Repair Restrictor 🙂
i think that idea as a standalone mod would do very well
as it also prevents in-motion repairing during dogfights- which a lot of people dislike
I've had code that detects a repair operation but only the standing still one. Can't detect moving repairs or transforms.
You can give it a go if you want
or transforms
wouldn't it be possible to detect significant change in blocks that the structure is, without builder opening?
But preventing them is easier
my lua skills are as follows:
- defining local variables
- calling functions (sometimes)
That's what I do in Repair Restrictor. I detect 'damage' rather than repairs themselves.
So if the health of the structure suddenly goes up compared to a recent baseline I call it a repair and it gets counted. I also check changes in the number of structures as that indicates certain things too.
idk maybe ill try it
surely its not that hard to get velocity
easy
actually probably the hardest part for me would be getting velocity, from there it would be mod thumbnail
--- Gets the velocity of the player inside of the structure.
--- @return ModVector3
function ModStructure.GetVelocity() end
--- Gets the speed of the player inside of the structure (m/s).
--- @return number
function ModStructure.GetSpeed() end
💀
so check if player is in seat (tm.players.IsPlayerInSeat(playerId)))
if so check if velocity is above a threshold
if so prevent repairs
if not allow repairs
Feel free to look at and use any code in my mods
literally selecting the structure my nemesis
and i am amazed that not of your mods ever mentions modstructure
NOIRO IS GOATED
STOLE HIS METHOD FROM ONE OF HIS MODS
WORKED
I usually do this: tm.players.GetPlayerSeatBlock(playerId).GetStructure()
yeah thats what noiro used lol
lol you missed it in my code then
i was searching for ModStructure xdd
fair enuf
probably good enough. works in multiplayer on the first attempt
and as i expected the mod thumbnail is the hardest part lol
I'd suggest making an Activate/Deactivate button
just turn the mod on/off lol
already exists in the game, might as well use it
Annoying for the host
booo
Also allows host to send a message to all players when it's activated or deactivated
the host can do that themselves
up to you
i can probably code that myself just fine but i dont think i really need to
if i were to add that it would probably be a ctrl+ bind
and then a global subtle text probably
Also this might interfere with other mods that set repair enabled or disabled becuase you are doiing it constantly. You could first check and store the status of RepairEnabled.
Maybe a big X over the spanner?
seems good to me though
Yep looks good. Just thought that you wanted to show that it's blocking moving repairs.
oh my god the thumbnail upload bug strikes again
time to fight the workshop for 3 hours trying to get it to upload the thumbnail
oh i swear to god if its because i need to update steam..
Never had that bug. What happened?
despite having a valid icon.png in the mod folder, it is not uploaded to the workshop (displays as full white ingame, gray placeholder thumbnail on steam)
and guess what updating did
dang
The file is named correctly?
which file? the thumbnail png? yeah its named correctly im 99% sure
Preview.png?
lol
I FORGOT FROM LAST TIME LOL
Shouldn't the mod be called "No Moving Repairs"?
repair tokens are what are used for moving repairs
and also DAMNNN Preview.png BETRAYED me
Maybe give it time
giving it time broke it more
What dimensions and file size is the preview file?
98x98, 1.62kb
it broke even with dethrone patches' icon, it is not an issue with the preview image
because i have reuploaded it just a couple of times
did it show the default gray thumbnail or the actual one?
It was the default grey
yeah its not working on steam either
its working now, although idk if that was because i put the full directory (starting from c:\)
oh if its smaller than some value steam doesn't scale it...
it gets scaled in game though
yup
I think you should mention in the description that this mod will prevent other mods from blocking repairs
man close enough right
i will mention it will be highly incompatible with mods that allow/disallow repairing
there you go lol
oh i should put a grid behind it because its a bit flat rn
~~BTW this mod already does what your mod does:
https://steamcommunity.com/sharedfiles/filedetails/?id=3192802639&searchtext=repair~~
no? it entirely disables repairing right?
thats what i got out of the mod description
Ah yes true. I thought the mod's second button was for moving repair but it's blocking build mode.
does RegisterFunctionToKeyUpCallback usually trigger multiple (sometimes MANY) times? or did i mess up my setup
fixed it. it was because i had it inside of update()
Just about to ask that 🙂
you were about to ask that? lol
Yes was just about to ask if you were running it in update 😉
You just reminded me that i have to update my mods to work with the new transform in 2.0
cheers
how do i store information from the previous update?
Variables and/or tables
no like, in what order does everything go
Like store the old position of a plyer?
Update runs every mod tick from top to bottom
store the old IsPlayerInSeat
You can set variables per player in a player data table
In the function that gets called when a player joins you can do
PlayerDataTable[playerId]={
OldIsPlayerInSeat = false
}
And then to store the value you just do PlayerDataTable[playerId].OldIsPlayerInSeat=value
That's how i do it
Yep. And make sure to actually call the OnPlayerJoined function.
im able to detect entering/leaving a seat, i think
i wont need to detect entering a seat but its cool i guess
plot twist, detecting entering a seat was actually just detecting when i pressed F
So you're not just checking IsPlayerInSeat?
yall im cooking
nah if i did that, it would constantly trigger when youre in a seat
detecting entering a seat = one trigger when you actually go into a seat
btw it is correctly detecting when you get ejected from a seat :D im gonna test rollovers now
IT WORKS FOR ROLLOVERS TOO
cool
All it does is set true or false
but that would trigger a true/false check multiple times? my method was attempting to make entering a seat trigger once
It doesn't really matter. There are ways to make it only check under certain circumstances. I do seat checks a fair bit in my mods.
You could have checked when the variable changed value (by storing its previous value as well and comparing them)
Not sure if this helps but it might be that it returns userdata on trigger for every player, you might need to make a basic event filter
if it doesnt return userdata then it might be that it reruns on ANY keypress regardless of id
It does return user data or at least playerId
Just to confirm: I don't see any functions for changing the power of pistons, so I am assuming that is not possible correct?
Pistons don't have power
i have fulfilled what i initially planned for sensitive seats; i might try over deceleration/acceleration death too
Power being defined as the ability to perform work over time, speed equates to power in this case
apparently you die when leaving a seat in multiplayer; idfk why
i think i got it working again
i can now detect when players de/accelerate at a certain amount
What he means is pistons don’t have a power variable in the games code that the modding api has access to like thrusters do. You cannot change piston behavior with the current modding api
ive set it up to only detect deceleration, mod is functionally done except for configuration
the subtle message is shown but the player is not killed? the other use of KillPlayer works just fine though
Is the other time you used KillPlayer, the player also in a seat?
i figured that out
it was because i was giving it player.playerId instead of playerId
although i think its stopped working again ?
only happens in multiplayer hmm
how can i detect when a player respawns?
You may be able to track their position and see when it changes. Also their velocity probably gets set to zero so those two things combined might be a good indicator 🤷♀️
does it matter whether its speed or velocity im checking for?
My mind initially went to velocity because you want to make sure the position change doesn't make sense when you take the player's velocity into account, that's when I realized that velocity probably also changes and I kinda mixed those two sentences into one
alright i might have fixed randomly dying on respawn with a really really dumb fix
but i don't know why deceleration death doesnt work
Progress! 😄
do you have a clue why this doesnt kill the player? the subtle message IS sent
60 kph in one frame seems intense, are you getting that kind of acceleration values?
acceleration? im checking DEceleration- slowing down
and when i test ingame 60kph minimum seems pretty good
Sorry, I'm a physicist at heart so I call everything acceleration
Huh, very odd that it is not working
ikr?
oh yk what, im gonna move the DecelerationDeath function above the update one
didn't work
bleh
The only thing I can think of is if somehow the playerId being passed into the function is not right, or has somehow changed since it was saved 
odd, everything else that uses playerId works just fine i think
oh right, the UI elements, yeah those shouldn't work if my theory was true. blehx2
i made the subtle message display the playerId, and it IS 0, which is my playerId
Have you printed out tm.players.CanKillPlayer(playerId)?
It would display false if there is something stopping you from killing the player. It should be true, but, I'm grasping at straws right now
That's weird! Mine says it returns a boolean 😮
Oh, yeah I just saw these are different functions lol
I just woke up from a nap, the ol' kitty Brian is not purring on all cylinders yet
Welp, there's yer problem! 😄 But why??? 😠
its reporting that update() can't kill me either?
I am assuming that you have Invincible players turned off in session right?
mhm
yes
I wonder if maybe there's a loose global variable named playerId out there somewhere messing you up
I don't use Lua very often so I don't know how it handles that sort of stuff
probably not, it is the correct playerId and still not working
hmm, the logging is a bit inconsistent for both
I suppose it wouldn't hurt to call tm.players.SetPlayerIsInvincible(playerId, enabled) before trying to kill the player :\
you're never gonna believe what i added along with the logging
😄 nice
i also tried re-enabling the mod while the player invincibility session option was off and that didnt work
bleh
x3 x4? x3
lol yes
i think i actually figured out why respawning triggers deceldeath
ooo?
its for the same reason getting into a vehicle after leaving a fast moving one
because it jumps from one value to 0 in 1 frame (because it updates after getting in)
thus if i also check for inseat/oldinseat that SHOULD fix it
ahhh, like because it is only tracking it while you are in a seat, yeah that makes sense
wait wtf whyd it go from +29 (last tracked value) to -309 (new tracked value starting from ~0) when entering
oh god to detect entering a seat i gotta store the previous frame's F key value too
omgoodness
because inseat and oldinseat are both false when you press f
but that means you can be anywhere when you press f
regardless of if theres actually a seat
and guess whatttttt
i dont think it actually sends playerid in
so i dont think i can store this per-player
which means i cant store past frame state
yeah i'm lost on whats causing killplayer to not work, probably gonna need to summon krunch's magic when hes on
I'm interested to see what he says because I've got nothing at this point
So none of the kill functions work anymore in your mod or am i wrong?
Maybe you need, in session options, to have the invincible player option off, not only in the mod
it has been off the entire time
logs specify that the player is invincible despite the session option being off and setting all players to be killable via the function
Maybe it's something wrong with the function that makes the players killable
It's not the first time finding broken functions
weird thing is that the killing used to work fine in the first written use of it
but since I added the invincibility function line it hasn't worked
On what line is that function?
I can't test anything rn cause its late but if somebody could test or fix the lua file I sent it'd be nice
it's in the update function I forgot which
it's before the first mention of killplayer
So after you added this
tm.players.SetPlayerIsInvincible(playerId, false)
It broke?
yeah or something to do with when I added the checks for logging
I will probably try testing this to see if it breaks later in the day, i'm 40% confident that function is the problem
weird, before the first killplayer broke, it would always work but the 2nd one never did,. despite the subtle message right below it also triggering just fine
I should check on the not broken version if 1st mention throws a player is invincible error like the 2nd one does
Ill get to it this noon if i can , currently busy
I did a quick test with your mod and it worked at first but then just stopped killing the player after a while. I think the tm.players.KillPlayer function might be bugged, as SpaceKitty said.
Just some thoughts:
- you should probably add playerId to your keypress functions (if it's only for the host just use 0) eg
BSState=1
end
OR
function BackspaceD(0)
BSState=1
end
- use a separate playerUpdate(playerId) function to keep things specific to individual players and avoid things being triggered by the wrong player (see the file I sent you yesterday)
...and suddenly it has started working again after a while! 🤔 Same Single Player session.
We really need a modding fix update because some useful functions are broken or inconsistent
was not the problem i guess the kill function is just broken
ahh so it was just random chance in multiplayer
unless i need to stay in one session for ages, or keep relaunching my game, still only the first use of killplayer ever works; gonna check code
and i realized its actually not that either. its because it thinks you got ejected from a seat after respawning
YUP
wait what if its a rate limit of sorts because my mod sometimes calls killplayer twice at once or while the player is already dead
yupppp now its not working
now ill restart my game
nah still false
wait is it because of build mode
i think it's time for a workaround, just spawn a explosion on top of the player
oh my idea for a workaround was to teleport them to like -5000 altitude but that works too 👍
does it kill the player if he is at -5000 altitude?
yeah theres a vertical kill border
but that would cause the camera to be there too
yeahh but also looks really bad cause the camera during death is also in the void
I think there are functions for controlling where the camera is but I haven't messed with them yet
still way more complicated than using explosions, and probably wouldnt be able to do the same motions as regular death camera
also RRR the killfeed is wrong
i think this might be a problem with explosions (theyre too far behind to kill me)
actually this is kind of a cool unintended feature
its like your creation is turning too aggressively and rips itself apart
crashes and wall collisions still should work fine too
but a lot of people wont like this
any reason you are using the KeyState Variables globally instead of per player?
because i wasnt able to figure out callbacks lol
nope LOL
noiro told me that this should work?
gonna try it
yes
oh it did work
wtf flashblub
the issue is clear as day now
yeah, backspace causes deceldiff to trigger
alright i think deceldiff on respawn is fixed
Is the mod supposed to do?
wdym?
it makes it easier to be killed, more alike in campaigns
because even with player invincibility off, in sandbox its harder to die than in campaigns
i doubt that
it is
i know some seats are invincible to dying due to acceleration in both campaign and sandbox
I'm really interested in the decel death mod, I think it would pair well with what I'm working on currently
acceleration?
negative acceleration >=(
deceleration?
yes >=9
=(?
=9 pea shooter, do you see it?
i think it might be lag
i remember going through the same problem when detecting blocks after a player backspaces
🧢
that is the correct diff for that time btw
i need to widen the clear gap then
time to add the other two variables
CurrentKph,OldKph,Diff
OH
I SEE WHATS HAPPENED
what is happening, i only took a 20 minute look into the code idk what those are
Looks neat, you should make a thread for it
i still set oldkph regardless of backspace time and so it still lets Diff be calculated but its actually CurrentSpeed (0) - OldKph (now the actual old speed) = speedDifference
YUP, WORKS
yay
are those logs in real time or are you just opening a text file after the mod ran?
now just gotta wait for flashblululululululb to fix KillPlayer and this mod will be fully good
after it ran technically
but i know what i did and when based on speed and backspace time
if you open it in vsc it will show in real time
i should start making my mods with logs, before i used the ui as a way to debug but logs definetly will be better
nice
it doesnt log anything instantly so theres actually no log file until i hold backspace or i get killed
but again, i know when i do stuff and what causes specific log messages
fake news:
explosions also dont work-
wdym there is no log file? the log file is always the same, only the content changes
when you reload the lua it deletes the log file and only creates it once something is logged
does it really? idk i always log when a player joins so i always log something instantly
i could do that too
ngl server logs mod would be awesome
yk log join/leave (username included), backspacing, spawning structures, repairing, when guns are shot(?)
yk ill add the regular killplayer function and if it fails the workaround is also ran
eh
who cares about killfeed anyway
W function name
i agree
this means IsPlayerInSeat MUST be returning true...
FLASHBULB WTF
it sets current/old/diff to 0 when not in a seat
works fine if i intentionally leave a seat with F
watch in horror as all of my log functions stop working
finally it triggered
as it turns out it actually just wasnt triggering because i was hitting the ground too hard causing tm to kill me before the mod could
sigh... respawning after death has the same bug as backspacing
i fixed it but at the cost of 99% this
NOO NOT AGAIN
we upload later because workshop is STILL BROKEN DEVS ISTFG FIX YOU GAME
@shadow iris try ModStructure.Dispose()
for killing the player?
maybe that will help kill the player
might work
nah that would just kick the player out, no?
it would delete the players structure
so what
better than trying to blow it up with explosions lagging behind
ok at least the explosions work at all

you could predict where the player will be and then spawn the explosion at that predicted place
get the velocity in meters/tick and then add it to the position
this might help in the cases that player is too fast for the explosion to kill them

Bro - I suggested this to you earlier 🙂
#1140936220487192587 message
i might be cooked
Just chill and most probs can be sorted with time 😉
cant think of any ways to fix/simplify/optimize sensitive seats rn so im gonna work on inactivity kick
For Repair Restrictor I ended up running some things at a much slower rate to ensure that certain detections happened first.
doesnt work too well when you're trying to store the previous frame's data. for me it runs fine, but i do have a high end pc for TM hosting it seems
8 player unmodded runs at 100% speed unless somebody teleports/respawns or a big collision happens
so basically 99% of the time it runs at 60fps
with 8 players
Yes but you don't have to have all detections being instantaneous. I run a 'slowdelta' at 6 while the mod Delta is at 60.
itll look best at 60 fps. maybe i could run detections at 30 fps but idk. would need to do broader performance tests to see if that is necessary
probably most needed optimizations would be entirely remove the use of globals, clean up the code + improve readability, while at the same time improving exit vs eject seat detection and also flashbulb fixing KillPlayer
It still runs at 60 for important things but killing a player half a second after the detection of their deceleration isn't a problem
itll look bad though
why is killing a player at the same time as detecting bad? i dont see how spawning a single explosion pfb is that costly
I'm just talking about getting accurate detections
Eg. you could slightly slow down your deceleration detection (check over more than one frame) to ensure accuracy - just an example.
Also it might be why you were getting multiple player kills as you mentioned earlier.
oh i was throwing ideas out as to why killplayer wasnt working; idk if im actually killing the player multiple times outside of eject and deceldeath triggering at the same time
i imagine theres no way to detect single/multiplayer besides a 2nd player joining
Not sure. I haven't tried to detect that.
out of curiosity, what is the purpose of keeping a list of key names? Not critisizing, I just can't think of what you are using it for
it's for an inactivity check. instead of writing a key down function for each key individually it just loops through those
Bro really making an autokicker
To confirm my understanding is correct: When you hold left mouse on a ui button it only triggers once per click. There is no (quick and easy) way to make it trigger multiple times while being held. Is this correct?
could you remove the button and then readd one in the same spot? would that trigger again?
Hmm, it might, but for now I think I will just spam my mouse lol
THEY MADE CHASERAI WORK AGAIN
WTF
IT HAS NO TEXTURE
BUT IT WORKS
wait do some of these race start pfbs actually exist??? but theyre so far away in the sky and rotated
yooo what
PFB_ChallengeSignUpExpedition
they have like 800,500,-430 ish offset though
and the "signup" billboard is offcenter from the start zone
only if it's at the bottom of the UI, otherwise you need to regenerate the entire UI
shoot i dont think this part moves?
I don't know what this is but yay! 😄
its a bird from expedition that would roll up into a ball and chase your car around and ram it
very fun
aaa that's cool!
Science is hard ya'll 
could i get the modder role?
me too
Not sure what the modder role is for but I spend most of my time in this game modding now so....?
i know its used for making posts in #1123915629653667943 and idk what else
Same LOL
I haven't built anything in ages
But anyways once again shoutout to sprinkle tool for being an incredible mod
Mapped my terrain and put down trees
tree
nice!
I keep thinking the mod I'm making is one day away from being shared with the community, but everything is so slow going lol
announce update is soon
not feel like working on it for 3 months
truly a General modding chat moment
I feel the same LOL. I gotta get my map released but everytimw I think I'm done either something breaks or something still needs to be done
Like I still have to fix the trees for the 7th time and I have to fix the hitbox on the nonstatic objects
Not to mention that this is like my 9th attempt at making a map. Hopefully this one doesn't have a huge flaw I'm not seeing yet
You now have the modder role 
You now also have it 
Thank you! (And thanks to whichever mod that gave me the role!)
It was Johannes 
Well, thank you Johannes then!
My mod keeps making the game crash, how do I get support? Do I create a new thread with the error report or is there something else I am supposed to do?
You might be able to get a dev to look at your error logs to see if that points to the problem
Do I dm the devs or do like I said with a thread? I really want to make sure I put this in the right place
I wouldn’t dm them but post about it in bug reports
Thread is for the best, mod errors are treated different than normal ones, and Devs aren't the only ones who can help
my code is so broken that sometimes i need to fix my mod by removing a line of code, saving the lua file and then putting that exact line of code back
What kind of code were you able to make?
Just a tm.vector3
can i mod xbox?
nope, mods are only available on the steam version
are you using vscode? for me in a different game ill save a .json and then it corrupts weirdly
just try saving again, if its that then you dont have to edit
using setistrigger for no collision (via trailmappers export rn) seems to not remove collision for prefabs, currently known with the grayrock+orange rock prefabs but it happened with a different one too that i forgot
can somebody else confirm this?
I have a map where there is an invisible cube with CanCollide false where you can still collide with the top of the cube only if you are moving downwards and the back of the cube only if you are leaving the inside and going out. I might post it somewhere if it is useful for bug hunting
maybe its custom model convex collision bug
the convex collision cant be removed so people usually put vertexes super far out in blender so the convex collision is far away
I see, interesting
Yeah. It only seems to be the top collision though. The salvages i use for my lamps have collision on the top of them even though they are set to trigger
And that's seems to be both with trailmappers export and handwriting the code to spawn them in
Yeah i am using vscode and i did try saving multiple times but it does not work. It has to be removed saved and then put back, i have no idea why
This is a known bug from day 1 of the modding API. My understanding is that SetIsTrigger removes hit box collisions but does not remove raycast collisions. As far as I'm aware all wheels use raycast collisions, as does the player character.
I think there is also a separate bug with some prefabs where SetIsTrigger simply does nothing.
hmm i found more details with the barrel despawning bug:
- barrels respawn when theyre LOD'd (players are far away from it)
- this happens when you clear them while up close, and then move away
- they immediately respawn if they are cleared while players are far away
- once respawned they will be untouchable by the mod (needs testing)
- pfbs with ai (tested with
PFB_Runner,PFB_Runner-Monkey) also respawn with side effects- no collision
- wandering ai preserved partially? needs more testing
oh does that happen for all physics/ai pfbs
dispensable prefab scales (for the ones that scale visual and collision mesh weirdly)
PFB_Dispensable-BeachBall 2
PFB_Dispensable-Cone 2
PFB_Dispensable-MetalCrate 2
PFB_Dispensable-Mine 0.05 (visual ground contact)
PFB_Dispensable-Present 1
PFB_Dispensable-Torpedo 0.5
PFB_DispensableBall 0.49 (visually identical to PFB_DispensableBoulder?)
PFB_DispensableBoulder 0.61
PFB_DispensableCube 0.5
PFB_DispensableSnowball 0.5
PFB_DispensableSphere 2
PFB_TimeOfDayTrigger did SOMETHING to the sky for like 1 frame, wtf
and i cant seem to reproduce the effect? idk
maybe it cant change the time of day because the cycle is locked? idk
they ACTUALLY FIXED PFB_SpaceWreckage2!!!
bug: custom cameras do not work when player's vehicle camera is set to orbit or sticky orbit
custom camera also significantly increase fog; dunno how this could be used but its cool
Babe wake up they fixed PFB_SpaceWreckage2!!!
lol what i paused the game while in a custom camera while underwater is this my mod or something
my theory for this is that the interpolation during a camera "fade" is broken when it occurs while the game is paused
wanted to ask here as i'm messing around with custom maps and theory testing, is there any way to randomly rotate a asset while map is loading via a random number / variable or even randomly only SELECT a handful of props to spawn or not spawn
I.E i want to randomly rotate a custom asset between 1-180 on load
I.E i want to spawn a rock every 1/10 times the map loads, every other time the rock isn't there.
i'm asking this because my knowledge of code is limited and no better with the knowledge of the modding capabilities of trailmakers
i'd assume the first is possible with some coding, second one i'd be doubtful but still assume its possible
if there's random function related stuff then you could just set a variable to a random number from 0 to 100 and check that value for objects with a specific flag set
like if object has randomspawnchance==0.6 and randomvalue>=0.4 then spawn
that sounds about like what i want
i think what i'm trying to do will be possible
just gonna need to figure out the code part to connect the rotation variable to the random number
You should be able to do both those things.
You can use the "math.random()" and "math.randomseed()" lua functions.
https://www.lua.org/pil/18.html
For the second one you'll also need to write out a file to save the map's load count, and load the file each time the map loads
"tm.os.WriteAllText_Dynamic()"
"tm.os.ReadAllText_Dynamic()"
Alvaroping's handy
Trailmakers API/Lua reference:
https://github.com/ALVAROPING1/Trailmakers-API-LuaLS/blob/master/library/tm-api.lua
is reshade against tos since its an DLL?
Is it? Probably (don't remember exactly what the EULA says)
Will the devs be fine with you using it? Also probably, the devs are usually chill with modifying DLLs as long as you don't ruin the game for other people, reshade is local and only affects you
I am not a dev, so don't blindly trust that, but I am mostly sure
The way I look at DLL mods is that they can contain potentially harmful code, so they devs don't want people to normalize downloading DLL mods from each other. Modding your own game, in a way that is not cheating, is (probably, I'm not a dev) okay from my understanding. That said, I won't encourage DLL mods since they don't want them to happen
that's not the only issue, DLLs can directly effect people's games even if they don't have anything to do with them at all
Reshades been used by a number of community members to make their screenshots look better, so I’m sure you’ll be fine
Reshades pretty universal in general, not even specific to Trailmakers
afaik reshade works at the driver level, it doesn't directly modify the game
Have to agree with alvaro for once, Reshade hooks into draw calls directly to get geometry data etc, so you can run stuff like wide ambient occlusion or raytracing
OFC this will hog the actual frame gen so you might encounter half the framerate
To my knowledge you cant gain proper advantages from it since Trailmakers does Culling which Reshade cant undo so anything not in the BSP area will just dissapear
however, game code injectors are banned from usage, defacto
so am i fine using it or?
for reshade? from what i read here you'll most likely be fine
alr ill keep using it since it makes the game pretty
even if it dynamically patches the game in-memory, considering it just changes the graphics, you will likely be fine as it doesn't hurt anybody
the only thing it will be hurting is my frames
no ones answering my question (multiple sources) so, should i add blue pine trees to the very top of treasure island's mountain- do they fit? do they make sense next to the pre-existing cartoon pines?
maybe if u add more (idk tho im not a mapper)
ye that was just a little patch to test it out
but as a player do they match the area?
they kinda match
the sand kinda throws it off
can you import blender models into the game?
im not a modding guy tho i know basic python, im want to make a desert map with a pyramid and stuff and thought just making it in blender is easy since i know the program
.obj models yes
but they cant be super duper high quality
theres a 32767 vertex limit i think
yeah and textures the maximum practical size is 4096x4096
but i would recommmend 1024x1024 if you can get away with it, 1024^2 loads a lot faster
ok, thanks for lmk
textures use png, and the alpha/opacity channel determines roughness. the lower the opacity of a pixel, the rougher or less shiny it is
heres the map file, what do i do next?
2.15 mb wtff
?
its very simple as i want too figure out
how to import it first
yeah this isnt going to fully load into tm, tm is gonna start removing random triangles until it works
ok
using trailmappers? or? whats your setup
if it has less than 32767 triangles then yes
Awesome use of the subtle messages
I've occasionally thought about making a horror story mod, this would be perfect for that omgosh!
Mod idea: Gravity gun. Allows the player to pick up and move physics objects as if their character is holding a tractor beam block
Noiro did it with the hands mod, its a tad janky
a tad?
@warm canopy i overwrote the default list audio but this audio is new i think
there may be more that arent on your site, idk
yeah new audio ids with 2.0
is there a way to change terrain using mods? Current trailmakers maps just move and resize assets, but what about changing the actual terrain? I was thinking about making a f1 racetrack with uneven terrain, which is basically what we have in real life, something similar to the track on melvin island, but the "smoothness" of driving on the melvin island track can't really be achieved with just normal assets.
nope
well... there should be a way 
i know right
api being kinda left in the dust 
just like there should be a way to change camera sensitivity for mouse and keyboard 
||i know this has nothing to do with modding, i just wanna show that i'm mildly infuriated||
Technically speaking it should not be impossible to extract the terrain from the game into a 3D modeling program, make your changes there, and then import it back into trail mappers. But don't ask me how exactly to do that because sigh looong story
but then there you're losing the "smoothness" of using in game terrain, like he needed
custom models aren't the best to drive on
I thought custom models were how people did terrain so now I guess I'm confused
some maps do yes, a lot of mine
most maps use a ton of prefabs combined together to create terrain instead, which is slightly better but you're quite limited on what geometries you can make and what textures you can use. custom models aren't perfect to drive on but provide the most amount of customization and is currently the best option for that.
can you not use the tarmac texture by doing that? Cuz i've seen some race maps but all of them have a grass texture for the track that just makes the vehicle slower
there's no such thing as different textures for custom models, as of now you can't change the grip at all
that's a bit silly
how do I extract the terrain from the game into a 3D modeling program, make my changes there, and then import it back into trail mappers?
Probably some way including a bunch of raycast points
You could use Blender to create your track and verge surfaces, then build up terrain around it using prefabs (eg like Greenstone Circuit: https://steamcommunity.com/sharedfiles/filedetails/?id=3355601599&searchtext=greenstone)
For F1 style tracks the custom object surface is perfectly fine. All the asphalt surfaces in my Asphalt Valley map are custom objects and that map is designed for making race tracks using Track Creator Plus.
but what i'm talking about is the fact that you can't make those custom objects have a "grippy" texture like tarmac, the asphalt for the circuit on your map is not actual asphalt and works very similarly to grass instead, my vehicle with top speed of 355 kph barely reaches 220 kph on this material, the metal diamond plate on the other hand is very grippy, acting just like tarmac does on any trailmakers map
even the "grass" on your map has better grip than the actual circuit, because it is an actual asset from the game
Not my map 😉 - but yes I know exactly what you mean and I agree it is frustrating that the custom object surface has so much more friction making it slower, but it's still very useable as a tarmac-like surface. BTW that 'grass' in your pic is actually a 'rock' surface I think.
i know (that the grass is rock)
355kph to 220kph sounds extreme, from what i've driven on custom objects it's around a 5 - 10% decrease
well, it's a vehicle with different "gears" so to say
Wait you are not in f5, free cam without f5 sounds nice (it took me a few seconds to see that you had ui and it wasn't the f5 ui)
when using the camera set position on a fast moving block, it seems the camera is offset from the block. does anyone know how to combat this? idk if the offset is linear, doesnt feel like it, and idk how to move the camera to stop this from happening
here i tried combatting this (there is a static offset of the camera + linear based on speed, didnt seem to help much)
It’s because the camera teleports between positions rather than move, it’s unavoidable. You can use lerp to try and smooth it out a little
? i dont see why the teleportation would have anything to do with it?
even worse, i think this may not be a camera specific issue but rather be in general. that is: Modblock.getPosition() is not at the same place where the block is visually when at high speeds
i think the game physics runs at a higher tps than logic, blocks(like moving blocks and blocks with inputs) and mods
when i was making the distance sensor range mod i had the same issue and i don't think it was the position being wrong but the physics tps being faster than the mod tps(i had my mod at 60 tps)
i don't really know if this is true but it is what i've observed
Idk, it feels like it lags behind for well more than a tick. Ill try to get better examples, but idk, its very weird and i dont like it 😦
at what speed do your missiles travel?
I... dont know. Like i can calculate it, but in practice it may work out to sth different. Ill check later today and tell you. But from my calculations its 530 km/h
and how many blocks would you say it lags behind by?
From my last tests felt more than 8, but i did some funky offsets so i will need to check what those offsets did (since i tried compensating for it)
if it's 8 than it's definitely not what i talked about
Hmm, maybe im misremebering the missile i used then? If you want, i can ping/dm you when im free and we can both test it out
yeah ping me and i will come help
Alr, will do!
Actually, with back of the napkin calculations, the delay seems to line up with 1 tick delay
if it's 1 tick delay then you might just have a old position or the camera takes 1 tick to be moved
Its not camera exclusive tho. Teleporting objects (flamethrower object for particles) also creates this effect
it the gif you showed flamethrower particles seemed to be always infront of the camera by like 8 blocks
Huh
Ye the particles are straight up on the ModBlock.getPosition()
Camera there is doing a funky (i made it do the funky to be precise)
not gonna lie but the camera catches the missile but it seems the flame particles are in front of the missile
Ye the particles are technically on the block position. I tried having the camera adjust based on speed, but didnt seem to help (unless i made it wrong)
what was the problem you had with the camera?
Same with the particles to be honest. I wanted the camera to be x blocks behind the missile, but as the missile accelerated, the camera moved further towards and then in front of the missile. The gif shows some funky code that isnt compensating properly, but the particles are on the block position which also shows the issue
how interesting
How annoying 😭
Problem with the camera position is that it doesn't seem to be delayed by just one tick, if it were the distance from the missile should be linear to the speed, and a fix for that is technically present in what he's doing.
The fact that the camera goes from behind to in front of the missile suggests that the original camera/missile offset grows logarithmically for some reason
Well i may have the linear adjustment wrong 😅, but it doesnt feel linear for sure
If the linear adjustment was wrong it should either slowly get further behind or further in front, but here it's switching from back to front
Unless it's the static offset doing funky stuff
looking at the gif the speed which the camera is closing in on the missile seems constant
i think you should add some ui which shows the speed of the missile and then with that see at what speeds the camera is at the missile, is behind it and is beyond it
I should, but idk how chaotic the code will turn out to be. Ill try when i get home
They don't
good to know
Anything involving physics will take at least 1 tick to show. A single frame isn't calculated multiple times
so the position given by GetPosition() is 1 tick delayed or is spawning something 1 tick delayed?
Spawning/moving/updating is
good to know
ye but i thought it would be delayed the other way. rn it feels that the mod happens faster than the game or sth. idk, its hard to explain
i am pinging you. going to boot up the game and add the speed display idea
nice
shall we go to DMs?
yup
ive managed to make a mod that can (somewhat unreliably) detect dropped server performance!
it now displays frametime in milliseconds (i dont know how accurate this is, or if its accurate at all)
but going off of ctrl+i networking hud's performance percentage and the millisecond behind value i think its accurate?
so setting physics speed based on lag does work but trailmakers does NOT take a fast changing physics speed very well (it crashes the server near instantly)
what might be happening is that changing physics speed messes up the frametime calculation, which makes it think its running slower, and then speeds up/down the game in a wave-like pattern
i have no idea why creations get absolutely sent though
changing physics speed too quickly or too drastically or a mix of both causes:
- inaccurate collisions (bouncing with abnormal velocity)
- extreme velocity applied to some weld-groups(?) as if you used many hinge glitches
- weld groups glitch similarly to how distant weld groups behave
changing physics speed past 200% (2.0) can cause severely incorrect things to happen
try 300% for a mild example
try 500% for a severe example
try 1000% to deliver all of TM's technical debt to your door
changing phys speed past 1.0 actually does bug out
according to this mod i made, repairing (including motion repairs) and teleporting are by far the most performance heavy actions in the game
issue is that most lag from this is only a spike and not a constant lowered performance level so lowering physics speed does not really work
seems like ModStructure.Destroy() is a bit unstable when used at the same time that a structure is spawned in
ModStructure.Dispose() seems to break build mode quite a bit, got stuck with a ghost gimzo and constantly rotating anything i had selected. was also unable to exit build mode, some blocks were "locked"
⬆️ ModStructure.Dispose() issues