I've been working on a library of two Lua classes which will allow solid ledges and fully 3D moving platforms.
The first is called Ledges, which can either be decorative (basically the same as placing a 3D model in a map), or solid (meaning you can walk on it as if it were a solid polygon).
The second is called Movers, and is basically a Ledge that can move along a path. It can be activated by a switch, or it can be initially active. Like a Ledges object, it can be either decorative or allow the player to walk on it.
Although I'm developing this for my own scenario, I'm making sure that the library is easy for others to implement. It's used something like this:
Code: Select all
function Triggers.init(restoring_game)
-- Create Ledges and Movers objects here
demo_mover = Movers.new(constructor_arguments_go_here)
end
function Triggers.idle()
-- The below is pretty standard, just cut & paste into your own script
for player in Players() do
for ledge in GetLedges() do
ledge.perform(player)
end
for mover in GetMovers() do
mover.perform(player)
end
end
https://www.dropbox.com/s/ssynz04orasen ... _mover.mp4
So, as you can see from the video, there are a few questions I'm trying to resolve:
a) It seems the centre of the 3D model has to be in front of the player for it to render. If I'm on top of a moving platform (as in the video) and turn around, the platform vanishes from underneath me. Any workaround for this? (one idea I'm considering is having the platform composed of several separate models fitted together like a jigsaw)
b) How do I cancel the player's forward momentum? Once standing on the platform, my script is moving the player's location to match the platform, but this isn't ideal (there's no way to step off!). It seems that unless the player is standing directly on a polygon, the engine considers them to be falling, and so they have this frictionless forward momentum.
c) When replacing scenery with 3D objects, you lose the original scenery object you're replacing. Any way to have the 3D objects in addition to all the scenery, otherwise levels with lots of models will look sparse.
d) Any tutorials on making exported Blender obj files work with Aleph One? Every attempt I've made to use an exported 3D object of my own crashes Aleph One, so I have to assume I'm doing something wrong in Blender before exporting.
Thanks!