Hi!
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:
class Projectile(fife.InstanceActionListener):
def __init__(self, world, origin, destination):
super(Projectile, self).__init__()
self.start = False
## Show projectile
self.layer = world.scene.map.getLayer("TrajectoryLayer")
object = world.model.getObject("SBT", "fallen")
object.addWalkableArea("land")
object.setBlocking(False)
print "Attacking from: " , origin.getLayerCoordinates()
print "To: ", destination.getLayerCoordinates()
self.instance = self.layer.createInstance(object, origin.getExactLayerCoordinates())
self.instance.addActionListener(self)
self.visual = fife.InstanceVisual.create(self.instance)
self.visual.setVisible(True)
self.instance.setCellStackPosition(0)
#self.instance.move('stand', route.getEndNode(), 5)
destination.setLayer(self.layer)
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):
print action.getId()
if action.getId() == "move" and self.start:
print "\n\nDestroying bullet"
self.layer.deleteInstance(self.instance)
self.visual.setVisible(False)
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!