mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-03-21 15:21:24 +00:00
Support for multiple meshes
This commit is contained in:
parent
a043bb4f94
commit
eaa8f8432b
1 changed files with 12 additions and 0 deletions
12
mob_meta.lua
12
mob_meta.lua
|
@ -763,6 +763,17 @@ function mob:activate(staticdata, dtime)
|
||||||
if textures then self.textures = textures end
|
if textures then self.textures = textures end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.meshes then
|
||||||
|
local mesh_no = self.mesh_no or random(#self.meshes)
|
||||||
|
if self.mesh_textures then
|
||||||
|
self.textures = self.mesh_textures[mesh_no]
|
||||||
|
end
|
||||||
|
self.mesh_no = mesh_no
|
||||||
|
self.object:set_properties({
|
||||||
|
mesh = self.meshes[mesh_no]
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
if not self.perm_data then
|
if not self.perm_data then
|
||||||
if self.memory then
|
if self.memory then
|
||||||
self.perm_data = self.memory
|
self.perm_data = self.memory
|
||||||
|
@ -1237,6 +1248,7 @@ function creatura.register_mob(name, def)
|
||||||
def.physical = def.physical or true
|
def.physical = def.physical or true
|
||||||
def.collide_with_objects = def.collide_with_objects or false
|
def.collide_with_objects = def.collide_with_objects or false
|
||||||
def.visual = "mesh"
|
def.visual = "mesh"
|
||||||
|
def.mesh = def.mesh or (def.meshes and def.meshes[1])
|
||||||
def.makes_footstep_sound = def.makes_footstep_sound or false
|
def.makes_footstep_sound = def.makes_footstep_sound or false
|
||||||
if def.static_save ~= false then
|
if def.static_save ~= false then
|
||||||
def.static_save = true
|
def.static_save = true
|
||||||
|
|
Loading…
Add table
Reference in a new issue