General Category > Help and troubleshooting

Process finished with exit code 139

(1/2) > >>

conan:
Hi,

I got into a situation when I get this cryptic error:
Process finished with exit code 139
That's it, nothing else, no trace... so I guess it's in the C++ side.

When I try to debug it, I go step by step until the engine pumps and then it exists with that error without any other explanation.

There are two situations that create this error:

* One is when I manually create an object:                 

--- Code: ---object = self.world.model.getObject("dummy", "namespace")
dummyInstance = layer.createInstance(object, newlocation.getExactLayerCoordinates())
--- End code ---
At that point it doesn't complain but the next time it pumps, it crashes. If I just comment the createInstance line it doesn't crash.[/li]


* So I commented that part out and did a huge code change (just refactoring), but after those seemingly neutral changes and after commenting out the previous failing line, it again fails with the same error code.
Help would be appreciated! Thank you!

Niektory:
You need to add the following line after creating the instance:

--- Code: ---fife.InstanceVisual.create(dummyInstance)
--- End code ---

conan:
Thanks for your response. Unfortunately that didn't do the trick :/

I made a workaround to avoid that problem but then later this problem happened again. What I'm trying to do is show a projectile (like a bullet or whatever) that goes from a unit to the target. For that I do:


--- Code: ---def __init__(self, world, origin, destination):

        super(Projectile, self).__init__()

        ## Show projectile
        self.layer = origin.getLayer()
        object = world.model.getObject("projectile", "fallen")
        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.move("stand", destination, 1)


    def onInstanceActionFinished(self, instance, action):

        if action.getId() == "stand":
            self.layer.deleteInstance(self.instance)
--- End code ---

This code crashes with exit error code 139 the next time it pumps. Any ideas?

conan:
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:


--- Code: ---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)



--- End code ---

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!

conan:
I found something! Sorry for the monologue here, hehe!

So, there were two problems: one is the layer where the instance lives. If the layer is the normal "TechdemoMapGroundObjectLayer" where all the other instance live, then as it starts off a blocking cell (since it starts from the position the attacker is), then the movement ends right away. I tested this by starting the shot from the next cell.

Additionally, when I tried the dedicated layer "ProjectileLayer", then the instance doesn't move either. Is there something I should do so that instances can move on a layer? I check Layer.isMovable() and it is.

Finally, is there any way to bypass all layers and just make an instance move from point A to point B in a straight line regardless of blocking cells etc?

Thanks!!!!

Navigation

[0] Message Index

[#] Next page

Go to full version