Apparently I found the problem. It seems that it's not very verbose when it finds some missing part or some part is wrong on the object configuration files such as the .xml . I had to clone an object that I knew it worked for sure and then slowly change the parameters one at a time till it worked like I wanted. However, I get another different error. Now, when I try to move the bullet, it doesn't work. This is my code so far:
def __init__(self, world, origin, destination):
self.start = False
## Show projectile
self.layer = world.scene.map.getLayer("TrajectoryLayer")
object = world.model.getObject("SBT", "fallen")
print "Attacking from: " , origin.getLayerCoordinates()
print "To: ", destination.getLayerCoordinates()
self.instance = self.layer.createInstance(object, origin.getExactLayerCoordinates())
self.visual = fife.InstanceVisual.create(self.instance)
#self.instance.move('stand', route.getEndNode(), 5)
self.instance.move("move", destination, 1)
#print "\n\n\nProjectile action ID: " , self.instance.getCurrentAction().getId()
print "\n\nbullet created!"
self.start = True
def onInstanceActionFinished(self, instance, action):
if action.getId() == "move" and self.start:
print "\n\nDestroying bullet"
The result is that as soon as self.instance.move is run, the onInstanceActionFinished is triggered before even we get out of the __init()__ function! Additionally the bullet sprite appears on top of the unit and doesn't move and it never gets deleted.
I'm doing something wrong but I can't see what. I think it's quite a simple code :/ I'll look more and post the solution if I find it before someone here with a sharp eye does. Thanks!