#General modding chat

1 messages · Page 6 of 1

shadow iris
#

alvaroping1 about to hit you with the "not gonna happen"

cinder spruce
open acorn
#

that suggestion was mostly just for much larger draw distances whilst also not having fog obstruct it and make it completely useless

cinder spruce
#

someone should put the lighthouse in there

shadow iris
#

theyre now in

near parcel
#

sorry for the delay, can you try this configuration?

{
    "Lua.workspace.userThirdParty": [
        "C:\Users\Kai\Documents\LuaAddons"
    ],
    "Lua.workspace.checkThirdParty": true
}```
median cobalt
#

got tired of recoloring my crafts manually

#

currently making a palette swapping plugin

#

hopefully when it works it saves like hours of selecting blocks

median cobalt
#

honestly now i realize why i might want colored text

#

this could look amazing if i had it display a block character in the color

median cobalt
#

oop, ran across odd behavior

#

right, so i got the colors to choose from right here in my palette, normally these go to their dedicated editors

#

BUT, somehow, clicking them instantly returns it to... the previous menu for no reason? i dont even get my secondary menu and it acts like i pressed the back button

#

this only seemed to happen when i inserted my A/B function swapper for when i want to exclusively search primary colors or exlusively search secondary colors

#

lmk if anyone has spotted me lacking

median cobalt
#

full code block of PALEDIT

#

in fact it acts like the PALSWAP function is PALEDIT, still adding its own BACK button below. Am i hitting an interpreter limitation??

radiant lion
#

Can't see anything clearly out of place, but I can tell you from experience that the interpreter doesn't do stuff randomly (most times), I'd say put some logs and try to find out where the culprit is

radiant lion
median cobalt
#

it turns out that the culprit was function interlinking

#

the interpreter indeed did not like any of it

#

and im still figuiring out why it cannot handle my function correctly for changing the color

near parcel
#

i would need to see the full code to explain why, since global/local function and ordering matters in lua

median cobalt
#

I found out the issue

#

apparently setPrimaryColor and setSecondaryColor is unstable on the API side, seeing how when you change the blocks color once it apparently returns invalid userdata

#

and given i run this ALOT in a big batch, it basically guarantees to break

#

giving me a big ol Interpreter crash

#

i can see it swap colors but immediately crashes after anywhere from 2 to 10 blocks

#

meaning until this gets "a bandaid patch" i think ill be trying to circumvent it in vain

#

that is until i find out how to directly access blockdata

#

and the times it DOES work, it fails to parse color info properly
making it fullwhite

#

i guess im at the same spot ridicolas is with his custom color tool that i managed to barely work again with the same unstable progress

near parcel
#

We told you those functions were deprecated, they are not gonna be patched

median cobalt
radiant lion
#

I mean, I'm pretty sure ridicolas' one worked well, at least a while ago, if anything broke I'm guessing it was in the last update, same problem that's plaguing the missile mod's set color, tho I'm pretty sure those just don't work, without throwing errors

near parcel
shadow iris
#

is there a way to easily check for a structure's weight? this and would it be feasible to pick up a *nearby* structure in the general center of the screen if it's light enough?

near parcel
#

is there a way to easily check for a structure's weight?
only method is to loop through the blocks and add their weights. Iirc some multipart blocks gave an inaccurate weight, but the difference in an entire structure should be small (you can also hardcode a table from block name to weight if you have enough free time)
this and would it be feasible to pick up a nearby structure in the general center of the screen if it's light enough?
elaborate

radiant lion
#

Wasn't a mod to grab structures already made?

shadow iris
radiant lion
#

It is doable, yes

shadow iris
#

and im sure theres a thing for setting a block's buoyancy

#

this is for that raft minigame concept btw

radiant lion
#

Pretty sure there isn't

#

Just getting buoyancy, not setting, tho I might be wrong

radiant lion
#

Oh

#

Well, that's nice

shadow iris
#

does this apply if the block is saved as a blueprint, stored in the mod, and then spawned?

radiant lion
#

If it works same as thrusters, probably not

shadow iris
#

cause then i could just make all the spawnable debris beforehand

radiant lion
#

Is there also a setmass btw?

shadow iris
radiant lion
#

Nice

shadow iris
#

does setmass save in a blueprint?

radiant lion
shadow iris
#

my idea was to have parts floating in the ocean and you have to out, pick them up, and then add them to your build

#

but from the looks of it i cant have the parts float, "picking up" parts probably difficult to implement (unless i legally yoink the code with permission from that other mod) and maybe theyll stick to the build

cinder spruce
#

wasnt that mod made by noiro? im sure he wont mind

#

hands mod iirc

radiant lion
shadow iris
#

pfb_barrel has buoyancy but those dont despawn properly and slip under from builds super easily

#

and everything else (explosive barrel, tire) are kind of annoying to work with

#

and neither of those are parts

radiant lion
#

and you can't force players in build mode, nor spawn stuff in their build mode, so that's also a no

shadow iris
#

ay actually as long as it doesn't hang, these blocks stick to the build decently

#

but with 50 other blocks? idk

#

oh my god it works decently

#

so assuming i get all the other crazy stuff to work, raftmakers might be possible

shadow iris
void bone
#

I was thinking (I have no idea how hard this would be), that it might be possible to implement the new update's aiming servo for VR, with the option to aim at the left hand, right hand or the way the headset is facing. Idk just throwing it out there

near parcel
#

not possible, they will always face the camera and mods have little interaction with blocks

void bone
#

Ah

open acorn
open acorn
cinder spruce
shadow iris
#

whats all the sounds you can play

#

not sure how to log them with the thing you use to get them

cinder spruce
dapper jay
shadow iris
near parcel
#

you can use any of the strings there

cinder spruce
#

i think this should work

open acorn
#

hehe funny raft

dapper jay
#

are you making raft in tm?

shadow iris
dapper jay
#

first raft mechanic and now raftmakers

#

smh

shadow iris
#

as a name

primal raven
#

Does anybody know how to get the code for the smart canon if so I could use some help as I need it for a mod I’m making

cinder spruce
primal raven
cinder spruce
#

no mods rarely are able to change block values

primal raven
cinder spruce
#

the api only provides functions to change specific values for specific blocks (eg. thruster power, health, buoyancy, color)
theres is no function to change the values for gun damage/firerate

primal raven
#

So there’s no possible way to change the damage of weapons?

primal raven
cinder spruce
#

you probably used ModBlock.SetJetPower(power) to set the power of the engines, but unfortunantly theres no function like this that does that for bullet damage or fire rate

primal raven
#

I see

paper bone
primal raven
#

Yes I think I found I mod that did that but it lagged my game like crazy

cinder spruce
paper bone
primal raven
cinder spruce
paper bone
#

Yeah that sounds like a great idea

primal raven
#

Btw does the terrain on custom objects have to be glossy?

paper bone
#

No it depends on the alpha channel on your texture

#

So if your texture is very transparent your model will not have any gloss

primal raven
near parcel
#

Edit the texture file

paper bone
#

Your terrain should have a texture file

#

Edit that file to be very transparent

primal raven
#

In a 3d software?

paper bone
#

No need to do that in a 3d Software

primal raven
#

How then?

paper bone
#

Just select every pixel and crank up the alpha channel

primal raven
#

I’m not very educated on this topic so you may have to explain that to me

paper bone
#

Get your texture in a image editing software like gimp and put the transparency of your texture to be very transparent

primal raven
#

Ohhh I see

#

I kinda tasked my friend to get all the models and stuff for me while I actually made the map since I have no idea how anything other than trail makers building works

primal raven
#

Does anybody have a runway with taxi way custom object I could perhaps use in a map?

cinder spruce
primal raven
#

Does anybody know how to obtain the grass texture file?

shadow iris
primal raven
shadow iris
open acorn
#

used it with quite a few maps of mine

primal raven
open acorn
primal raven
#

Oh I see it now

topaz arrow
#

which value is height (in a position vector)? y or z?

radiant lion
#

Y

errant dew
#

I'm new to moding is it possible to check the light level of any spot in the world? and is there a list of all the commands?

topaz arrow
open acorn
dapper jay
ionic jacinth
#

Has there been any changes to the mod api due to this update? (Anything fixed/broken?)

near parcel
#

no

ionic jacinth
median cobalt
#

whats the new aim servo called

#

as a block item

#

patching my multiplayer HP mod rn

topaz arrow
cinder spruce
open acorn
#

not even PFB_AimingServo?

open acorn
#

RIP branded crate thingimabober

shadow iris
ionic jacinth
#

Do any of you guys think billboards would be useful as a modding feature? (IK you can do it with modgameobjects, but that is jank.)

shadow iris
topaz arrow
hoary skiff
#

shit, now I have to do that, don't I

hoary skiff
#

gimme a few hours I'm in school, my linux laptop can barely run trailmakers and it crashes often

#

not gonna stop me though

topaz arrow
#

Im really curious how youre gonna make the ui display the game nicely

#

Best of luck!

hoary skiff
#

but it'll hopefully be visible that it is doom

topaz arrow
#

Hopefully

hoary skiff
#

okay trailmakers just crashed while it was loading, this may need to wait until I get home

dapper jay
dapper jay
#

i forgot that text for mods is fucked

#

ok nvm the formatting doesnt even work

gaunt beacon
#

could someone create a mod that alows you to add or subtract attach points from blocks?

near parcel
#

no

gaunt beacon
#

why not lol

cinder spruce
#

because the api doesnt support anything like that

shadow iris
regal bear
#

Nothing wrong with people asking about what's possible. You don't know until you ask.

ionic jacinth
#

Is it just me or is trying to change the drag value on blocks really difficult?

#

I'm trying to reduce the forward drag (leading edge of wing) for 'PFB_ModularWingSmall' so that it works better for gliders, but I just get some really unintelligable results

#

If someone can point me to somewhere I can read more about this, or has a set of forward, back, left, ect... values I can borrow/modify that would be brilliant!

near parcel
#

Changing drag makes the game bug out

ionic jacinth
#

That is very very unfortunate. I will have to implement my idea a different way then...

topaz arrow
#

Actually not always, but in the vast majority of situations

ionic jacinth
#

I used these values with the ModularWingSmall: 0, 0, 1, 1, 1, 1 And now gliders can have long wingspans and a ~30% higher speed! without compromising either!

near parcel
#

The problem is that it's not consistent. Sometimes it works, sometimes it doesn't, sometimes unrelated blocks are affected

ionic jacinth
topaz arrow
#

is there a way to check wether a player has a camera?

near parcel
#

^

ionic jacinth
# near parcel ^

the comment you listed funnily enough is exactly the functionality I wanted from the setdragall function (as I was doing some block rebalancing for a mod), So that is why seems it works for me as I expected!

shadow iris
#

did custom asset loading get improved in 1.9.5? a 1920x1080 texture loaded in maybe 3 seconds and two ~22k vert models loaded in like 7 seconds total

ionic jacinth
#

Has anyone noticed that setjetpower(0) doesn't work for dragon jets and the large jet engine?

ionic jacinth
#

Crashed Oil tanker in the map I'm working on...

#

Annoyingly static objects that are 'not collidible' such as my oil spill still allow players to walk on it. If anyone has any tips to prevent this, pls help.

ionic jacinth
paper bone
#

why does the function AddForce not register / work? Did i use it wrong?

local selectedVehicle = tm.players.GetSpawnedStructureById("selectedVehicle"..playerId)
selectedVehicle.AddForce(0, 0, 10)```
> attempt to call a nil value
i have made sure that selectedVehicle is correct
dapper jay
#

