gigantibyte Posted August 18, 2010 Share Posted August 18, 2010 A line in my script is not working and I would like to display a reference variable's contents to see why. I added ShowMessage MyReferenceVar, but of course that didn't work. Is there a proper way to do it (with or without FOSE)? Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted August 18, 2010 Share Posted August 18, 2010 if it's on a reference, you want sv refid if it's a quest, you want sqv questid Link to comment Share on other sites More sharing options...
gigantibyte Posted August 18, 2010 Author Share Posted August 18, 2010 if it's on a reference, you want sv refid if it's a quest, you want sqv questid Thank you. Is there a good page with a guide to functions like sv and sqv? Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted August 18, 2010 Share Posted August 18, 2010 http://geck.bethsoft.com documents all of the commands. Link to comment Share on other sites More sharing options...
gigantibyte Posted August 18, 2010 Author Share Posted August 18, 2010 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 More sharing options...
Quetzlsacatanango Posted August 18, 2010 Share Posted August 18, 2010 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. Link to comment Share on other sites More sharing options...
gigantibyte Posted August 19, 2010 Author Share Posted August 19, 2010 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 More sharing options...
rickerhk Posted August 19, 2010 Share Posted August 19, 2010 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 refidSV Link to comment Share on other sites More sharing options...
HugePinball Posted August 19, 2010 Share Posted August 19, 2010 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 More sharing options...
gigantibyte Posted August 19, 2010 Author Share Posted August 19, 2010 Thanks for all your help. I was able to trace the problem I was having and fix it. :) Link to comment Share on other sites More sharing options...
Recommended Posts