Hi. I’m integrating a “weapon system” from the marketplace into my project. I’ve noticed that the character spawns with one weapon already equipped, and I’m trying to find from where it comes. Using “Find in Blueprints”, I can see all the places where code can add a weapon to the character.
But what I want to know is:
Which code location actually calls the event when the character is spawned?
In other word, I want to find out the caller of a specific call that happens at runtime.
In Java, I would solve this with a “dump stack” call (or a “breakpoint”, but I’m more of a “print to console” debugger).
I could add PrintString to every caller location, and check the last one to be printed, but it’s quite time-consuming and doesn’t “scale” if there are many caller locations. Is there a better way to do this?
Preferably, I’d like a solution that is not only limited to “character spawning”, as this is really a general Blueprint debugging problem.
Hi, @Nawrot! My problem has nothing to do with AI, but the link is still interesting. By “at runtime”, I do mean, “run the game in the editor”. I’ll rephrase using another example.
Say my character has a “take damage” event. Now, there can be 100 things that can trigger that event. What if I am testing my character in my level, and suddenly it takes damage, but there are (AFAIK) no reason for that to happen at that moment. So, I’d like to know, “which location in the code” triggered the “damage event” (because it probably needs fixing). How do I find that out (without adding a “print string” to every location that fires “damage event”)?