Revolution Framework

It’s the quiet time of year now, storms, potential snow, TV re-runs and time to tidy up some code.

Over the next few weeks I’m going to cast my eyes over all of the code in Revolution vs UI enhancer, to try make it easier for other people to re-use what code I’ve added and extend the mod further without creating code-conflicts.

First thing I will do is collect up all the new functions and classes I’ve created and put them into the same lua file rather than having them spread around all over. These will be things like the vehicle history data classes (for calculating map unit speeds etc) as well as other things like my debug functions and the special waypoint storage system.

Second thing I’m thinking about is how to allow things to be more easily extended by other people or by adding more optional mods after, so I’m thinking of adding extension points to the control, hud and holomap scripts along the lines of:

function rev_veh_con__get_is_visible(vehicle)
  -- return true if vehicle is visible by friendly RADAR
end

And others for more graphical control:

function rev_veh_con__draw_unit(vehicle)
  -- called after drawing a unit
end

That would be registered by an extended mod by doing something like..

rev_add_func("veh_con__draw_unit", function(vehicle) 
    -- my function to call after a unit is drawn
  end
)

This is all a bit experimental, but I’m quite keen to give it a try!

By:


Leave a comment