I occasionally make my own custom locs, and I don't
like to deal with qizmo. I prefer to use ezquake's
inbuilt .loc editor.
I hope that this feature/tutorial will be helpful to
someone, as after you place a loc location, the .loc
will be represented by a small fireball. (30 mins)
Also, just to view the existing .locs on a map,
simply do: loc_view <seconds>, and all the
locs in the map will be represented by a small fireball
for the amount of time you specify.
You are welcome to use this code in the new ezquake, etc
All I ask is that you give me credit (5uper) and hopefully leave my comments intact
(note: my NA TF name is 5uper/ss, so that is why the comments say 5uper)
Here is the code for anyone who is interested
(built off ezquake 1754, will still port into ezq 1.8.3, etc)
open up teamplay.c and at the top add:
// 5uper: loc editor
void DrawLocs (vec3_t loc_location, int loc_time);
add this code right before TP_Init:
// 5uper: find all locs in map, and represent them as a particle
void LocateLocsToDraw_f (void)
{
locdata_t *node;
int loc_time = 0;
loc_time = atoi(Cmd_Argv(1));
Com_Printf ("displaying current locs for: %i seconds\n", loc_time);
for (node = locdata; node; node = node->next)
DrawLocs (node->coord, loc_time);
}
ok, in TP_Init, under Cmd_AddCommand ("loadloc", TP_LoadLocFile_f);
add:
// 5uper: command to view locs in map.
Cmd_AddCommand ("loc_view", LocateLocsToDraw_f);
now, in the middle of teamplay.c is the function:
void TP_AddLoc(char *locname)
under
TP_AddLocNode(location, locname);
add:
// 5uper: loc editor (view locs we just set)
DrawLocs (location, 1800); // 30 minutes should be more than enough time
ok, close teamplay.c.
now move to gl_rpart.c
at the very bottom of gl_rpart.c, add this function:
// 5uper: view loc files in a map, enhanced loc editing
void DrawLocs (vec3_t loc_location, int loc_time)
{
vec3_t end;
col_t color={255,142,62,0}; // look like fire
end[0] = end[1] = end[2] = 0; // no movement in any direction
AddParticle (p_fire, loc_location, 1, 25, loc_time, color, end);
}
Notice AddParticle. I had to create my own particle type to prevent
the particles from moving due to gravity without messing up the
original fire particle.
Ok, in typedef enum part_type_t at the top of gl_rpart.c,
above:
num_particletypes
add:
p_loc_particle,
Now, in QMB_InitParticles
under:
ADD_PARTICLE_TYPE(p_fire, pd_billboard, GL_SRC_ALPHA, GL_ONE, ptex_generic, 204, 0, -2.95, pm_die, 0);
add:
// 5uper: enhanced loc editing
ADD_PARTICLE_TYPE(p_loc_particle, pd_billboard, GL_SRC_ALPHA, GL_ONE, ptex_generic, 204, 0, 0, pm_die, 0);
Almost done.
In the function AddParticle, we need to add the p_loc_particle type.
Right after:
case p_fire:
VectorCopy(org, p->org);
for (j = 0; j < 3; j++)
p->vel[j] = ((rand() % 160) - 80) * (size / 25.0);
break;
add:
// 5uper: loc particle type for enhanced loc editing
case p_loc_particle:
VectorCopy(org, p->org);
for (j = 0; j < 3; j++)
p->vel[j] = 0;
break;
Done.
Now compile and start up any map you have a .loc for, and
type: loc_view 30
Here are screenshots of the loc_view command
http://img378.imageshack.us/img378/4326/ezquake054kq4.jpg
http://img169.imageshack.us/img169/3792/ezquake055fk5.jpg
http://img210.imageshack.us/img210/9082/ezquake056uj8.jpg
And here is a screenshot of a loc i just created using loc_add xxx
http://img137.imageshack.us/img137/2333/ezquake057tj4.jpg
like to deal with qizmo. I prefer to use ezquake's
inbuilt .loc editor.
I hope that this feature/tutorial will be helpful to
someone, as after you place a loc location, the .loc
will be represented by a small fireball. (30 mins)
Also, just to view the existing .locs on a map,
simply do: loc_view <seconds>, and all the
locs in the map will be represented by a small fireball
for the amount of time you specify.
You are welcome to use this code in the new ezquake, etc
All I ask is that you give me credit (5uper) and hopefully leave my comments intact
(note: my NA TF name is 5uper/ss, so that is why the comments say 5uper)
Here is the code for anyone who is interested
(built off ezquake 1754, will still port into ezq 1.8.3, etc)
open up teamplay.c and at the top add:
// 5uper: loc editor
void DrawLocs (vec3_t loc_location, int loc_time);
add this code right before TP_Init:
// 5uper: find all locs in map, and represent them as a particle
void LocateLocsToDraw_f (void)
{
locdata_t *node;
int loc_time = 0;
loc_time = atoi(Cmd_Argv(1));
Com_Printf ("displaying current locs for: %i seconds\n", loc_time);
for (node = locdata; node; node = node->next)
DrawLocs (node->coord, loc_time);
}
ok, in TP_Init, under Cmd_AddCommand ("loadloc", TP_LoadLocFile_f);
add:
// 5uper: command to view locs in map.
Cmd_AddCommand ("loc_view", LocateLocsToDraw_f);
now, in the middle of teamplay.c is the function:
void TP_AddLoc(char *locname)
under
TP_AddLocNode(location, locname);
add:
// 5uper: loc editor (view locs we just set)
DrawLocs (location, 1800); // 30 minutes should be more than enough time
ok, close teamplay.c.
now move to gl_rpart.c
at the very bottom of gl_rpart.c, add this function:
// 5uper: view loc files in a map, enhanced loc editing
void DrawLocs (vec3_t loc_location, int loc_time)
{
vec3_t end;
col_t color={255,142,62,0}; // look like fire
end[0] = end[1] = end[2] = 0; // no movement in any direction
AddParticle (p_fire, loc_location, 1, 25, loc_time, color, end);
}
Notice AddParticle. I had to create my own particle type to prevent
the particles from moving due to gravity without messing up the
original fire particle.
Ok, in typedef enum part_type_t at the top of gl_rpart.c,
above:
num_particletypes
add:
p_loc_particle,
Now, in QMB_InitParticles
under:
ADD_PARTICLE_TYPE(p_fire, pd_billboard, GL_SRC_ALPHA, GL_ONE, ptex_generic, 204, 0, -2.95, pm_die, 0);
add:
// 5uper: enhanced loc editing
ADD_PARTICLE_TYPE(p_loc_particle, pd_billboard, GL_SRC_ALPHA, GL_ONE, ptex_generic, 204, 0, 0, pm_die, 0);
Almost done.
In the function AddParticle, we need to add the p_loc_particle type.
Right after:
case p_fire:
VectorCopy(org, p->org);
for (j = 0; j < 3; j++)
p->vel[j] = ((rand() % 160) - 80) * (size / 25.0);
break;
add:
// 5uper: loc particle type for enhanced loc editing
case p_loc_particle:
VectorCopy(org, p->org);
for (j = 0; j < 3; j++)
p->vel[j] = 0;
break;
Done.
Now compile and start up any map you have a .loc for, and
type: loc_view 30
Here are screenshots of the loc_view command
http://img378.imageshack.us/img378/4326/ezquake054kq4.jpg
http://img169.imageshack.us/img169/3792/ezquake055fk5.jpg
http://img210.imageshack.us/img210/9082/ezquake056uj8.jpg
And here is a screenshot of a loc i just created using loc_add xxx
http://img137.imageshack.us/img137/2333/ezquake057tj4.jpg