Entities File for Quake3

22 replies [Last post]
Z3nnY
Offline
Joined: May 2013
Posts:

Hi, I have search a lot for a clean code for made external .ent file into quake3. I have found all that stuff into Quake2 but it's not the same. At the beginning i have search into the loading of the map (something like CM_LoadMap) where the entities are loaded. I know all the entities are stocked into cm.entitystring but i don't know how can i read an ent file and load just the entitie of my file. If someone can help me i thanks you in advance Happy

PS: I'm french, if i have made english fault i'm sorry.

V1979
V1979's picture
Offline
Joined: Nov 2011
Posts:
RU Russian Federation
Re: Entities File for Quake3

Je voudrais te proposer d'exposer tes pensées en français, parce que je ne comprends pas que tu veux dire quand tu écris en anglais.

Z3nnY
Offline
Joined: May 2013
Posts:
Re: Entities File for Quake3

Biensûr, pour commencer merci de repondre si rapidement. Bon, je recherche le moyen d'ajouter des fichier .ent dans Quake 3 sans passer par ce mod ni aucun autre. J'ai trouver ça sur Quake 2 et je sais que c'est possible sur Quake 3. J'ai pas mal rechercher et j'ai trouver le chargement des entitées dans le serveur (CM_LoadMap). J'ai egalement trouver ou les entités sont "stocké" (cm.entitystring). J'aimerais donc simplement pouvoir ajouter l'utilisation des fichier ent dans d'autre modes.

V1979
V1979's picture
Offline
Joined: Nov 2011
Posts:
RU Russian Federation
Re: Entities File for Quake3

Si je ne me trompe pas, pas tous les mods supportent les fichiers *.add et *.ents.

epsiplayer
THE ONE AND ONLY
intact-epsilon's picture
Offline
Joined: Dec 2006
Posts:
Re: Entities File for Quake3

Ent string comes from the bsp map.
open the wanted map pk3 file using winrar, find the mapname.bsp in it, click it to view, search "worldspawn" in it to arrive at the start of the section that contains all the entities.
Like in the above images:

The string cm.entitystring is loaded when the map is parsed in cm_load.cpp by the function:

/*
=================
CMod_LoadEntityString
=================*/
void CMod_LoadEntityString( lump_t *l, clipMap_t &cm ) {
              cm.entityString = (char *)Hunk_Alloc( l->filelen, h_high );    
              cm.numEntityChars = l->filelen;    Com_Memcpy (cm.entityString, cmod_base + l->fileofs, l->filelen);
}

and used in the same file here:

static void CM_LoadMap_Actual( const char *name, qboolean clientload, int *checksum, clipMap_t &cm )
{
....
              // load into heap
              CMod_LoadShaders( &header.lumps[LUMP_SHADERS], cm );
              CMod_LoadLeafs (&header.lumps[LUMP_LEAFS], cm);
              CMod_LoadLeafBrushes (&header.lumps[LUMP_LEAFBRUSHES], cm);
              CMod_LoadLeafSurfaces (&header.lumps[LUMP_LEAFSURFACES], cm);
              CMod_LoadPlanes (&header.lumps[LUMP_PLANES], cm);
              CMod_LoadBrushSides (&header.lumps[LUMP_BRUSHSIDES], cm);
              CMod_LoadBrushes (&header.lumps[LUMP_BRUSHES], cm);
              CMod_LoadSubmodels (&header.lumps[LUMP_MODELS], cm);
              CMod_LoadNodes (&header.lumps[LUMP_NODES], cm);
              CMod_LoadEntityString (&header.lumps[LUMP_ENTITIES], cm);
              CMod_LoadVisibility( &header.lumps[LUMP_VISIBILITY], cm );
              CMod_LoadPatches( &header.lumps[LUMP_SURFACES], &header.lumps[LUMP_DRAWVERTS], cm );

_________
epsinoob


Z3nnY
Offline
Joined: May 2013
Posts:
Re: Entities File for Quake3

@V1979 : Je le sais bien c'est pour cela que je veux l'integrer moi même.

@epsicookieMon : Okay, so it's exactly what i have found in the code. But with that i want add the possibilities to use .ent file. Maybe i do read a ent file and put all the text into cm.entitystring ?

V1979
V1979's picture
Offline
Joined: Nov 2011
Posts:
RU Russian Federation
Re: Entities File for Quake3

Veux-tu changer le placement d'objets pour toujours ou pour quelques buts à part?

Z3nnY
Offline
Joined: May 2013
Posts:
Re: Entities File for Quake3

Je veux simplement utiliser des fichiers .ents sous d'autre mod.. Pour cela il me suffit d'y ajouter le code dans le qvm ou dans le serveur

epsiplayer
THE ONE AND ONLY
intact-epsilon's picture
Offline
Joined: Dec 2006
Posts:
Re: Entities File for Quake3
Z3nnY wrote:

@epsicookieMon : Okay, so it's exactly what i have found in the code. But with that i want add the possibilities to use .ent file. Maybe i do read a ent file and put all the text into cm.entitystring ?

Yes, you need to do exactly that in one of the functions i said above.

__________
epsislow


Z3nnY
Offline
Joined: May 2013
Posts:
Re: Entities File for Quake3

Okay, thank's a lot. Happy

V1979
V1979's picture
Offline
Joined: Nov 2011
Posts:
RU Russian Federation
Re: Entities File for Quake3

J'ai compris. Malheureusement je ne suis pas programmeur. Je pourrais t'aider à faire un fichier *.ents ou bien compiler une variante voulue d'une carte. A vrai dire c'est assez simple.
Et encore une chose, si tu sais compiler (changer) les fichiers *.qvm, pourrais-tu me compiler un mod(e)? Pas compliqué, tout à fait.