Forum

Fixing the `bug` in E4M8 (The Nameless City)

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Fixing the `bug` in E4M8 (The Nameless City)

Postby dayfive » Tue Dec 19, 2006 2:29 am

right at the beginning of the nameless city if you stand on the top of the teleporter, it results in a program error....

how to best go about fixing this using QuakeC?
User avatar
dayfive
 
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Postby DieparBaby » Tue Dec 19, 2006 3:30 am

At the beginning of teleport_touch() in triggers.qc just after this:

Code: Select all
local entity t;
local vector org;


put this:

Code: Select all
t = find( world, targetname, self.target );
if( !t )
{
    if( mapname == "e4m8" )
    {
        return;
    }
    objerror( "couldn't find target" );
}
User avatar
DieparBaby
 
Posts: 44
Joined: Tue Dec 05, 2006 3:27 pm
Location: London, Ontario, Canada, eh

Postby dayfive » Tue Dec 19, 2006 4:33 am

DieparBaby wrote:At the beginning of teleport_touch() in triggers.qc just after this:

Code: Select all
local entity t;
local vector org;


put this:

Code: Select all
t = find( world, targetname, self.target );
if( !t )
{
    if( mapname == "e4m8" )
    {
        return;
    }
    objerror( "couldn't find target" );
}


thanks!
User avatar
dayfive
 
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Postby Dr. Shadowborg » Tue Dec 19, 2006 9:15 pm

That's good, but unfortunatly, it'll have an unfortunate side effect of not removing the trigger. In short, you'll get a constantly repeating teleport flash / fog effect whenever you're touching it.

It's probably better to put:
Code: Select all
if(mapname == "e4m8" && self.target == "t273")
{
  remove(self);
  return;
}


This will cause the trigger_teleport to be removed upon spawning when the level loads.

And no, I did not look at the map sources to determine the target designation. You can use this to good effect to hack and change a lot of entities and conditions for activating said entities by learning to use the data they contain to identify them. (One very good example is patrick martin's dragons! patch.)
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby DieparBaby » Tue Dec 19, 2006 9:31 pm

Actually if you put that code right at the beginning of the touch function like I indicated
you won't get the teleport flash. I tested it in game. The code will only
return if the teleport doesn't have a target so other valid teleports on e4m8 are fine.
User avatar
DieparBaby
 
Posts: 44
Joined: Tue Dec 05, 2006 3:27 pm
Location: London, Ontario, Canada, eh

Postby Dr. Shadowborg » Tue Dec 19, 2006 10:31 pm

DieparBaby wrote:Actually if you put that code right at the beginning of the touch function like I indicated
you won't get the teleport flash. I tested it in game. The code will only
return if the teleport doesn't have a target so other valid teleports on e4m8 are fine.


Then you'll be calling a horribly ineffecient find function twice, unless you take out the one that's called later on. =P

Incidentally, I forgot to mention that the code bit I posted should be placed at the beginning of the trigger_teleport function. :oops:
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby Lardarse » Wed Dec 20, 2006 4:47 am

I like the idea of what you're trying to do, but it's far easier to remove the entity in question. The hardest part is just to work out how to uniquely identify the entity you want to change/remove, and for that, a combination of looking at the map sources, looking at a list of just the entities in the map (do sv_saveentfile from within DarkPlaces), or creating a progs.dat that helps you to identify things from a players-eye view will help you to determine what needs to be changed.
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby FrikaC » Wed Dec 20, 2006 5:42 am

You could just use the fixes found on QIP
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby dayfive » Wed Dec 20, 2006 7:12 am

to be perfectly honest, i kind of like the repeating teleport fog/flash whatever.... so the first solution is fairly nice imho

however, this solution has implications reaching far beyond this small problem; which i will most definitely note for future reference

Dr. Shadowborg wrote:
Code: Select all
if(mapname == "e4m8" && self.target == "t273")
{
  remove(self);
  return;
}



also, i couldn't find any mention of the e4m8 bug
FrikaC wrote:You could just use the fixes found on QIP


on at least the following URLs

http://www.inside3d.com/qip/q1/bugs.htm
http://www.inside3d.com/qip/q1/qcfix.htm
http://www.inside3d.com/qip/q1/qfix.htm

where is this specific issue talked about on QIP?
User avatar
dayfive
 
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Postby FrikaC » Wed Dec 20, 2006 7:42 am

That's because all of those links go to code related bugs or fixes, it's a map error and is thus found on the Map bugs section:

http://www.inside3d.com/qip/q1/bugsmap.htm#Maps

The text of the problem is this:

"Quake crashes on E4M5, when a player grapples, noclips or rocket/grenade-jumps to the top of the secret exit.
Reported by Robert "Frog" Field
A similar error occurs in the START map under the exit to the end level (by Robert Field too) and at top of the start gate in E4M8 (by Max Bartlett)"

It links to this QuakeC fix as well as patches for the actual maps.
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby dayfive » Thu Dec 21, 2006 5:01 am

FrikaC wrote:That's because all of those links go to code related bugs or fixes, it's a map error and is thus found on the Map bugs section:

http://www.inside3d.com/qip/q1/bugsmap.htm#Maps

The text of the problem is this:

"Quake crashes on E4M5, when a player grapples, noclips or rocket/grenade-jumps to the top of the secret exit.
Reported by Robert "Frog" Field
A similar error occurs in the START map under the exit to the end level (by Robert Field too) and at top of the start gate in E4M8 (by Max Bartlett)"

It links to this QuakeC fix as well as patches for the actual maps.


oh!! I see now.... Thanks for pointing this out!

it's good to know about those others as well! In those cases it might be more desirable to use the if(mapname == "whatever" && self.target == "t420") remove(self); fix

thanks for describing it in detail
User avatar
dayfive
 
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Postby Lardarse » Fri Dec 22, 2006 11:44 am

In those cases it might be more desirable to use the if(mapname == "whatever" && self.target == "t420") remove(self); fix

I think it's the better fix to use, unless you're going to be using modified maps.
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest