ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 2347

Simple Logging to a File from your menu

by quadrant2005 - 04-13-2020 - 12:03 PM
#11
you never asked for help tho
(05-01-2020 - 02:09 AM)quadrant2005 Wrote:
(04-27-2020 - 09:38 PM)magiccarpet Wrote:
(04-15-2020 - 06:18 PM)quadrant2005 Wrote:
(04-14-2020 - 11:06 PM)Venom_Modz Wrote: this is from united x source lol
I originally wrote this code back in 1997 for use with my Quake2 Mods that i was coding.. If it was taken from another GTA V im sure i would have it working by now on the xbox360 im very new to the Xbox360 side of coding and just wanted to share some code that i wrote long ago for the pc that ive tried to adapt for the xbox360, But ive no idea of what path to use on the xbox360 any help would be apprecaited, I worked on many many quake2 mods over the years and also wrote a full 2d 3d gaming engine for the pc platform regards quadrant2005
Your a idiot.

360 was not even around in the 90s, and you didnt make this.

Also ur story dose not make any sence,

"Why are people so nasty here when all ive done is ask for help, I did not say that the Xbox360 existed in the 90s im a computer programmer. I do not normally work with the Xbox i normally write code for the Pc, i either originally wrote the code back in 1997 or learned it from C booklets of the time. I worked on many Quake2 gamex86 mods for quake2 on the pc, Quadkill,Kots,Vortex, Rvr etc.. All i have done is post the code and ask for help on the correct pathing to get it to work on the xbox360, The reason i do not have it working is because i do not have the source code to the menu you mentioned. The code i posted also is not to read a file but to write to it.  You do not know me and you do not know anything about me.."

(04-27-2020 - 06:45 AM)Venom_Modz Wrote: but yet you wrote the code lol
The code was written for the PC long ago, the code works fine on the pc with no issues at all, For the xbox360 i know very little about them and there drive structure. All i did was ask for help and get faced here with criticisum... What a community you all having going here... you all must be so proud..

best advice is to learn how the file system works for console :)
Reply
#12
Does this work ????
Reply
#13
Why are you wanting to do logs ?
Reply
#14
I have this working now on the Xbox360 console, i thought it might be something to do with protection. Its hard to get into coding for the xbox because no one seems to want to offer any help even for simpliest of things.

The code i posted works you just need to add to it before you want to start writting anything to a file you need to InitializeCriticalSection(&LockState); say at the top of your function then before you try to fopen to write do the following EnterCriticalSection(&LockState); then after you have finished with the file and closed it LeaveCriticalSection(&LockState); help would have been apprecaited, but i got there in the end without any... next to do the same with sending and receiving packets... These two things will allow me to put together the system i wanted too...
Reply
#15
(05-02-2020 - 12:18 AM)Justtestingit Wrote: Why are you wanting to do logs ?
Hi there, i posted the logging as an example, But its nice to be able to have a DEBUG flag in the code and to by switching it be able to enable all kinds of logging, file and line of code, log key points in the code being reached etc, Logging can be very useful for so many things.. I do not find XBWatson that useful to be honest so logging is another work around, ive been told about something else is it RGLoader or something like that ?? which then allows you to use a much better Debugger but ive not yet looked into that yet. The Xbox Dev side is very new to me, its a shame the community is not more friendly as it would have been nice to work together with some peeps and to also not have to reinvent the wheel, owe well..  never mind just means it takes longer thats all..
Reply
#16
(05-08-2020 - 09:13 AM)quadrant2005 Wrote:
(05-02-2020 - 12:18 AM)Justtestingit Wrote: Why are you wanting to do logs ?
Hi there, i posted the logging as an example, But its nice to be able to have a DEBUG flag in the code and to by switching it be able to enable all kinds of logging, file and line of code, log key points in the code being reached etc, Logging can be very useful for so many things.. I do not find XBWatson that useful to be honest so logging is another work around, ive been told about something else is it RGLoader or something like that ?? which then allows you to use a much better Debugger but ive not yet looked into that yet. The Xbox Dev side is very new to me, its a shame the community is not more friendly as it would have been nice to work together with some peeps and to also not have to reinvent the wheel, owe well..  never mind just means it takes longer thats all..
Oh glad you got it sorted! Yes XbWaston is limited to what you can do on a RGH but better with RGLoader/XDK as they have more debugging functionality along with the sidecar.
Yeah i noticed a long long time ago in the xbox modding community people seem to either leech code and make shit mods or those who can code keep most things to themselfs its sad in a way but it just the way it is takes longer yes but you get that sense of accomplishment :)

