Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Logging

Logging

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Alyce   (43 posts)  Bio
Date Fri 26 Aug 2016 04:54 AM (UTC)
Message
I know that certain commands show an online log when used..

example:

vassign returns

Log:vassign



I added a mpmset program to allow mobs to set questpoints via mobprog and I want that logged specifically so I can see it as it occurs in game.

as a work-around I am using progbug to display it.. but I would rather it show up as BUILD: or LOG:

here is what i got going on...

if( !str_cmp( arg2, "train" ))
{
if( value > 0 )
{
progbug( "giving training points via prog", ch);
victim->pcdata->quest_curr += value;
return;
}
}

in a perfect world I would like to be in game and have it say:

LOG: Giving training points via prog, Mob #1200.

instead of the current

Log: [*****] BUG: giving training points via prog, Mob #1200.


any ideas?
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #1 on Fri 26 Aug 2016 02:20 PM (UTC)

Amended on Fri 26 Aug 2016 02:22 PM (UTC) by Fiendish

Message
Please put [code]..[/code] tags around chunks of code in the forum.

Poking through the SMAUG code at https://github.com/nickgammon/smaugfuss/blob/master/src/db.c ...

Maybe try using something like this?

log_printf_plus( LOG_BUILD, LEVEL_LOG,  "giving training points via prog, Mob #%d.", ch->pIndexData ? ch->pIndexData->vnum : 0);


Note, I see the progbug function does a check for supermob status which I'm clearly not doing here.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Alyce   (43 posts)  Bio
Date Reply #2 on Sun 28 Aug 2016 08:50 AM (UTC)
Message
Thank you for the speedy response! Sorry about the code tags. I got it working like I want to :)
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,584 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.