Would it be possible for you to expose those functions of yours publicly, or maybe add an entity property that's a wrapper around those functions? (Is that even possible?), like airplaneAnimationSource
that gets called during the final step to then set the animation via that function - such that there's less duplicated code.
I'm specifically referring to airplaneAnimation()
, resist
, and addcommonaimlines
.
As it stands I've just copy-pasted these methods into my own file
Hi, I think there's much simpler, these functions are just there to simplify redundant code, but they just add properties into the array. Once the array is complete, at the end of the code it just adds everything to data.raw, so you can access it as-is. For example:
local bettercargo = table.deepcopy(data.raw["car"]["cargo-plane"])
--it copies the entirety of the plane into the array
--then you can simply change the parameters you want different
bettercargo.name = "bettercargo"
bettercargo.braking_power = "650kW"
bettercargo.friction = 0.060
bettercargo.animation.layers[1].tint = {0.5,0.5,0.5,1}
bettercargo.resistances[1].decrease = 6
--and add that to data, as a modified copy called bettercargo
data:extend({ bettercargo })