Please help a n00b.
I'm trying to add an entity per the Modding Guide. It's an entity called "Bob" with a simple "bobbing" idle animation. The animation uses a single bone called "head" that is associated with a picture of Naija's head, which I pulled from a working mod.
When I go to add the entity in the editor, I can see a preview in the entity menu that looks like Naija's head; so far so good. But when I paste it, all I get is a minuscule little white dot that doesn't looks like Naija no matter how far I zoom in. Does anybody know why this would happen? I'd appreciate any insight you can give me; I've been experimenting and searching the forums for two days.
Here's my code. My graphics directory contains a directory called "bob" and within that there is a file called "head.png".
bob.lua:
dofile("scripts/entities/entityinclude.lua")
function init(me)
setupBasicEntity(
me,
"", -- texture
4, -- health
2, -- manaballamount
2, -- exp
1, -- money
48, -- collideRadius
STATE_IDLE, --initState
90, -- sprite width
90, -- sprite height
1, -- particle "explosion" type (see particleEffects.txt)
1, -- 0/1 hit other entities off/on
4000, -- updateCull -1: disabled, default: 4000
)
entity_setEntityType(me, ET_ENEMY)
entity_initSkeletal(me, "bob")
entity_setState(me, STATE_IDLE)
--entity_animate(me, "idle", LOOP_INF)
end
-- after nodes have inited
function postInit(me)
end
function update(me, dt)
entity_updateMovement(me, dt)
end
function enterState(me)
--if entity_isState(me, STATE_IDLE) then
-- entity_animate(me, "idle", -1)
--end
end
function exitState(me)
end
function damage(me, attacker, bone, damageType, dmg)
--return false
end
function animationKey(me, key)
end
function hitSurface(me)
end
function songNote(me, note)
end
function songNoteDone(me, note)
end
function song(me, song)
end
function activate(me)
end
bob.xml:
<AnimationLayers>
<AnimationLayer />
</AnimationLayers>
<Bones>
<Bone idx="0" gfx="bob/head" pidx="-1" name="head" fh="0" fv="0" gc="0" cr="0" cp="0 0" />
</Bones>
<Animations>
<Animation name="idle">
<Key e="0 0 1 -13 -360 0 0 0 0 0 0 0 0 0 0 0 " />
<Key e="0.6 0 0 -35 -358 0 0 0 0 0 0 0 0 0 0 0 " />
<Key e="1.2 0 1 -13 -360 0 0 0 0 0 0 0 0 0 0 0 " />
</Animation>
</Animations>
entitygroups.txt:
GROUP:Creatures
crotoid
moneye
nautilus
bob bob/head
GROUP:Plants
healthPlant