Announcement

Collapse
No announcement yet.

Pawns mysteriously being destroyed. Why? Can I log why they were destroyed?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pawns mysteriously being destroyed. Why? Can I log why they were destroyed?

    I have a very strange problem going on. I'm testing out my game by adding a bunch of characters to the party all at once:

    Here they are, listed in the pause menu:
    Click image for larger version

Name:	PawnBug01.jpg
Views:	1
Size:	100.4 KB
ID:	3254099
    Hi-res

    And here they are in the "organize your characters into squads" level:
    Click image for larger version

Name:	PawnBug02.jpg
Views:	1
Size:	85.8 KB
ID:	3254100
    Hi-res

    That works just fine. To get them into the Squads level, I store their previous rotations and locations, then stream in the level, then teleport the pawns. When I return to the main menu, I teleport the pawns back to their previous locations and unload the Squads level. The game then goes on just fine for a while, but eventually if I open the Squads menu/level again, then something totally game-breaking happens:

    The pawns go to the Squads level, where they sit for a few seconds, then they mysteriously get destroyed:
    Click image for larger version

Name:	PawnBug03.jpg
Views:	1
Size:	77.9 KB
ID:	3254101
    Hi-res

    I have a line in the Destroyed() event that logs who got destroyed and where. What I'd like to do is stop the pawns from getting destroyed at all. To do that, I should probably find out why they're getting destroyed. How would I find that out?

    #2
    Well, one of the reasons wich happend to me, is that if you are using health variable of Pawn::Health, the already declared one and it'sm 0 or below 0, it happends to be that it gets destroyed...
    So solution use your own, Byte health.

    If it is not that who knows.... mmh you can do a shortcut to game, and put in the command -log to see your log.... perhaps log will answer your doubt.

    Comment


      #3
      Yes! Thanks so much Neongho! I wrote a little function to show me the health of all of the characters, and some of them had suddenly dropped to -135 health. Maybe it had to do with other pawns getting teleported on top of them? I'm implementing my own damage system, so I just overwrote TakeDamage() so that it doesn't do anything, and that fixed the problem. I don't think I've ever seen a problem solved so quickly on this forum. Thanks again!

      Comment


        #4
        Glad it helped other sudden destroy reasons, i don't know them, Killz but there's no more...

        Comment


          #5
          pawns losing health might be related to the KillZ of the level, make sure it's not affecting them

          Comment

          Working...
          X