LUNOS has been moving towards a more component based organization structure. This has massive advantages for code reuse and simplicity, but may take a bit getting used to. Let’s take a look at an example.
GridNodeComponent
Grid nodes can appear as a part (or component) of a wide variety of actors. Currently, there is the BP_StaticGridNode, as well as the node that appears on top of the pillars themselves. Child actors are nonsense garbage, so components are the next best thing.
We want the grid node component to encapsulate everything to the point that all we have to do is add the component to ANY actor and it will work as expected, visuals and all. We have to forgo a few nicities that actors provide and think a lil outside the box, but we can do it.
NOTE: I should really figure out how to incorporate those nifty online BP things.
bOccupied, sends that value to CPD via UpdateAnimation, then does a simple check to see if the value capped out. If true, it turns it’s tick off, stopping the entire update function and saving cycles.
Remember to set
StartWithTickEnabledto false! You can also set a differnt update rate than the owner, which can also be very useful.
Unfortunately, timelines are unavailable in components as timelines themselves are components! This enforces a bit of optimization, but ultimately is worth it. You can still read curves as you can bring them in with a curve asset.