Jump to content

How to display variable contents during gameplay?


gigantibyte

Recommended Posts

I forgot to think that sv & sqv were console commands :P

 

Would you know why sv GetCrossHairRef does not work in the console? Without the sv, a reference is returned. If I set a reference variable to GetCrossHairRef, then in the console type, sv MyReferenceVar, I get the same error that the function ShawVars requires a reference.

 

{ug}

Link to comment
Share on other sites

SV by itself returns all of the game's global variables, I believe.

You probably need the numeric id for ref, not the text name.

 

SV by itself in the console returns an error that it needs a reference.

 

After testing, I know that my reference variable is not 0000000 or nil. (I got the script to post a message when it != 00000000 and a different message when it was.) So I know something is in the variable, it's just not what I'm expecting it to be. There must be a way to post it's contents.

Link to comment
Share on other sites

SV by itself returns all of the game's global variables, I believe.

You probably need the numeric id for ref, not the text name.

 

SV by itself in the console returns an error that it needs a reference.

 

After testing, I know that my reference variable is not 0000000 or nil. (I got the script to post a message when it != 00000000 and a different message when it was.) So I know something is in the variable, it's just not what I'm expecting it to be. There must be a way to post it's contents.

 

If you click your mouse on the object when in console mode, the refid shows at the top of the screen. Then type SV.

 

Alternatively, if you know the refid, but the object is not in your view, you can type:

PRID refid

SV

Link to comment
Share on other sites

Actually, I think what you really want is the FOSE function PrintToConsole. I often do this for a reference variable:

 

PrintC "MyReferenceVar: <%i> %n" MyReferenceVar MyReferenceVar

 

That will print out the RefID and name (if applicable) of the reference stored in MyReferenceVariable at that moment. See the docs on Format Specifiers for more details. Just put a PrintC line anywhere in your code where you want to check any variable values, or use without any parameters just to output text (to see if and when a segment of code is executed - much simpler than using ShowMessage). If you use the console command TDT beforehand, console output will show on the screen during normal gameplay.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...