This would be a colored block which would shoot custom bullets that use ray cast to detect collision with blocks
https://steamcommunity.com/sharedfiles/filedetails/?id=3427741362
#Explosive minigun mod
1 messages · Page 1 of 1 (latest)
How can you detect if someone presses left mouse button?
you can use the apis input system
found them on the wiki, thanks\
this would be nice
basically old combat mod but optimized
yeah
but i have no idea how to make the bullet move yet
rightt now i'm just making everything around that
ill experiment with this idea later today
there aren't any mouse inputs in the api =/
ouch looks like its only keyboard inputs
That’d be even more like old combat then
Would still work fine
i kind of had an idea for this
reuse old combat mod code, but instead of limiting the amount of explosions per update, limit the amount of explosions per structure
if a structure recently had an explosion on it, don't explode, to prevent feedback loops on explosions damaging other blocks. which would allow you to use larger explosions and therefore more of a "exploding bullet"
30mm go thump thump thump thump
That would reduce crashes but it would still have the same amount of lag because it would still check every block
Might try it on the testing branch of old combat mod
at least for me the bulk of the crashes seemed to come from my complex ass plane blowing up the wrong way that the physics dont like or putting too big of an explosion.
mind this was using the slow update version
Good to know
how do you use raycast?
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
might be benifical to ask in #1140936220487192587
i have something that works but right now it's just hitscan, i'm probably gonna do some more ui things and then try making it shoot actual bullets
there are no bullet prefabs anymore so youll have to make your own bullets
yeah, that will be the most difficult part for me
Right now i've finished everything besides the bullets so it's more of a explosive railgun
i'm having problems with people joining while the mod is on, the server just crashes
Bullets are now a thing
i just have to fix crashing when people join and the bullets still being there after they hit
then a first version of the mod is pretty much done
The mod is on the workshop but it does crash when people join so be sure everybody joins before you enable it
https://steamcommunity.com/sharedfiles/filedetails/?id=3427741362
i updated the mod, now it has configurable bullet speed, fire rate and explosion size. i also fixed the ui flickering
now the square horn secondary color needs to be black for the mod to detect it
the mod does not crash the game anymore
Updated the mod, now the bullets are visible at any range
There is right now a bug that breaks the mod when someone is in build mode and someone shoots
fixed
Do you plan to continue deving of this mod, as they are adding high fire rate explosive weaponry next update? (ik the HEVT effect hinders it from making this mod completely obsolete, due to this one being better for representing stuff like autocannons, but it might)
If there is something cool that i could add to the mod i will definitely update it.
Right now I'm thinking about updating the bullet visuals, idk if i will, but it is an idea i have
K, nice
Btw, could you add smt like a delay so we can stagger the guns?
Might be useful for multigunned structures, like AA turrets etc
I would need to rework how the mod stores information, but it can definitely be done, it just takes time
id recomend making the bullet smaller bc they're kind of an eye sore
but im curious how do we make mods?
https://trailmakers.wiki.gg/wiki/Basic_Modding_Guide check this out, it's the modding page on the wiki
Trailmakers Wiki
You can open the.lua files in any editor you like; however, here is a guide for how to set up Visual Studio Code for getting auto suggestion related to Trailmakers API while coding.
Download, install and open Visual Studio Code
Go to File -> Preferences -> Extensions
Search for lua and install the the...
Updated the mod to have better bullets and also removed the big explosion when they hit
How hard would it be to have custom keybinds?
I am just gonna go ahead and assume it is hard as hardly any mod has it.
when i made the mod i would've had to add like 100 lines of code for all the keybinds so i just decided to add a few
fair