Aller au contenu

Photo

PrintToLog doing nothing - confused


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
GameVoid

GameVoid
  • Members
  • 10 messages
I have created the ECLog.ini file in the appropriate place, but PrintToLog doesn't do anything. I don't get any errors or anything weird, and the module is apparently exporting properly, but PrintToLog is either not logging period, or the messages are going someplace off into the ether instead of into the DragonAge_1 file or whatever it is called. I can see all sorts of standard engine logging going in there, just not my stuff.

I tried two different versions of the ECLog.ini, the one in the wiki and the short but sweet one in the logging post on this forum, but neither helped anything.

If anyone has any suggestions on what to look at that might not have been mentioned in the wiki, it would be appreciated.

#2
sillyrobot

sillyrobot
  • Members
  • 171 messages
Well, I have it working correctly, so let's verify a few things.

1) What directory is the ECLog.ini in? It should be the bin_ship subdirectory in the game install area.

2) Do you have "Script = 1"under the "[LogTypes]" section?

3) Can you confirm your code is being reached? If you place a DisplayFloatyMessage() at the point where you PrintToLog() does it display?

Modifié par sillyrobot, 17 décembre 2009 - 08:02 .


#3
kilrex

kilrex
  • Members
  • 69 messages
to GameVoid:
if you aren't seeing anything in the logs, do you gave anyway to verify that your code is really getting executed?
Can you put something in to the script that can never occur except if it goes through the block of code with the log statements?
One of the first things I always check when I don't see logging that should be there is to try to verify that my code is really being run by some other means. If the compiled script wasn't put in the right location or maybe the particular script isn't being invoked, then you definitely won't see any log messages.

Another option is tell us what your code is supposed to do, and include your code and and whatever else you're doing to install it.


to sillyrobot:
1) yes, it's in the game install dir, in bin_ship ... $GAMEDIR/bin_ship/ECLog.ini
It's the same directory as the game executable is located.

2) yes. basically you just need 2 lines total in the ini file

[LogTypes]
Script=1
....
(you know what? I never actually tested whether or not that this was true.
I did just now though, and an ini file with just those 2 lines worked for me. )


3) not always. depending on when the code gets called.
basically, if the method gets called when the target object of the msg() function isn't loaded into the area yet, you won't be able to see the floaty message. So you cannot always use it.

For example, everyone was/is? creating addins that add items to the inventory when the module loads. When that function is called that adds the items, you're character hasn't been loaded into the game so you cannot see any floaty messages.
But if you're writting code to implement spells, abilities, or anything that only occurs when you're character exists, then you can see the message.

Modifié par kilrex, 20 décembre 2009 - 01:47 .


#4
sillyrobot

sillyrobot
  • Members
  • 171 messages
Yes, I know. As I said in my post, I have it working.



I was trying to draw out more details from GameVoid. His initial message was a bit too general to offer a diagnosis. 'Appropriate place' and 'different versions' leave a large possible error space.

#5
GameVoid

GameVoid
  • Members
  • 10 messages
Okay, sorry for the generalizations:

1 - Here is my ECLog.ini file contents at the moment:

[LogTypes]
Script = 1

The file is located in the Dragon Age\\Bin_Ship directory (along with Daupdater.exe and its kin).

2 - I am pretty sure that the code is getting reached cause I took out the chargen statements that immediately follow the log statement, started my module and was not prompted to generate a character, I just got Jaden. Then I went and put the chargen code back in, exported, started my module and was asked to generate a character. So I know that the module_workshop script is getting hit and executed.

Here is the entirety of the script at the moment:

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"

void main()
{
    event ev = GetCurrentEvent();
    int nEvent = GetEventType(ev);
    int nEventHandled = 0;

    PrintToLog("Handling event type " + IntToString(nEvent));

    switch (nEvent)
    {
        case EVENT_TYPE_MODULE_START:
        {
            PreloadCharGen();
            StartCharGen(GetHero());
            nEventHandled = 1;
        }

        default:
        {
            if (!nEventHandled)
            {
                HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
            }
        }
    }
}

3 - On a hunch, I opened up the ECLog.ini file and saved it out again, making sure that it was saved in true ASCII format and that didn't help anything.

I appreciate any help that people can give. If I figure it out I will update this thread.

#6
sillyrobot

sillyrobot
  • Members
  • 171 messages
That looks fine. I used something very similar for module debugging a while ago. So grasping at straws here, delete the log file and see what is created when you next start the module.

#7
Dheuster

Dheuster
  • Members
  • 9 messages
Goto the bin_ship Folder



Within Explorer Window:



Tools -> Folder Options -> View -> Uncheck Hide Extensions for known file types.



If ECLog.ini ends with ".txt", the game will not load it and your logging wont work.



I loaded up a new machine today and had the same problem. This was the issue.

#8
Bibdy

Bibdy
  • Members
  • 1 455 messages

Dheuster wrote...

Goto the bin_ship Folder

Within Explorer Window:

Tools -> Folder Options -> View -> Uncheck Hide Extensions for known file types.

If ECLog.ini ends with ".txt", the game will not load it and your logging wont work.

I loaded up a new machine today and had the same problem. This was the issue.


GASDHKALGBKHAL:SKDJ

****ing Windows 7...