Trace isn't working [SOLVED]


(John Andersson) #1

Hi. I have a function.

			if (map.collideWith(hero, 0, 0))
			{
				trace("Hit");
				remove(hero);

			}

Why does the hero get removed, but the output doesn’t trace anything!?


(Jonathan Stoler) #2

A few possibilities:

  1. Are you sure this code is running? Have you put trace() statements elsewhere that haven’t worked? Some other code could be modifying hero that makes you think it got removed even if it didn’t.
  2. Are you looking in the right place? trace() outputs to the console, not to FlashPunk’s debug overlay.
  3. Are your IDE settings correct? My IDE (IntelliJ, Mac) requires that I build/run the app in debug mode in order for trace() statements to appear. Running in release mode silences trace(). Your tools could be similar.

(John Andersson) #3

Hmm. I’m running flashdevelop. I’ll try to find the faulty part ^^ Thanks


(Jacob Albano) #4

What does “0, 0” represent in your collideWith() call?


(John Andersson) #5

I don’t remember, tbh :stuck_out_tongue: But the trace statement doesn’t work anywhere. I googled some and it’s very confusing, but there’s probably some setting I can change to make it work. Thread can be closed. THank you both :slight_smile:


(azrafe7) #6

Mmmhh… then I guess #3, eh? :smirk:


(Zachary Lewis) #7

Are you compiling the game in debug mode? If you compile it in release, the trace statements won’t appear.


(Stop dreaming, Start living.) #8

http://oi62.tinypic.com/34rhldl.jpg

Hope it helped you.


(John Andersson) #9

Jycerian, it didn’t work! I guess I’m not compiling the game in debug as zach said. How do I compile it in debug mode? I googled but couldn’t find the answer


(Willard Torres) #10

In FlashDevelop, it’s in a drop-down near the top.


(John Andersson) #11

Thanks!!!

Awesome :slight_smile: Thank you all for helping. You’re the best!