On 06/19/2012 02:30 AM, Yasir I. Al-Dosary - zgzg2020™ wrote:
Thank you for kindly answering my questions!

>If you need them and don't care about compatibility with ioquake why not
>modify the exported functions to game?
I'm exactly just that right now. I've given up on using time.h.
So, I found trap_AAS_Time(). And, I'm moving to it.
However, I also need to write to files. I tried to add stdio.h. But, I got the same problem as when I add time.h
Does ioquake3 offer File I/O capabilities as well?

Pretty sure what you want is in game/g_local.h
int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode );
void trap_FS_Read( void *buffer, int len, fileHandle_t f );
void trap_FS_Write( const void *buffer, int len, fileHandle_t f );
void trap_FS_FCloseFile( fileHandle_t f );
int trap_FS_GetFileList( const char *path, const char *extension, char *listbuf, int bufsize );
int trap_FS_Seek( fileHandle_t f, long offset, int origin ); // fsOrigin_t

Best regards!

    ------------------------------------------------------------------------
    *From:* Harley Laue <losinggenerat...@gmail.com>
    *To:* Yasir I. Al-Dosary - zgzg2020™ <yasiraldos...@yahoo.com>;
    Primary ioquake3 Discussion/Development list
    <ioquake3@lists.ioquake.org>
    *Sent:* Tuesday, June 19, 2012 3:46 PM
    *Subject:* Re: [ioquake3] Programming question

    On Monday, June 18, 2012 10:45:16 PM Yasir I. Al-Dosary -
    zgzg2020™ wrote:
    > Thanks for the reply again!
    > When I compile with "BUILD_GAME_SO=1 and BUILD_GAME_QVM=0" qvms
    don't get
    > built, which I'm guessing is the point of the second option. The
    > compilation completes without any errors.
    >
    > However when I run the Game:
    > ./ioq3ded.ppc64 +set fs_game Mod +set sv_pure 0 +set vm_game 0
    +set vm_cgame
    > 0 +set vm_ui 0 +set dedicated 1 +exec something_112_respwn.cfg
    >
    > The Game crashes right away. I placed the log at the end of this
    email.
    >
    > I have several questions that I would really like some help with.
    > Regarding LCC compiler you kindly mentioned before:
    > * I couldn't find a version of it on linux. How is it being used
    on linux
    > when it is a Windows-only compiler? * If LCC compiler is
    available on
    > Linux, where can I download it? Because I am thinking maybe the LCC
    > compiler settings might have a problem.

    See code/tools/lcc

    >
    > Regarding the compilation of QVM files:
    > * I have noticed from the compilation log that they are compiled
    as C++
    > files, and C files: cpp: code/game/ai_main.c:2712 Could not find
    include
    > file <sys/time.h> make[2]: ***
    > [build/release-linux-ppc64/baseq3/game/ai_main.asm] Error 1 Why
    is that?

    CPP == C Pre-Processor in this case if I'm not mistaken.

    > In qcommon/q_shared.h, I've also written in below:
    > * What does this quote mean?
    > * time.h is included inside q_shared.h, and q_shared.h is
    included inside
    > ai_main.c. Therefore, shouldn't this allow me to use the time
    library?
    >
    > ioquake3 general questions:
    > The main reason I need to solve this current problem is the
    following. I
    > need a high precision time measuring tool, such as time.h. I am sure
    > ioquake3 requires such tools as well, to regulate frames...etc.
    * Is there
    > a time tool I can use inside ioquake3 without the need to add
    something new
    > from the outside such as time.h?

    If you need them and don't care about compatibility with ioquake
    why not
    modify the exported functions to game?


    As for below:
    > Sys_LoadDll(./Mod/qagameppc.so) failed:
    > "./Mod/qagameppc.so: undefined symbol: Com_Quit_f"
    Would be where I would start investigating.

    > I really appreciate this! I really need to be able to use the
    time library
    > inside ai_main.c very badly.
    >
    > --------------Q_SHARED.H
    >
    /**********************************************************************
    >  VM Considerations
    >  The VM can not use the standard system headers because we
    aren't really
    >  using the compiler they were meant for.  We use bg_lib.h which
    contains
    >  prototypes for the functions we define for our own use in bg_lib.c.
    >  When writing mods, please add needed headers HERE, do not start
    including
    >  stuff like <stdio.h> in the various .c files that make up each
    of the VMs
    >  since you will be including system headers files can will have
    issues.
    >  Remember, if you use a C library function that is not defined
    in bg_lib.c,
    > you will have to add your own version for support in the VM.
    >
    **********************************************************************/
    > #ifdef Q3_VM
    > #include "../game/bg_lib.h"
    > typedef int intptr_t;
    > #else
    > //#include <assert.h>
    > #include <math.h>
    > #include <stdio.h>
    > #include <stdarg.h>
    > #include <string.h>
    > #include <stdlib.h>
    > #include <time.h>
    > #include <ctype.h>
    > #include <limits.h>
    > --------------Q_SHARED.H
    >
    >
    >
    >
    > --------------RUNNING THE GAME WITH BUILD_GAME_SO=1 and
    BUILD_GAME_QVM=0
    > ----------------------
    >
    rmc104:~/minoru/cfe2/yasirTemp/ioquake3dev/Best201202231123_True_final/ioqua
    > ke3dev_clean/build/release-linux-ppc64[10075]% ./ioq3ded.ppc64
    +set fs_game
    > Mod +set sv_pure 0 +set vm_game 0 +set vm_cgame 0 +set vm_ui 0 +set
    > dedicated 1 +exec something_112_respwn.cfg ioq3 linux-ppc Jun 19
    2012
    > ----- FS_Startup -----
    > Current search path:
    > /home7/yasir/.q3a/Mod
    > ./Mod
    > /home7/yasir/.q3a/baseq3
    > ./baseq3/pak8.pk3 (9 files)
    > ./baseq3/pak7.pk3 (4 files)
    > ./baseq3/pak6.pk3 (64 files)
    > ./baseq3/pak5.pk3 (7 files)
    > ./baseq3/pak4.pk3 (272 files)
    > ./baseq3/pak3.pk3 (4 files)
    > ./baseq3/pak2.pk3 (148 files)
    > ./baseq3/pak1.pk3 (26 files)
    > ./baseq3/pak0.pk3 (3539 files)
    > ./baseq3
    >
    > ----------------------
    > 4073 files in pk3 files
    > execing default.cfg
    > execing q3config_server.cfg
    > execing autoexec.cfg
    > Hunk_Clear: reset the hunk ok
    > Altivec support is disabled
    > --- Common Initialization Complete ---
    > IP: 127.0.0.1
    > IP: 133.9.80.16
    > IP6: ::1
    > IP6: fe80::20d:60ff:fe4d:c88a%eth0
    > Opening IP socket:
    > 0.0.0.0:27960
    > execing
    > something_112_respwn.cfg ------ Server Initialization ------
    > Server: q3dm1
    > Hunk_Clear: reset the hunk ok
    > ----- FS_Startup -----
    > Current search path:
    > /home7/yasir/.q3a/Mod
    > ./Mod
    > /home7/yasir/.q3a/baseq3
    > ./baseq3/pak8.pk3 (9 files)
    > ./baseq3/pak7.pk3 (4 files)
    > ./baseq3/pak6.pk3 (64 files)
    > ./baseq3/pak5.pk3 (7 files)
    > ./baseq3/pak4.pk3 (272 files)
    > ./baseq3/pak3.pk3 (4 files)
    > ./baseq3/pak2.pk3 (148 files)
    > ./baseq3/pak1.pk3 (26 files)
    > ./baseq3/pak0.pk3 (3539 files)
    > ./baseq3
    >
    > ----------------------
    > 8146 files in pk3 files
    > Loading dll file qagame.
    >
    Sys_LoadDll(/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/Best20120223112
    >
    3_True_final/ioquake3dev_clean/build/release-linux-ppc64/Mod/qagameppc.so)..
    > .
    >
    Sys_LoadDll(/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/Best2012022311
    >
    23_True_final/ioquake3dev_clean/build/release-linux-ppc64/Mod/qagameppc.so)
    > failed:
    >
    "/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/Best201202231123_True_fin
    > al/ioquake3dev_clean/build/release-linux-ppc64/Mod/qagameppc.so:
    undefined
    > symbol: Com_Quit_f"
    Sys_LoadDll(/home7/yasir/.q3a/Mod/qagameppc.so)...
    > Sys_LoadDll(/home7/yasir/.q3a/Mod/qagameppc.so) failed:
    > "/home7/yasir/.q3a/Mod/qagameppc.so: cannot open shared object
    file: No such
    > file or directory" Sys_LoadDll(./Mod/qagameppc.so)...
    > Sys_LoadDll(./Mod/qagameppc.so) failed:
    > "./Mod/qagameppc.so: undefined symbol: Com_Quit_f"
    > Sys_LoadDll(qagame) failed to load library
    > Failed to load dll, looking for qvm.
    > Loading vm file vm/qagame.qvm...
    > VM file qagame compiled to 820564 bytes of code (0xf1ac8000 -
    0xf1b90554)
    > compilation took 0.090661 seconds
    > qagame loaded in 2683840 bytes on the hunk
    > ------- Game Initialization -------
    > gamename: baseq3
    > gamedate: Sep 30 2002
    > ------------------------------------------------------------
    > InitGame:
    >
    \capturelimit\8\g_maxGameClients\0\sv_floodProtect\1\sv_maxPing\0\sv_minPin
    >
    g\0\sv_maxRate\0\sv_minRate\0\sv_maxclients\112\sv_hostname\noname\timelimit
    > \0\fraglimit\20\dmflags\0\version\ioq3  linux-ppc Jun 19
    >
    2012\g_gametype\0\protocol\68\mapname\q3dm1\sv_privateClients\0\sv_allowDow
    > nload\0\gamename\baseq3\g_needpass\0 0 teams with 0 entities
    > 12 items registered
    > -----------------------------------
    > ------- BotLib Initialization -------
    > loaded weapons.c
    > loaded items.c
    > loaded syn.c
    > loaded rnd.c
    > loaded match.c
    > loaded rchat.c
    > ------------ Map Loading ------------
    > trying to load maps/q3dm1.aas
    > loaded maps/q3dm1.aas
    > found 18 level items
    > -------------------------------------
    > 32 bots parsed
    > 35 arenas parsed
    > ********************
    > ERROR: Cvar_Update: handle out of range
    > ********************
    > ----- Server Shutdown (Server crashed: Cvar_Update: handle out
    of range)
    > ----- ==== ShutdownGame ====
    > ShutdownGame:
    > ------------------------------------------------------------
    > AAS shutdown.
    > recursive error after: Cvar_Update: handle out of range
    > ------------------
    >
    > >________________________________
    > >
    > > From: Ben Noordhuis <i...@bnoordhuis.nl
    <mailto:i...@bnoordhuis.nl>>
    > >
    > >To: Yasir I. Al-Dosary - zgzg2020™ <yasiraldos...@yahoo.com
    <mailto:yasiraldos...@yahoo.com>>
    > >Cc: Primary ioquake3 Discussion/Development list
    > ><ioquake3@lists.ioquake.org
    <mailto:ioquake3@lists.ioquake.org>> Sent: Monday, June 18, 2012
    9:47 PM
    > >Subject: Re: [ioquake3] Programming question
    > >
    > >On Mon, Jun 18, 2012 at 8:46 AM, Yasir I. Al-Dosary - zgzg2020™
    > >
    > ><yasiraldos...@yahoo.com <mailto:yasiraldos...@yahoo.com>> wrote:
    > >> Thank you for the quick response!
    > >>
    > >> "The files in game/ and cgame/ don't have access to system
    headers.
    > >> They're compiled to bytecode with the bundled lcc."
    > >>
    > >> Ok! So, what can I do to make it work? (or what shall I ask
    my admin to
    > >> do?)>
    > >Try compiling to native shared objects.
    > >
    > >Off the top of my head, set BUILD_GAME_SO=1 and BUILD_GAME_QVM=0 in
    > >your Makefile.local and run the game with `+set vm_game 0 +set
    > >vm_cgame 0 +set vm_ui 0` (you may have to add `+set sv_pure 0` as
    > >well.)




_______________________________________________
ioquake3 mailing list
ioquake3@lists.ioquake.org
http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
By sending this message I agree to love ioquake3 and libsdl.

Reply via email to