Aircraft Realism

by haih_ys

Adds mechanics to make vehicles behave as planes. [Takeoff/Landing, Runway Requirement]

Content
3 months ago
0.17 - 1.1
52.2K
Transportation

i ✔️ Multi file shadows

1 year, 8 months ago

Hi there,

as of right now the aircraftMaker.lua makes car prototypes airborne with the makeAirborne(config) function. In the last months you added a new feature of animated shadows. My planes all still work fine with the old system, but if I wanted to upgrade them to use your new feature, I have a big problem. The initialising of the shadow of the plane only accepts one single shadow file. And also only one layer. However all of my planes have multiple files (due to higher direction_count) and some have more than one shadow layer (due to animated rotors). Thus I can't use your function.
Do you see any possibility to change it in a way that allows multi layer and multi file support?

Cheers, Jo.

1 year, 8 months ago
(updated 1 year, 8 months ago)

Hello!

Splitting the shadow across multiple files should be possible, however it might be a while before I have the time to implement it - my apologies.

In the meantime, if you wish, you can modify my mod to implement separate sprites for shadows. The idea is to modify makeAirborne() to generate a new sprite for each direction, then modify updatePlaneShadow to load the appropriate sprite for the direction. It might actually be easier for you to implement it as you can adapt it to the specifics of how you store your shadows.

1 year, 8 months ago
(updated 1 year, 8 months ago)

I've done some work and altered your function to my needs. I think I'll just implement it in my own mods because, like you said, then I can adapt it to my specifics. I think I really just changed line 116-180 and 205-239 in aircraftMaker.lua.
So I'll keep everything as it is but add my function of adding the shadow sprites. Furthermore I'll call the setupRuntimeInfo() function in your file to register my data.

-> You don't need to do anything. I'll call again when I have an issue ^^

PS: in aircraftMaker.lua in line 168, 171, 174, 177 you didn't edit the error message. It's always says the same. Maybe you should fix that.

6 months ago
(updated 6 months ago)

There is API support for adding your own shadows in 1.5.7.
The way you have done it still works, but you should not need any code copied from aircraftMaker.lua anymore, just tell makeAirborne how many directions you have.

local gunship = aircraftMaker.makeAirborne({
    name="cool-plane",
    shadow={
        directionCount = 36,
        endSpeed = 60 / 216
    }
})

New response