probably too heavy

ionic jacinth
# dapper jay probably too heavy

I tend to multiply the force by the weight of the vehicle to offset this issue, By doing that, I was able to make a simple updraft system near mountains to making gliding in my custom map more fun.

paper bone
ionic jacinth
#

Why not go through all vehicles the player has with a 'for' loop, and if it's id matches the "selectedVehicle" then apply the 'addforce'.
(There is probably a better way to do this, but I'd recon this could work)

radiant lion
#

The GetSpawnedStructure... Returns an array

#

You gotta do [1] or iteratie through all of it

robust berry
#

how do i detect when a vehicle passes through a ring of fire?

radiant lion
#

You can't directly, you have to place a trigger inside it and create a callback function

robust berry
#

oh ok

#

is there a tutorial for that

#

i'd love to learn modding in general but i haven't been able to find anything to learn from

dapper jay
paper bone
radiant lion
#

I'm pretty sure it's because structures can break, so they still have the same id, but are separate

ionic jacinth
robust berry
radiant lion
#

You need to use this:
tm.physics.RegisterFunctionToCollisionEnterCallback(targetObject, functionName)
First you have to create a function, like you would with any other function, with a single parameter, the parameter is the is of the player that enters the trigger

leaden notch
#

any tank track mods?

shadow iris
robust berry
near parcel
#

*purely visually, it does nothing else (and even that doesn't completely work, as the tracks don't move)

radiant lion
#

I guess it's time for someone to make a realistic tank tread mod

loud slate
topaz arrow
#

what ways of interacting with logic do mods have? i know about applying a force, but if the force required is too high, then the whole build might be pushed, which i dont want, and if the force is too small, then inertia/air resistance (in moving vehicles) may also activate it. is there another thing that can be done that has a very small chance of being messed up on a moving build?

shadow iris
topaz arrow
#

wait, can you change the gravity per structure (or per block)?

topaz arrow
#

i know you can globally, so you can trigger sth globally with the new gravity sensor, but i need a per-build trigger

paper bone
topaz arrow
gritty wave
#

How hard is it to make mod?

#

i want to use my boat on the airborne map, but theres no water

cinder spruce
cinder spruce
#

yea the api is very limited, but we make do

gritty wave
regal bear
topaz arrow
regal bear
#

The spawn only has to be there for 1 tick. Also do custom objects that are set as trigger still get detected by distance sensors? If so that could work.

regal bear
#

I haven't tested a custom object but I tested a prefab set to trigger and it does indeed get detected by a distance sensor. As long as the prefab isn't near the player or wheels it shouldn't collide with anything.

shadow iris
#

new years resolution: win over trailmakers custom model loading

ionic jacinth
#

Does anyone have a spreadsheet that has every single block name (e.g PFB_Frame_2x4 [server], ...) in the game in it?
(I'm going to make a quick excel script that allows one to create a list sorted by those block names in lua, that can have additional .mass , .buoyancy columns with custom values in or nil if to not be changed to allow easier bulk block rebalancing for custom campaigns.)
The output would be something like this:
BlockProperties = { ["PFB_Frame1x2 [Server]"] = {Name = "", Energy = nil, Buoyancy = nil, Weight = nil, Unlocked = true}, ["PFB_Frame_1x1x3 [Server]"] = {Name = "", Energy = nil, Buoyancy = nil, Weight = nil, Unlocked = true},

#

Otherwise, I'm going to have to do this slowly and painfully...

shadow iris
#

wait whats that unlocked value about

ionic jacinth
#

Whether you have unlocked the block yet

#

You'll need to find it on the map first

shadow iris
#

trying to load a 9mb mesh into the game

#

ah the broken subdivision is 2.08mb, is that why it removes like 25-50% of the tris?

#

oh that does make sense

ionic jacinth
#

Biggest custom model in my map is 27.8kb, but could be even less with more optimisations

shadow iris
#

maybe it tries to reduce the model to 1mb so it deletes tris until it fits

#

and because its about 2mb, it deletes roughly 50% of the tris

ionic jacinth
shadow iris
#

thats what we know rn

#

but i might have discovered the thing

ionic jacinth
#

Why not use 4 models instead of 1

#

And have their centers at the same point in local space

shadow iris
#

ooh and those 22k vert trees are only a little over 1mb and 800kb, thats why it works

shadow iris
#

besides, ill do some automatic optimization in blender and then maybe a little manual for stuff like angled slopes that are jagged

#

youre never gonna believe this, the 526kb model loaded fine

#

im pretty sure it is a 1mb limit

#

and it just cuts out tris to fit into 1mb

#

or something

ionic jacinth
#

I think I'm gonna make the spreadsheet manually...

shadow iris
#

although i have this much detail to work with

#

ingame it will be 10x larger than it is rn

ionic jacinth
#

Just gotta make another mod that concatenates the log output...

#

If its flat, why have so many verts?

shadow iris
ionic jacinth
#

ahh

shadow iris
#

so yk terrain mesh

shadow iris
ionic jacinth
#

then you wil use the weld modifier and ctrl t to finish it off?

shadow iris
#

oh no one of the squares in the texture is 2 quads across

#

thus at 1x scale 1 quad is like 8 nub

#

80 nubs across per texture's squares

near parcel
shadow iris
ionic jacinth
shadow iris
#

oh and there goes blender

#

+1 blendercrash

#

oh nvm

near parcel
ionic jacinth
#

To produce a list with custom properties formatted for lua.

ionic jacinth
shadow iris
#

ok actually crashed blender

shadow iris
ionic jacinth
#

But a boat will be required...

shadow iris
# ionic jacinth I'm not going to give many spoilers...

i say this in the context of working on a campaign and needing to choose between building your own structure without limits, or only giving preset vehicles that have the limits. are you allowing players to build their own vehicles with limits, or are you giving preset ones, or something else?

ionic jacinth
#

I have made 3 different systems that direct players into building the right type of vehicles...

#

One just teleports them back to spawn if they use a blacklisted block, and then tells them the name of the block so they may remove it

shadow iris
ionic jacinth
#

Another system is changing the properties of certain blocks to 'nerf' them

#

The third system is making sure the environment is difficult enough to promote certain building techniques

near parcel
ionic jacinth
shadow iris
near parcel
shadow iris
near parcel
#

?

shadow iris
# near parcel ?

cleanly preventing certain unwanted blocks from being used in player-made creations, instead of only allowing pre-set vehicles provided by the mod

near parcel
#

on build mode leave->iterate through blocks->if any have a name banned, destroy the creation and show a subtle message with the banned blocks

shadow iris
near parcel
#

get the currently selected block->check name->display subtle message

ionic jacinth
shadow iris
#

oh gosh cmon now 3 tris are removed?

#

oh the bottom triangle still has collision...

near parcel
shadow iris
#

OH

#

I FOUND WHY ITS DELETING TRIS

ionic jacinth
shadow iris
#

32767 IS THE MAX TRI COUNT

#

I HAVE 32770 AND ITS DELETING 3

shadow iris
ionic jacinth
#

Fewww

#

Finally put (almost) all the blocks in trailmakers into an excel spreadsheet

#

213 entries

ionic jacinth
#

I've done it!

#

(Chatgpt did it)

#

I can now just edit a spreadsheet, and export a list formatted for lua that has all the specific block properties I need!

#

The spreadsheet:

#

The output produced by the spreadsheet:

ionic jacinth
ionic jacinth
#

An example of how I will use this spreadsheet, Is I will put the buoyancy of all wheel blocks to 0, and then set them to 0, so that the player cannot build any boats of any kind until they have unlocked proper buoyancy blocks...

ionic jacinth
# shadow iris wah boring

This feature has been done before in a crude way... But my implementation is far from boring... And it creates a completely different way of designing builds in trailmakers...

warm canopy
#

If you were looking for values that mods can obtain from blocks, you couldve used my block stats mod, it already produces a csv

ionic jacinth
#

Well, I've got the list of blocks now anyway...

warm canopy
#

Lol

shadow iris
warm canopy
#

Can't remember. Not sure if Noiro came across some limits

shadow iris
warm canopy
#

If its a limit, might want to confirm with the devs as-well as it could be a bug

ionic jacinth
#

Block Limitation System...

robust berry
#

does anyone know why my trigger box might not be showing up?

shadow iris
radiant lion
robust berry
#

does trailmappers offset object positions or something? i matched the position of the trigger to the ring of fire placed in trailmappers.

cinder spruce
robust berry
#

oh

cinder spruce
#

theres mods that display the coordinates of your player, use that to position the trigger

radiant lion
#

Iirc 300 or 310 lower

robust berry
#

i see, i'll give that a try

radiant lion
#

So 0 on mappers would be 300 in tm

robust berry
#

i recall altitude sensors only working with a certain offset now that u mention it

cinder spruce
#

its because trailmappers wanted 0,0,0 to be the test zone center, and test zone is 300m above the water level

robust berry
#

yeah

radiant lion
#

If need be I think the default spawnmod always shows your coordinates

robust berry
#

alright thanks you guys

#

alright so i fixed the coordinates but it still isn't there

#

is it not getting created?

radiant lion
#

Maybe, can you send that part of the code? Also make sure whatever function it's in gets called by logging something

robust berry
#

i tried logging a message but it caused an error :/

#

i'll show u the code

#

i have it somewhere near the bottom of main.lua, it's not nested inside of anything

radiant lion
#

TriggerBox doesn't need to be set to an empty vector, you can leave it at nill, tho that shouldn't cause issue, are you actually calling the function anywhere, or did you forget?

robust berry
#

i have to call it?

#

well that's probably it then

#

how do i call a function

radiant lion
#

Just:
createTriggerBox(whatever)

robust berry
#

oh

radiant lion
#

Tho that will only call it for the specified player, for now you can try putting it below the function itself, tho you might want to put in in the playerJoined fun function, so it gets called once for each player

robust berry
#

so just cut and paste into player joined?

radiant lion
#

The playerId is never used, so you can just add
createTriggerBox()
On the line after: end

robust berry
#

oh ok

#

and that will apply to all players or no?

radiant lion
#

Once a player enters the area the function onEnterTriggerBox will be called with the id of the player that went though it

robust berry
#

oh alright

#

it works!

#

but the collision function doesn't...

radiant lion
#

What's it supposed to do?

robust berry
#

add force to the structure that touches it

#

i might just be missing something obvious

radiant lion
#

Maybe too little force?

robust berry
#

no it gave me an error

#

"failed to call function"

radiant lion
#

If you show the code it would help

robust berry
#

here's the whole thing

#

i have very little knowledge of lua so this could be very wrong

radiant lion
#

It might just be that it's trying to call a function that doesn't exist yet, try moving the "createTriggerBox()" line after the onEnter.... Function

robust berry
#

oh ok

#

same error

near parcel
#

show the full error

robust berry
#

no clue what that means :/

radiant lion
#

Line 187 is the GetPlayerSeatBlock?

robust berry
#

no it's this

#

it's supposed to be a vector3 right?

radiant lion
#

Oh, right

#

Iirc addforce is quite stupid

robust berry
#

o

radiant lion
#

And if doesn't take vectors

paper bone
robust berry
#

whaaaa

paper bone
#

3 seperate values

#

X y an z

robust berry
#

is there a way to separate a vector3 into singular components?

radiant lion
#

AddForce(velocity.x, velocity.y, velocity.z)

robust berry
#

oh thanks

#

it works just as intended!

#

thanks everyone

#

but uhh

#

is there a way to get the weight of a structure?

#

cuz lighter builds will be affected differently than heavier ones, which i don't want

cinder spruce
#

probably looping through all the blocks in the structure and getting the weight of each

radiant lion
#

Yeah

robust berry
#

oh

#

sorry for being a bother, but how do i do that?

radiant lion
#

Unrelated, but why must getVelocity only work for players...

robust berry
#

also i don't see anything for weight in the documentation...is it missing something?

radiant lion
#

getMass

robust berry
#

ohhhh

radiant lion
#

Btw I'll be going to sleep, if noone else answers you'll get an explanation tomorrow

#

But in basic you use a for ipairs and the getBlocks (I think) function

robust berry
#

alright, i feel bad taking so much of your time anyway!

#

alright, i'll try it out

#

thanks for all your help today

radiant lion
#

Np, happy to help

shadow iris
#

anyone know of a tool that can automatically split a model into separate models based on tri count

#

cause i dont wanna just have aj do it all xd

paper bone
ionic jacinth
near parcel
#

Use both approaches, as checking in build mode isn't 100% reliable unless you want to tank performance

ionic jacinth
#

Unfortunately the drawback of my system would be that you can only check if your selected block is banned by clicking off it and clicking back on it, but it is a small price to pay...

#

hmm

#

maybe my method won't work...
It can work, I just need to be smarter...
I'm going to avoid adding this feature in as it isn't necessary, until I can find an example from someone else's code who has done it up to standard so I can learn the best method.

ionic jacinth
#

Is it possible ||no it isn't|| to make a subtle message without any texture popping up? Because when you leave it blank, a default icon is used, but is it possible to have absolutely nothing?
Seems like it is currently impossible... A 2x2 100% transparent png will work then...

visual basin
#

Is the any mod that allows for space thrusters to be configured?

ionic jacinth
quaint ibex
#

why are there no mods which let youadd power cores in campaign

shadow iris
quaint ibex
#

oh ok

paper bone
#

is there a way to use one of the other premade icons, so that i dont have to make my own? I couldnt find a list of them so im guessing that its not possible

shadow iris
paper bone
visual basin
ionic jacinth
visual basin
#

ahh thank you so much

paper bone
#

how can i save a vector in a json file?
do i have to save each axis separately?
since i dont see how i could create a new vector inside my json using the tm api

warm canopy
paper bone
#

thanks :D

paper bone
radiant lion
#

It's probably gonna be quicker if you just save the vector as a table and json that

#

Either as {X=v.x,.....} Or array style {v.x,v.y,v.z}

paper bone
#

alr thx

#
"chirpoPosition": {"X": -168, "Y": 274, "Z": 365},

so like this?

near parcel
#

Yeah

paper bone
#

thanks thumbsup_tm

dapper jay
#

You could save it as a string, you can pass that to tm.vector3.Create directly

novel maple
shadow iris
#

apparently

warm canopy
dapper jay
#

🐟

ionic jacinth
#

In my mod, due to the buggy nature of the custom map and to prevent exploits, repairing your vehicle will be disabled, so to make sure the player can get their vehicle unstuck (without using gyros as they will be banned), at slow speeds (<5m/s) the player will be able to yaw their vehicle with 'q' and 'e'. I've done some tests, and it is very difficult to exploit this system for free energy and it feels very satisfying to play with.

#

Feel free to copy this system/idea into your own mods!

#

Hopefully, when I put a bit more visual flair into the other features of the mod, they will be GIFified and posted here...

regal bear
#

nice 🙂

scenic echo
#

I need a bit of help, i'm trying to make a square horn explode when it gets destroyed, but i don't know how to detect when it gets destroyed, how would i detect that?

ionic jacinth
# scenic echo I need a bit of help, i'm trying to make a square horn explode when it gets dest...

I think you would make a list of modblocks and when going through the blocks in a build, add horn blocks to that list. Then save the position of those hornblocks, and check next time you go through the blocks in that structure if the same number of horn blocks exist. Then do the explosion at the position of the missing horn block.
It will require more than what I have mentioned, but is a very doable idea you have...

scenic echo
#

can you make explosions bigger?

dapper jay
#

you can spawn an explosion and scale it up

#

the results ive gotten seem kinda inconsistent to me but yeah

shadow iris
#

don't know why this happened but the corrupt model after the game forces the model to be <=32767 tris now has very weird tris from verts connecting which didnt before

#

wait these have collision... its dreaming up new tris with collision

#

oh is it trying to simplify the model but failing miserably because it also deletes 75% of the tris as well..?

shadow iris
#

where is mod cache stored, if we can access it?

warm canopy
#

In windows its %UserProfile%\AppData\LocalLow\Flashbulb\Trailmakers\ModCache

ionic jacinth
#

I have an interesting mod for everyone...

#

Fuel

#

Unfortunately this system is a bit too long to demonstrate within a GIF, so I've used a Youtube video instead.

regal bear
#

Nice! Will there be a way to set how much fuel you put in or will it just be block based?

ionic jacinth
#

Each non functional block can store fuel. Usually a little less than it's weight, the 30kg and 50kg blocks store the most. I can balance this using a spreadsheet.
For example, flap wings store 0.6 litres of fuel, but non flap wings store 1.2 litres. This incentivises the player to use the minimal amount of functional blocks and design their vehicles intelligently for the task at hand.
I could theoretically refill predefined amounts/percentages of fuel, but that is not necessary for my mod.
The player refuels fully when they are at the home base (located at the centre of the map).

dapper jay
#

do you disable the engines by setting their power to 0?

ionic jacinth
# dapper jay do you disable the engines by setting their power to 0?

Yh, Ideally I would be able to save the detected engine modblocks and check if they are on or not, but as we know the API can't do that (yet 🤞). Instead, I have to disable them until the player presses down the space bar and redisable them when the space bar is depressed.
(The thrusters crash the game if set to a power of 0, so I set them to a power of 0.1)

regal bear
#

The drafting update for Track Creator Plus is now live:
#1242291936715608205 message

ionic jacinth
#

I've been making an item collection system. Blueprints will be scattered across the map, and once collected, the player will be able to build with the item(s) inside. But its awfully complex.
Has anyone done anything similar where items are scattered around and can be collected?

dapper jay
#

probably not

#

how would you prevent players from using the parts they havent unlocked yet?

ionic jacinth
#

The illegal blocks are added to a list during build mode. And in order for fuel to be able to be used, you have to enter build mode.

#

And if the number of illegal blocks in the illegal blocks list exceeds 0, the player is teleported back...

dapper jay
#

ah i see

near parcel
shadow iris
#

for spawning/collecting items

ionic jacinth
#

Backface culling for custom objects is a blessing!

#

And also a curse... It seems the autogenerated LODs aren't a fan of this technique...

shadow iris
#

omg this texture even if low res is pretty

#

i had a better setup but ill try getting that back

wispy crescent
#

How hard would it be to set up custom spawn points that behave like the proper ones where by passing into its bounds sets it as your respawn point? Would it be able to work for individual players so they can “discover” spawn points independently?

radiant lion
#

Not that hard, if you are fine with square checkpoints

#

Actually circulars won't be any harder, if you can find a spherical asset that can be invisible and non-collideable

wispy crescent
#

I’m guessing it also wouldn’t be hard to spawn a object to indicate you’ve activated it, though that wouldn’t be distinguished between players unless you gave each player they’re own color but that’s starting to sound over complicated

radiant lion
#

Ye, can't show an object to a singular player, so that's a bit more finicky

#

If anyone wants to do it themselves feel free to, else I could add it when I return active-ish (February)

wispy crescent
#

I could try, but last time I looked at a document describing how to code in the relevant language my brain shut off. I need to find less dry learning materials

paper bone
ionic jacinth
#

I have finally got saving progress, and collecting items to work within my mod!

#

It is now possible in my mod to collect new blocks from items scattered around!

#

Just gotta finalise and GIFify!

#

This is currently the item model I am using for my mod... but I need something that makes more sense than a chunk of ore...
I thought a blueprint might make more sense, but It would feel weird to have floating blueprints scattered around...
(For context, the interactable item, gives you access to build with a new block)

ionic jacinth
#

I might see if I am able to make a hologram effect for these items...

ionic jacinth
#

This is the best hologram effect I can currently make 😦

#

(Devs we really need transparent textures!!!)

#

This one is slightly better

ionic jacinth
shadow iris
shadow iris
ionic jacinth
ionic jacinth
ionic jacinth
ionic jacinth
#

I think it will be time for a GIF

ionic jacinth
#

This is a demonstration of the system that allows my custom campaign to function. Players will be able to find toolboxes scattered across the map, and when they collect them, they will unlock a new block to help with their exploration!

dapper jay
ionic jacinth
# dapper jay Maybe the outline should be white instead of black?

I originally wanted to do that, but the culled faces still produce shadows, so a white outline makes shadows onto itself, turning it a weird grey. So I unfortunately have to use black as it won't change colour.

If we were able to use emissive materials, I wouldn't have this problem

hot patrol
#

is it possible to mod the pc xbox gamepass version?

near parcel
#

no

shadow iris
ionic jacinth
#

For any of you curious, I am making a new map for my campaign mod, this one will have many more environmental challenges and be far far bigger (My last map was 2000x2000 and this one may be 4000 x 4000 with much more land focused gameplay). The attached GIF is an example of one such challenge. Of course the player can solve the challenge a different way, but that is part of the fun!
One downside, is that almost all of my challenges will require a fairly good understanding of TM physics meaning that less skilled players may struggle...

shadow iris
# ionic jacinth For any of you curious, I am making a new map for my campaign mod, this one will...

One downside, is that almost all of my challenges will require a fairly good understanding of TM physics
this is a good thing. i would say a significant part if not majority of the community doesn't really have difficult challenges besides stuff like build challenges, which aren't really baked into the game itself as much as a campaign is. my thought process is that i want a challenge, and think a lot of people do, so why not make some?

topaz arrow
#

better yet, if someone doesnt know, but is willing to try, may learn stuff about the game they didnt know

shadow iris
near parcel
#

generally the people who download mods for a game already have experience, so it's a different audience from the normal campaigns

shadow iris
#

any tips/suggestions for mod icons? we need ones for map overview info, vehicle garage info, mission start/end/fail/info, player save data info, and probably a couple more generic mod info ones

#

my current idea for generic mod ones is to use that cube in the top left, and then a symbol for what type it is (info, alert, saving)

#

generic save icon is now also "done". idk about whether to move them further apart or to keep it scaled down like it is right now. if i keep them at the same scale i'd have to move them apart because they're too close but then it looks bigger than all the other vanilla icons. scaling it down causes it too look too small compared to the cube

ionic jacinth
#

Does anyone know how to stop my custom 3d models from having black faces?

#

Some of the LODs contain black faces which don't normally appear in the LOD 0 of the custom model

near parcel
#

you can add a small vertex/triangle far from the normal model to extend the max range for highest quality LOD, although you will need to spawn it with concave hitbox to avoid weird collisions and might result in slighly worse performance (since you are essentially bypassing LODs, it's up to you to adjust the range for them to keep being effective)

ionic jacinth
#

I'll try that...

#

The one with black faces is before the fix. Thank you Alva.

ionic jacinth
#

Why is it that no-one talks about the wind volume prefab?
ITS BRILLIANT! And it works exactly like the wind in high seas!

#

This will allow me to make a wind tunnel that can only be surpassed with enough downforce or engine power!

near parcel
#

because afaik it stopped working correctly a while ago

ionic jacinth
#

What part of it stopped working?

near parcel
#

iirc it just did nothing, but i haven't personally tested it

ionic jacinth
#

Mine is currently working on Great Carrier Reef
(I wonder if it stops working in multiplayer or under other conditions...)

regal bear
hoary skiff
#

Would mods ever get a tab built in game for consoles? Would make sense to be in 2.0 imo, I understand it might be challenging, but certain features like fan maps, and complexity mods are locked away from playstation and Xbox platforms.

near parcel
#

Likely not, and complexity definitely no

hoary skiff
#

RIP my hopes and dreams, kinda don't see increased complexity as an issue, but if it's off the table I'll live with it, kinda do want custom maps tho..

#

I'll keep prayin I guess, might get noticed one day.

radiant lion
#

As of now you can't even get controller inputs with mods

#

Aka even if you got them on console they can't really do much

shadow iris
#

what was the website that had all the audio again

ionic jacinth
#

I have another GIF for all of you! To access one of the areas in my map, you will need to get through a chokepoint with strong winds! If your vehicle doesn't have enough downforce, you'll just be chucked away!
This allows me to design challenges in areas only accessible to specific vehicle types which should make the challenges harder to cheat!

cinder spruce
ionic jacinth
shadow iris
#

puts gigantic wind block over original trailmakers map to prevent players from accessing it

#

or just around the whole map in general

ionic jacinth
radiant lion
#

Encase the original island inside a very big dome

#

The Simpsons style

#

Scaled up force field + invisible ball for collision

ionic jacinth
#

By default, the wind speed of the wind volume is 58...
And this doesn't change regardless of the scale of the wind volume...

#

And wind is not additive, so having two parallel wind volumes stacked on top of each other, doesn't double the wind speed

#

HOWEVER!

#

Wind is subtractive!

#

If two wind volumes point in opposite directions, they will cancel out

#

And they cancel out each other's x, y and z vectors respectively!

#

Using this, you can make wind of any vector with a magnitude less than 58 in the overlapping region!

#

And potentially, this means that if you dynamically place wind volumes at the player's position using a lookup table which states what windspeed should be where with interpolation of some kind, you could create a very intricate custom wind system!

#

I might do that once I finish my campaign mod...

#

I've just done some quick maths, and I think this is very very doable!!!
And will involve isosceles triangles!
Edit, the vector maths is incredibly difficult (for me, even though I'm decent at maths!) and it will take me a while to make a Lua function that does this wind cancelling out
I've figured out the maths... Time to turn it into code...
The code is taking its time, but desmos is a trooper in helping me figure it out...
Also, this will be GIFified once I am done!

ionic jacinth
#

I have made a variable wind mod!

ionic jacinth
#

The PowerCore crate shows the direction the wind is heading to!
(It is not shown in this GIF, but you can control the magnitude of the wind...)

#

We technically can have wind in any map now!

#

I'll probably clean up the code for the wind function, then share it...

#

The general idea is that PFB wind trigger boxes have a magnitude of 58, so by using two of them, and rotating those two so that the resultant vector is the vector of wind we want, and then placing those two boxes onto the player so that they overlap, we can make wind that can be of any magnitude and direction!

#

The tricky part is figuring out the rotation since it requires the quadratic equation!

shadow iris
#

trailcargo campaign mode is probably going to run like complete garbage but its gonna be so amazing tech/feature-wise

#

hopefully the sandbox mode is performant

#

im pretty sure all that will be in the sandbox mode is:

  • the detailed map
  • spawnpoints + custom map screen
  • dynamic and configurable wind
  • toggleable dynamic time of day
ionic jacinth
shadow iris
quiet chasm
#

anybody have or know of an oddly spesific mod?

#

cuz i need a mod that will tell me like turn times and roll rates n stuff

shadow iris
#

you can use those big red mushroom prefabs i think in the shrub category as a grass surface

#

and then cover it with no collision stuff

ionic jacinth
#

Does anyone know why the wind volumes cannot be moved by .gettransform().setposition(pos)?
I currently have to delete and replace them which is laggy

warm canopy
#

They are a non-moveable object

#

My guess is because the wind itself is not really tied to the object, it’s more like a trigger. Wind also disables if you are not that far away from the object

ionic jacinth
#

Eh, its not that big of a deal fortunately

ionic jacinth
#

I am currently making some optimisations to the wind calculations, so they can be faster!

ionic jacinth
#

I have released a Utility for making custom wind in trailmakers!

ionic jacinth
#

I have uploaded a mod to the workshop called 'Hash wind mod'

ionic jacinth
#

Please try it out!

ionic jacinth
shadow iris
ionic jacinth
#

They'll never do that within the next 2 years

#

I have lost all hope

shadow iris
ionic jacinth
shadow iris
ionic jacinth
#

hmmmmm

shadow iris
#

uhh some of the important changes/improvements/additions in general were:

  • better custom asset loading times
  • better texture material support (we have roughness, but theres other things like emissive)
ionic jacinth
#

I think there are quite a few random additions to some of the systems we have, like getting the velocity of a block, or the current logic input

#

I might make a list in my spare time and try and rank it from easiest to implement to hardest.

shadow iris
near parcel
ionic jacinth
#

If we had a concise list of ideas, that would be nice

near parcel
#

#1123915629653667943 is what the devs use to see what to add to the API

ionic jacinth
#

Sometimes its nice as a modder to be able to see an overview of what API changes might come ||(in 10 years 💀 )||

near parcel
#

that would essentially be the same as #1123915629653667943 , if you don't open the posts you can see a summary from the title

ionic jacinth
#

This list I would make, would likely be private anyway, so saying its redundant is not important to me.

paper bone
#

I should maybe put this in vote modding features then

radiant lion
#

skimming at the suggested features i'm also surprised there is no mention of tri creation, there has been quite a lot of talk about it

serene magnet
#

Just wanted to ask here if there was a way to give a custom object textures like glow and such. Wanted to create an asset pack of neon objects but wanted to see if its possible

cinder spruce
serene magnet
#

Ah dang

#

I didn't know about the roughness value either so thats also helpful LOL

#

Welp. Glad I asked before I made all the models

ionic jacinth
#

I would like to point out that fast communication between mods is possible, and I'm not talking about doing so through a complex multi raycast system. you can use the getwindspeed() function to get the windspeed from wind volumes places by other mods. And by using my function that modifies the windspeed at a position, you can make two mods communicate via a 58 signal bus (same as sending 6.5 bits of information between each mod each frame). I'm not really bothered in doing this myself, but it could be useful as a way to make modpacks, or make compound mods which are less laggy. And even better, by placing the wind volumes underwater, they don't affect players, but getwindspeed() still works!
If anyone does this, I would propose that both 58 and 0 are null signals, as other wind volume mods could interfere with the sent signals.
You would need to be able to code both mods, or you can say use position 0,-100,0 as your information access port, and have other mods access the windspeed information put through that channel.

near parcel
#

if you want to make a modpack, you can just bundle all mods and load them on your main mod. Way faster communication with no overhead/lag, and users just need to install and load a single mod

ionic jacinth
#

it could be useful as a way to make modpacks
Emphasis on could.
In the context of modpacks I would imagine the main benefit would be allowing players to install just the modparts they want in a sort of jigsaw puzzle way, and to allow those individual modpacks to work together in some limited fashion.
Also, working on one huge mod is a pain, and if its possible to split it up, personally thats what I would do.

near parcel
#

mods are small, just having flags to enable/disable components of a single mod would run much better in practice at the cost of just a few MB of extra storage in the worst case (which on PC nowadays is basically nothing)

#

Also, working on one huge mod is a pain, and if its possible to split it up, personally thats what I would do.
you can split mods using tm.os.DoFile(filename)

ionic jacinth
#

I haven't used that function whatsoever so I don't know

near parcel
#

if they are global, yes, but using global variables is a terrible idea anyways. If they are local, they can only be accessed in the scope they were defined in

ionic jacinth
#

I tend to avoid global variables for most things, but knowing that they can be used for this... I will make my mods far better!

near parcel
#

if you use local variables defined outside of any function, they can only be accessed/modified through code in the file they were defined in

near parcel
ionic jacinth
#

I'm lazy 🫡 so Global variables it is

near parcel
#

that will only give you more work a couple weeks from now when your code becomes and unreadable spaghetti you can't reason about

ionic jacinth
#

🍝 Spaghetti code is delicious! ||Jokes aside, I don't actually make mods complicated enough for them to become spaghetti||

warm canopy
#

Im one step ahead, I also had the exact same idea a week ago with the cross-mod communication

#

The problem is that wind despawns when out of player range so it cannot be relied on

#

I did however make a system that could communicate bools and single digits between multiple mods with help of raycast but idk

radiant lion
#

You just might be able to do send a quite large amount of data if mods can get the same spawned structure by id

#

Tho technically it can be done even without the getstructure(id)... The problem is the builds despawning when the player backspaces

warm canopy
#

The only way I could find when testing that couldn't be impacted by the player was having a raycast measure the hit position of a resizing cube that resized in height.

radiant lion
#

Devs should totally add a realistic way to communicate between mods, having an analog signal simulator, complete with noise and a low pass filter

ionic jacinth
#

I think I may make a quick and dirty test mod to test the despawn limit, so that I can find out it my approach is practical or not

warm canopy
#

But you cant move the wind object, youd need to constantly spawn/despawn the wind object at the player and that might be pretty heavy in terms of performance impact

ionic jacinth
warm canopy
#

The other option is you use the time or teams to store data

radiant lion
#

I do still think that using thrust/health or whatever of a spawned vehicle would be one of the best option

warm canopy
#

The moment someone pressed backspace though all hell breaks loose

radiant lion
#

No interference between sets of mods, you can transfer full floats without imprecision, the only problem is loss of data on respawn

#

Of course you make sure it's handled properly, even the wind moving is gonna have some minor down time and you don't often need to transfer data on respawns

#

And possibly the build will despawn after 15 minutes

ionic jacinth
#

I think the limitation with the wind system is the distance at which it despawns. If it despawns 500 units away, it will be doable, <100 units will be near useless
Also depends on if x, y and z have different despawn ranges

#

There is one other hacky bad option that shouldn't be considered...
Have an external program read and edit values in each mod's datadynamic folder automatically...

warm canopy
#

Then it looses the ease of it just working

near parcel
#

in practice, just bundling the mods will work better than any hacky solution to communicate independent mods

warm canopy
#

Probably but this is way more fun 😛

#

Also only works on treasure island as thats what it was setup for

ionic jacinth
#

An example of where this would be useful is being able to decouple maps from their custom campaigns

near parcel
#

it would be useless in that case, since the map itself shouldn't have any logic other than the map loader (if decoupled), and as a result doesn't have a reason to send/receive any data to/from other mods

ionic jacinth
#

It might, you never know...

radiant lion
#

If the map has some moving part and you need to, for example, spawn stuff on it, it would be needed

#

But it's very niche case and only needs to get synced once

#

So a raycast won't be an issue

ionic jacinth
#

An example, would be a tunnel filled with wind. By default, this stays in the map mod. but the campaign mod may want to disable/reenable it during a cutscene ect, so being able to communicate would solve this issue.

near parcel
#

if you know where the wind is, you can disable it with a second wind in the opposite direction, no communication needed

ionic jacinth
#

for this example maybe, but if the wind works in a more complex way, which it will be for any of my mods, then your method won't work

radiant lion
#

i present you some quite cursed and possibly useless tech

#

that's right, i'm building a cube piece by piece, since the devs didn't make the function to spawn custom tris i had to make one myself, no more pesky loading times and welcome real time procedurally generated stuff

#

||it's quite terrible, the hitbox is totally messed up, and even like this it gets culled from quite close up||

warm canopy
#

It’s built using triangles?

radiant lion
#

ye

warm canopy
#

Noice

radiant lion
#

i honestly think it'll kill the performance as soon as you spawn too many

warm canopy
#

Maybe, the terrain generator I made generated the mesh first then spawned it but maybe your solution is more performant

radiant lion
#

it should be quicker since it avoids having to load the mesh back into tm, i've sen how slow procedurally generated terrain like that is

#

tho, do note, it's a terrible idea to try to read and parse a large obj file all in one go, should be done line by line in the update function

warm canopy
#

Wait you are reading a obj file currently?

radiant lion
#

yeah, i can spawn triangles standalone, but rn it's together with an obj parser

warm canopy
#

Ah Nice

radiant lion
#

btw the limit of object parsing is somewhere between 8 and 459127 vertices

#

to be fair i don't know what i was thinking making the game create a table of half a million vectors (i didn't check how big the object was)

#

incredible render distance

radiant lion
#

Not

#

All the tris get the same texture

#

It's mostly a proof of concept/challenge to myself, it honestly has too many drawbacks, tho it should work quite well for generated terrain and road

warm canopy
#

You might need to add a random polygon out of view

radiant lion
#

It's already there

#

Without it it's much worse, believe it or not

warm canopy
#

Maybe have the model bigger then scale it down?

radiant lion
#

That worked?

ionic jacinth
#

Very very impressive. Could this (theoretically) be adapted to animate things, like waves on a subdivided plane?
(Ik it would be too much effort lol)

warm canopy
#

Has for me in past I think

radiant lion
#

I'll see

radiant lion
warm canopy
#

Yeah unless it’s a rigidbody

radiant lion
#

It's also gonna need a move Tri function, but it's not hard to add

paper bone
radiant lion
#

With enough effort...

#

Tho a bit scuffed since the hit boxes would need to be disabled (unless you are fine with 0 LOD)

radiant lion
#

Due to how triangles and scaling works, I can use one object for any acute triangle, but I have to split obtuse triangles into 2

#

(yes, with a different 3d object it is technically possible to achieve obtuse triangles, but not all of them)

#

Long story short, moving triangles will require every Tri to already be split into 2 objects, could get laggy real quick

radiant lion
#

damn it, we have structure ModStructure.GetVelocity but not ModGameObject.GetVelocity

radiant lion
#

is it me or ModGameObject.AddForce straight up doesn't work? (i remember block having that same issue a while back)

#

like, any of the 4 options, on every object i tried till now

#

my guess is the function is broken..? it should work at least on the player, at least it did so when i jankily added it via dlls

radiant lion
#

came out a fair bit worse than expected

#

but it works-ish

#

tm really isn't happy, a 4x4 with cover lags way too much, same as a 5x5 coverless

cinder spruce
cinder spruce
radiant lion
#

The physics itself is decent, but the tris really don't like it

cinder spruce
radiant lion
#

||what if I were to say tank treads||

ionic jacinth
cinder spruce
#

maybe wheels alone first

shadow iris
#

@ionic jacinth dirt particles are a bit messed up with your new wind mods

#

but this isnt really fixable is it

ionic jacinth
#

Unfortunately not, the solution I used is quite hacky, even the windsock piece points in the completely wrong direction...

#

I have just thought of one or two optimisiations I can do for the wind mod. (I forgot to set some variables as local...)
I'll update the mods soon

radiant lion
#

Or like... The unity wheel collider... That could have been something... Tho iirc main TM also doesn't use it

serene magnet
#

Quick question: are you able to apply custom textures to the objects that come with the game?

near parcel
#

No

serene magnet
#

Dammit

#

Now I'm stuck between two rocks. Too many polygons to render custom assets, too many textures to use prefab from the game

cinder spruce
#

made a new g force mod that actually uses centripetal acceleration, as supposed to noiros which i don’t think uses it.

#

it feels a bit more natural

cinder spruce
#

or am i just in the wrong place?

shadow iris
#

yeah a bookmark i had that did work, no longer does

#

its been nuked

#

😭

cinder spruce
#

welp time to find spawnable prefabs the normal way

cinder spruce
#

yea mb

shadow iris
#

we had a list of broken pfbs over in trailmappers thread

#

out of date objects is close enough

cinder spruce
#

thanks i got it already

wet grail
#

Is it possible to add custom models to Trailmakers?

radiant lion
#

Yeah, as long as they aren't too complex

wet grail
#

I wanted to make a tornado object but didn't know if it was possible :)

radiant lion
#

You can't make stuff semitransparent unfortunately

wet grail
#

It doesn't need to be semitransparent

#

Plain colour would look good still

radiant lion
#

Well, then you can look at the default spawnmodadv to see how to spawn them

weak wolf
#

hi guys, i hope this is the right chat for this. im trying to upload a modded map i made with trailmappers, as i did a few times before. But now i get a message that im missing a main.lua file. I have no clue what that is and why now all of a sudden i need it.... help?

near parcel
#

did you export the map?

weak wolf
#

yeah. saved and exported. Also tested it a few times in Trailmakers. Works just fine, just wont let me upload it

near parcel
#

what are you writing for the directory?

weak wolf
#

C:\Users\ ...\Documents\Trailmappers\Saves\Rally Mania

#

Rally Mania being the name of the mod and thus also the name of the folder

#

ah wait... i gotta add \Map.json dont i? i kinda missed that for days but now i feel like thats the easy solution

near parcel
#

use mods/Rally Mania

serene magnet
#

hey, how would i change the roughness on objects?

shadow iris
cinder spruce
#

has anyone found an efficient way to detect block damage or destruction on creations? i really would like to make a mod that makes bullets have an explosive effect on impact but i cant think of great ways to detecting block damage that isnt likely to be really laggy

cinder spruce
#

yea makes a bit of sense

#

kind of liked the structure of this website though

keen sierra
#

Is there any kind of documentation for moding in tm ?

paper bone
radiant lion
keen sierra
#

thx

shadow iris
#

whats the limits/requirements for the mod icon again? it isnt uploading for me
512x512, 363kb

#

oh it isnt working even with trailmappers' icon

#

still isnt working but at least the default icon loaded

radiant lion
#

Don't remember if jpg or png

shadow iris
#

rn its probably an issue with tm servers because regardless of if its trailmappers' export or my own, it fails to upload the icon

serene magnet
#

Quick question: can trailmakers run async functions?

near parcel
#

you can use corutines for that, but if you want an async/await syntax you need to implement that yourself

serene magnet
#

sick

serene magnet
#

of course as soon as i get increment based spinning done on my saws i figure out quaternions exist and might be able to make my rotation both smoother and faster

#

yay

late zinc
#

Please mod money

shadow iris
#

can somebody else upload a mod and see if custom mod thumbnails are broken? seems to still be broken for me

#

363 KB, 512x512, .png
trailmappers exports a 720x720 .png around 650 KB

HOWEVER i tried uploading the same mod with trailmappers' thumbnail and it also didnt work

#

ofc it works for the test upload but not the actual one god damnit

#

YAY IT WORKED but for the space-less version and only after like 20 attempts

serene magnet
shadow iris
#

YESSSIRRRRRR

serene magnet
#

Nice nice

crystal laurel
#

Are there any mods for a big city map? Something to build cars trucks and things for

shadow iris
serene magnet
#

does anyone know how i would set the Axis when im creating a quaternion. the docs just say its a vector3 but i am being small brain

crystal laurel
#

Thx

hollow yew
serene magnet
#

figuring out smooth rotation. yippee

serene magnet
#

Are you able to use something like Lualanes to multithread within trailmakers?

#

If not then I can write my own multithreading library I just wanna see if I can save myself some work

near parcel
#

Iirc lua by default has no support for multithreading, you can only use corutines for collaborative multitasking

serene magnet
#

yeah i just wanted to know if i could use libraries with the lua interpreter in TM or if i had to write my own local plugin to handle threading

#

well to psuedo thread

near parcel
#

if the libraries use lua 5.2, don't have dependencies/multiple files, and don't use any of the disabled std lib functions, you can use them. Otherwise you will have to tinker a bit with them to get them to work

cinder spruce
#

does anyone have a list of the default color values?

robust anvil
#

is there a nuclear bomb mod

cinder spruce
#

i believe there was but i dont think it was ever uploaded
it was made by noiro and i dont think hes coming back to do so

scenic echo
#

how do you use raycast and know when it hits?
i have something like this and it does not work

local ray = tm.physics.RaycastData(pos, rot, 1200, false)
if ray.DidHit() == true then
....
end

radiant lion
#

Iirc you put a variable as the last input instead of false, the function then changes is to true if it hits

#

local hit=nil
local ray= TM.physics.Raycast(pos,rot,hit,1200,false)
if hit ~= nil then
...
End

#

This should work

#

If you want to use raycastdata instead of raycast yours seems correct

scenic echo
#

is hit the position of where it hit?

radiant lion
#

Yes, hit gets changed to where it hit

#

If it hit

scenic echo
#

can raycast hit blocks?

radiant lion
#

Last I checked yes

scenic echo
#

if i get the position and rotation of a block and use those for the raycast will it work?

scenic echo
#

my problem was the ray not hitting

scenic echo
#

How can i get the rotation of a block? i tried GetRotation() but it doesn't update in real time

radiant lion
#

Rotation is local

#

Welcome to tm

#

You have to use .forward() and .right()

scenic echo
scenic echo
#

is there a way to remove a keybind made with tm.input.RegisterFunctionToKeyDownCallback(playerId, functionName, keyName)?

near parcel
#

i don't think so, but you can add a check at the start of the function that returns without doing anything if some flag has been set, removing it in practice

serene magnet
#

is there any way to read the data of a specific axis on a vector3?

#

i could try using string.find but i wanted to see if there was a less hacky way to do it

radiant lion
#

.x .y and .z

serene magnet
#

thanks

serene magnet
#

how do you use triggers? i have some stuff set to it but i cant find either on the docs or the wiki on how to actually return a call when they are touched

regal bear
#

--- Registers a function to the collision enter callback of a game object
--- @param targetObject ModGameObject
--- @param functionName string
--- @return function
function tm.physics.RegisterFunctionToCollisionEnterCallback(targetObject, functionName) end

or

--- Registers a function to the collision exit callback of a game object
--- @param targetObject ModGameObject
--- @param functionName string
--- @return function
function tm.physics.RegisterFunctionToCollisionExitCallback(targetObject, functionName) end

#

@radiant lion knows more about it than me though as he wrote the code I use for checkpoints - ie getting more data out of a hit than the default register functions give you.

serene magnet
#

thanks

#

problem

radiant lion
#

just need to write the name as a string

serene magnet
#

oh

regal bear
#

eg.
tm.physics.RegisterFunctionToCollisionEnterCallback(pitInTrigger, "onCollisionPitInTrigger")

serene magnet
#

ayyy it works

#

and it stopped workingh

radiant lion
#

any errors?

serene magnet
#

no errors in the logs

#

and if i walk on them they trigger, what the heck

regal bear
#

So does your button call the same function as the trigger box does?

regal bear
#

A button sends callbackData, the triggers only send the playerID I think

radiant lion
#

is the objects set as trigger?

radiant lion
serene magnet
radiant lion
#

ah... right

regal bear
#

how tall is your trigger box?

radiant lion
#

yeah, the problem is simpler than expected, they just only detect players

#

not builds

serene magnet
#

the backside is even culled

radiant lion
#

so spawn a trigger, make it invisile and place it covering the area above

serene magnet
#

so maybe spawning a invisible cube above it with no collisions could fix that

regal bear
#

the trigger box needs to be high enough to collide with the player

#

or make a trigger box with the triggerbox function

radiant lion
#

use tm.physics.SpawnBoxTrigger(position, size)

#

(better than spawning a cube, as those still have collision at times)

#

rotate it to match with the floor

#

and make it high enough so any bot gets detected

serene magnet
#

fixed it

regal bear
#

and then once you are happy, make it invisible

serene magnet
#

just changed the scale attribute of my 1 face thing to like 1000 y

#

doesnt change the size of it because its 1 face but changes the hitbox

regal bear
#

yep but you will have wheels and the player collide with it

serene magnet
#

collider is above the arena

#

so its only using the non collidable box

radiant lion
#

well, if you see any weird behaviour you know what to do

serene magnet
#

yep

radiant lion
#

but supposedly it should work, as long as the collider is that far aaway

regal bear
#

yeah making an object that already has a hitbox into a trigger does not get rid of all the collision

serene magnet
#

yeah i noticed that with my floor tiles

regal bear
#

in trigger mode an object's hitbox should be what makes the trigger work - but i could be wrong.

serene magnet
#

thanks for the help yall. im very much still trying to figure this all out LOL

regal bear
#

np. I only figured things out by asking here. I still am figuring new things out lol. It never ends.

serene magnet
#

im still trying to keep my bots from sinking through my floor

regal bear
#

good luck. I hear more polygons can help - but they cause other probs then 🤷‍♂️

serene magnet
#

ive already had to cut so many polygons just to deal with this shit custom asset rendering system

#

if i have slightly too many polygons in my model it just straight up crashes the game

regal bear
#

yup

#

what is the sinking you are talking about?

serene magnet
#

lemme go check my vod from when we first used it. i think ive mostly fixed it now

#

as you can see the floor has become not floor anymore

regal bear
#

yeah wheels can pop under surfaces and they still detect the back face of the surface. They use raycasts and those raycasts go outward all around the wheel. Also motorbike wheels are really bad for popping under.

serene magnet
#

seems legit

#

i just made the object thicker and it seemed to fix that

serene magnet
#

weird question but can you adjust the strength of a spawned explosion. like the PFB_Explosion_Small

#

because im trying to get the strength of the PFB_Explosion_Large or XL but with the radius of the Small

scenic echo
#

Right now in two of my mods i have the issue of the server crashing after a player joined if a explosion was spawned before the player joined, does anyone know how to fix this?
Removing the explosion completely fixes it but i need it in the mod

#

i tested custom missiles mod too and it has the same problem

scenic echo
#

i made a quick mod that spawns one single explosion when the mod gets activated and then tested it in a server with the mod and the server crashed while someone tried to join
this is the mod i used, am i doing something wrong?

dapper jay
#

i think game sus

regal bear
regal bear
#

Just thinking - maybe you can check for the existence of the explosion object for each player as they join?

serene magnet
#

If anyone wants them I'm gonna be writing out some of my useful functions into a plugin that can be imported into a Lua project

#

Like my quaternion turning function

radiant lion
#

By that you mean rotating a vector by a quaternion?

serene magnet
regal bear
#

Here's a sneak peek at some of new things coming soon to TCP
More info here: #1242291936715608205 message

radiant lion
# serene magnet

this is just me being pedantic, but geometric or quaternion slerp? (just curious)

#

||good job me for forgetting everything in a day, i'm guessing quaternion slerp, else it doesn't make sense mentioning them||

serene magnet
#

Yeah one of the main things is quaternion slerp my function just simplifies the process alot and coroutines it

scenic echo
#

Can you add velocity to a 3d model that has been spawned?

paper bone
#

Yes but only if its a custom object

hollow yew
regal bear
hollow yew
#

i didnt checked new update so maybe this msg is usless.
there is a bug, umm no, i cant call it a bug, it is just a wrong use of my stupid ass XD
when im creating a track for laps, where should i finish it? on the start line? before? after?
normally now, im placing it a lil before the start line.
when i finish a race sometimes i accidently starting new one cuz start and finish are close to each other.
and when it does, the last score i got is replaced with the new one i started by mistake :
any way to avoid it? suggestion for a better finish line spot? maybe a 2sec delay before i can start new race?💜

regal bear
#

That's interesting. When the player finishes they are removed from their vehicle and dropped a little distance past the finish so I guess you're start is right at that point. I always leave quite a gap between the finish and the start (the finish should be before the start) so I've never had this problem. If you have your start a bit further away it should be fine. As mentioned the next update will allow you to reposition both the start and finish if you want to. Is there a reason you want to have the start and finish close together?

crystal igloo
#

how do you make maps for trailmakers?

crystal igloo
cinder spruce
formal crane
scenic echo
#

how can i make a custom object have no collision?

regal bear
#

Note it will still collide with the player and wheels

hollow yew
#

@regal bear Well i do want them as single start/finish line only when doing laps track. But not necessary. Ill try today placing the finish further away from the start. Cant w8 for the pits

scenic echo
#

is there a way to get the position of a custom object?

radiant lion
#

Does the usual GetPosition() not work

scenic echo
#

i just didn't see it in documentation so i asked

radiant lion
#

Understandable

#

Well, try that, should work

scenic echo
#

alright

scenic echo
#

seems like it doesn't work

radiant lion
#

That's... Annoying

#

I knew custom objects were treated slightly different, but that's quite stupid

scenic echo
#

i wanted to make a raycast from the old position of a custom object to the current position to see if it passed through a build or the ground

#

but now idk if that's possible

radiant lion
#

And I'm guessing it has to be a custom objects?

scenic echo
#

yeah

scenic echo
#

yeah it works

radiant lion
#

-_-

shadow iris
#

thats crazy bro a blank screenshot
also noco is back!?!

regal bear
formal crane