Also sometimes trying reinvent the wheel makes you think of a way to replace the wheel with a new and unique invention :P
Reply
#17
(06-27-2020 - 12:24 AM)Justtestingit Wrote:
(05-08-2020 - 09:13 AM)quadrant2005 Wrote:
(05-02-2020 - 12:18 AM)Justtestingit Wrote: Why are you wanting to do logs ?
Hi there, i posted the logging as an example, But its nice to be able to have a DEBUG flag in the code and to by switching it be able to enable all kinds of logging, file and line of code, log key points in the code being reached etc, Logging can be very useful for so many things.. I do not find XBWatson that useful to be honest so logging is another work around, ive been told about something else is it RGLoader or something like that ?? which then allows you to use a much better Debugger but ive not yet looked into that yet. The Xbox Dev side is very new to me, its a shame the community is not more friendly as it would have been nice to work together with some peeps and to also not have to reinvent the wheel, owe well..  never mind just means it takes longer thats all..
Oh glad you got it sorted! Yes XbWaston is limited to what you can do on a RGH but better with RGLoader/XDK as they have more debugging functionality along with the sidecar.
Yeah i noticed a long long time ago in the xbox modding community people seem to either leech code and make shit mods or those who can code keep most things to themselfs its sad in a way but it just the way it is takes longer yes but you get that sense of accomplishment :)

Also sometimes trying reinvent the wheel makes you think of a way to replace the wheel with a new and unique invention :P

Hehehe yes for sure, i apprecaited your response. Ive heard about RGLoader but have no experience of it, Ive picked up a XDK jasper with sidecar a few weeks ago. It was interesting to look at. With it being a Jasper im wondering what differences where made to the mainboard circuit as my RGH that i currently use is also a Jasper, I had wondered about seing if its possible to mount my sidecar to the RGH jasper console. Ive tried looking online to see if this is something that has been done in the past but was unable to find anything. The XDK is really clean so im hesitant to open it up, but if i did i would be sure to take lots of reference photos incase of anyone else concidering the same idea in the future. Something ive been working on with GTA V is to be in multiplayer mode drop the connection with the take two interactive server, so that it comes up bottom left can not save etc. ive then being connecting the xbox gta v client to a little server ive wrote, which looks at the xboxlive username and loads up a file then sets the clients stats to those saved in the file, so the code that someone posted a while back for fake stats came in very useful, ive then created a little pc client app with no real front end so that they connect to the little server app i wrote, it then loads up stats from a file of the said player name locally on my server and creates a ped, all connected client ped posiitons get transmited to all connected clients, ive also tested this with a xbox that has no xboxlive gold account just created a random player name this was also able to interact with the other console, i know this sounds very basic. But if i can continue to make progress it could be come something really interesting, think of the Pc FiveM gtav server system something abit like that but for the xbox 360. This is why i was trying to find out info about saving my online freemode ped, I need to learn to turn of the vehicle and npc ped spawners on the client side as they do not get propogated across clients are only seen by the relevent client, I need to implement this at my server side. Im not using the games original networking code at all at this time. The above idea also works with the GTA V in offline mode, the peds of the other clients can be seen to move in each client instance. Regards Richard quadrant2005
Reply
#18
quadrant2005, do you got a discord man i need to see if your able to assist me with something coding related
Reply
#19
(04-13-2020 - 12:03 PM)quadrant2005 Wrote: hi there this is my first ever time posting here, so ive a lot to learn. I wanted to share some code for logging. This is code that ive used in the past to log from some of my Pc applications that
ive written over the years and Quake2 mods that i worked on. I added it to my XBOX360 menu it builds fine but for some reason i do not get any file written to the drive. Im new to Xbox360
Dev. But wanted to share my code anyone incase it would be helpful to someone. cheers regards Richard quadrant2005
Code:
#include <time.h>

static const char * f_szLogFile = "HDD:\\quadkill.log";

void Log_Printf(const char * format,...)
{
time_t now;
char timestring[64];
va_list marker;
FILE * fp = 0;

va_start(marker, format);
fp = fopen(f_szLogFile , "a+");

if (!fp)
return;
time(&now);
fprintf(fp, timestring);
vfprintf(fp, format, marker);
fclose(fp);
}

owe i see you use the code thingy to imbedd the code into the forum post :) at least i got that bit right, 
Code:
; to use the above code here are examples of calling it 
Log_PrintQ ("Name %s : Max Armour %s\n",PLAYER::GET_PLAYER_NAME(i),PLAYER::GET_PLAYER_MAX_ARMOUR(i));
Log_PrintQ      ("hello this is a test\n");
Nice This its to go into the files or place words on ir
Disc = 0xemiil
Reply

Users browsing: 2 Guest(s)