Inside3D!
     

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

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
dayfive



Joined: 10 Nov 2006
Posts: 77

PostPosted: Tue Dec 19, 2006 2:29 am    Post subject: Fixing the `bug` in E4M8 (The Nameless City) Reply with quote

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?
Back to top
View user's profile Send private message
DieparBaby



Joined: 05 Dec 2006
Posts: 44
Location: London, Ontario, Canada, eh

PostPosted: Tue Dec 19, 2006 3:30 am    Post subject: Reply with quote

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

Code:

local entity t;
local vector org;


put this:

Code:

t = find( world, targetname, self.target );
if( !t )
{
    if( mapname == "e4m8" )
    {
        return;
    }
    objerror( "couldn't find target" );
}
Back to top
View user's profile Send private message
dayfive



Joined: 10 Nov 2006
Posts: 77

PostPosted: Tue Dec 19, 2006 4:33 am    Post subject: Reply with quote

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

Code:

local entity t;
local vector org;


put this:

Code:

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


thanks!
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Tue Dec 19, 2006 9:15 pm    Post subject: Reply with quote

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:

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.)
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
DieparBaby



Joined: 05 Dec 2006
Posts: 44
Location: London, Ontario, Canada, eh

PostPosted: Tue Dec 19, 2006 9:31 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Tue Dec 19, 2006 10:31 pm    Post subject: Reply with quote

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. Embarassed
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
Lardarse



Joined: 05 Nov 2005
Posts: 243
Location: Bristol, UK

PostPosted: Wed Dec 20, 2006 4:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Wed Dec 20, 2006 5:42 am    Post subject: Reply with quote

You could just use the fixes found on QIP
_________________
Back to top
View user's profile Send private message Send e-mail
dayfive



Joined: 10 Nov 2006
Posts: 77

PostPosted: Wed Dec 20, 2006 7:12 am    Post subject: Reply with quote

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:

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?
Back to top
View user's profile Send private message
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Wed Dec 20, 2006 7:42 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
dayfive



Joined: 10 Nov 2006
Posts: 77

PostPosted: Thu Dec 21, 2006 5:01 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Lardarse



Joined: 05 Nov 2005
Posts: 243
Location: Bristol, UK

PostPosted: Fri Dec 22, 2006 11:44 am    Post subject: Reply with quote

Quote:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group