From b6e2aeea71394431889e9b554f190dda4adb0305 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Tue, 17 Jan 2017 21:54:50 +0100 Subject: Add animation for steam engine I needed to completely rewrite the animation because irrlicht couldn't handle the animation NathanS created. --- advtrains/advtrains_train_steam/init.lua | 13 +++++++------ .../models/advtrains_engine_steam.b3d | Bin 298687 -> 437126 bytes .../textures/advtrains_newlocomotive.png | Bin 31800 -> 31915 bytes assets/blender/engine-with-animation_newtry.blend | Bin 0 -> 638904 bytes assets/blender/engine-with-animation_newtry.blend1 | Bin 0 -> 615608 bytes 5 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 assets/blender/engine-with-animation_newtry.blend create mode 100644 assets/blender/engine-with-animation_newtry.blend1 diff --git a/advtrains/advtrains_train_steam/init.lua b/advtrains/advtrains_train_steam/init.lua index 5010902..232ffe1 100644 --- a/advtrains/advtrains_train_steam/init.lua +++ b/advtrains/advtrains_train_steam/init.lua @@ -21,12 +21,13 @@ advtrains.register_wagon("newlocomotive", { visual_size = {x=1, y=1}, wagon_span=1.85, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - --update_animation=function(self, velocity) - --if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then - -- self.object:set_animation({x=1,y=60}, 100)--math.floor(velocity)) - --self.old_anim_velocity=advtrains.abs_ceil(velocity) - --end - --end, + update_animation=function(self, velocity) + if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then + atprint("set_anim",advtrains.abs_ceil(velocity)*15) + self.object:set_animation({x=1,y=80}, advtrains.abs_ceil(velocity)*15, 0, true) + self.old_anim_velocity=advtrains.abs_ceil(velocity) + end + end, custom_on_activate = function(self, staticdata_table, dtime_s) minetest.add_particlespawner({ amount = 10, diff --git a/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d b/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d index 36bdd15..6a92f57 100644 Binary files a/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d and b/advtrains/advtrains_train_steam/models/advtrains_engine_steam.b3d differ diff --git a/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png b/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png index e461bc7..4b27e77 100644 Binary files a/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png and b/advtrains/advtrains_train_steam/textures/advtrains_newlocomotive.png differ diff --git a/assets/blender/engine-with-animation_newtry.blend b/assets/blender/engine-with-animation_newtry.blend new file mode 100644 index 0000000..101dc71 Binary files /dev/null and b/assets/blender/engine-with-animation_newtry.blend differ diff --git a/assets/blender/engine-with-animation_newtry.blend1 b/assets/blender/engine-with-animation_newtry.blend1 new file mode 100644 index 0000000..77d82d4 Binary files /dev/null and b/assets/blender/engine-with-animation_newtry.blend1 differ -- cgit v1.2.3