]> git.lizzy.rs Git - Crafter.git/commitdiff
Fix spider to work properly :D
authoroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 20 May 2020 17:24:54 +0000 (13:24 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 20 May 2020 17:24:54 +0000 (13:24 -0400)
mods/mob/api/api_hook.lua
mods/mob/api/head_code.lua
mods/mob/init.lua
mods/mob/models/spider.b3d

index 453ad1e646f69474392f335201266ad0ba02a775..8f945b859388f047db4e22cb48fc9a3c9d269ac1 100644 (file)
@@ -74,6 +74,7 @@ mob_register.group_attack = def.group_attack
 mob_register.death_rotation = def.death_rotation
 
 mob_register.head_mount = def.head_mount
+mob_register.rotational_correction = def.rotational_correction or 0
 
 mob_register.hurt_sound = def.hurt_sound
 mob_register.die_sound = def.die_sound
index f9bed64e0b196fdb46cf322d4330d9bd7ff8b3ff..a06936dc7f01f2f9c826ccce827976dbae5828bc 100644 (file)
@@ -62,7 +62,7 @@ mobs.create_head_functions = function(def,mob_register)
                                --print(self.head_rotation.y)
                                --if passed a direction to look
                                local pos = self.object:get_pos()
-                               local body_yaw = self.object:get_yaw()-math.pi/2
+                               local body_yaw = self.object:get_yaw()-math.pi/2+self.rotational_correction
                                                                
                                local dir = vector.multiply(minetest.yaw_to_dir(body_yaw),self.head_directional_offset)
                                
index 0c51b0dff299c9994f7f7205efe2f123906e638f..35eebc7de6b510f86e767ff26c10ca47d674ddf3 100644 (file)
@@ -573,19 +573,20 @@ mobs.register_mob(
 
 
         -----
-        --head_bone = "body.head",
+        head_bone = "body.head",
         debug_head_pos = false,
-        head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
-        head_height_offset = 0.8, --added to the base y position
+        rotational_correction = -math.pi/2,
+        head_directional_offset = 0.3, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
+        head_height_offset = 0.63, --added to the base y position
         --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
-        head_position_correction = vector.new(0,3,-0.5),
+        head_position_correction = vector.new(0,1.24,0),
         --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
         head_coord = "horizontal",
         -----
         
         is_visible = true,
         pointable = true,
-        automatic_face_movement_dir = 0,
+        automatic_face_movement_dir = 90,
         automatic_face_movement_max_rotation_per_sec = 300,
         makes_footstep_sound = false,
         hp = 10,
index b5ef5964bc6924e89321c3e7e89eeec2dd9565f8..ac753b4a147907ea7e6914ffdcb2f1d616fa1975 100644 (file)
Binary files a/mods/mob/models/spider.b3d and b/mods/mob/models/spider.b3d differ