Logging and Acessing Protected Values

Started by Jaxxa, August 03, 2014, 10:58:43 PM

Previous topic - Next topic

Jaxxa

Hi
I have a few questions that I am hoping you can help me with.

What would be the best way to send custom logging messages to the console or to a file?
It is slightly annoying to figure out what has gone wrong.


Is there any way to access protected values?

Specifically I am looking at some of the Projectile values like origin,destination, launcher, assignedTarget, ticksToImpact

Is there some getter that I am unaware of?
Or is my only option to crate a new class that inherits from Projectile, add a public getter to it and make all the projectiles shot this new type of projectile, but that would break comparability and I don't really want to do that.

If I cant access them Tynan I would really appreciate if you could add a public getter in the next version :)

RawCode

with a bit of magic you can IO process memory directly, including any fields of any objects no matter what flags are set.
you can google solution with unsafe c# and marshal as keywords.

some fields cannot be changed this way because they INLINED at compile time and changing field wont change codeflow, you should double check implementation before trying to hack it.

Jaxxa

Thanks for the general advice.

I found that there is a Static logging class that can send messages to the inbuilt console.

Log.Warning("Warn test");
Log.Error("Error test");
Log.Message("Message Test");

RawCode

i can't agree with this "great discovery" since this is default feature and pretty obvious for anyone.