Editing Talk:Deathmatch start (section) From DoomWiki.org Warning: You are not logged in. Your IP address will be recorded in this page's edit history. Anti-spam check. Do not fill this in! == TFOG sprite == Player starts (deathmatch or single/coop) do not have any associated [[mobj]] type. When a player respawns (in deathmatch or coop) and you see a TFOG sprite, it's not the player start that you see -- it's an MT_FOG mobj spawned at the same place, same as when a teleport happens. If you look at the map with the map cheat on, you can see there is an additional object spawned at the position of the player start. See G_CheckSpot in g_game.c. {| {{prettytable}} |<source lang=C> boolean G_CheckSpot ( int playernum, mapthing_t* mthing ) { fixed_t x; fixed_t y; subsector_t* ss; unsigned an; mobj_t* mo; int i; if (!players[playernum].mo) { // first spawn of level, before corpses for (i=0 ; i<playernum ; i++) if (players[i].mo->x == mthing->x << FRACBITS && players[i].mo->y == mthing->y << FRACBITS) return false; return true; } x = mthing->x << FRACBITS; y = mthing->y << FRACBITS; if (!P_CheckPosition (players[playernum].mo, x, y) ) return false; // flush an old corpse if needed if (bodyqueslot >= BODYQUESIZE) P_RemoveMobj (bodyque[bodyqueslot%BODYQUESIZE]); bodyque[bodyqueslot%BODYQUESIZE] = players[playernum].mo; bodyqueslot++; // spawn a teleport fog ss = R_PointInSubsector (x,y); an = ( ANG45 * (mthing->angle/45) ) >> ANGLETOFINESHIFT; mo = P_SpawnMobj (x+20*finecosine[an], y+20*finesine[an] , ss->sector->floorheight , MT_TFOG); if (players[consoleplayer].viewz != 1) S_StartSound (mo, sfx_telept); // don't start sound on first frame return true; } </source> |} This function is called by both G_DoReborn (used for respawning players in coop) and G_DeathMatchSpawnPlayer (which does what its name implies). Yeah, conceptually, the "check" function shouldn't do the corpse flushing, fog spawning, and sound playing stuff: if it's supposed to be a check function, it shouldn't have any [[wikipedia:side effect (computer science)|side effect]]. At least it doesn't have any side effect when it returns false. Anyway, my point was that player starts are map things without a corresponding mobj (while players themselves are mobjs without a corresponding map thing) so the player starts are never seen. --[[User:Gez|Gez]] 10:11, 24 March 2014 (UTC) : Wow, thank you — I wouldn't have found ''that'' if I'd spent the rest of my life studying the code. Actually, I'd have had no problem removing the sprite name without knowing every detail, as long as the articles were mutually consistent, but you've left no room for doubt now. [[User:Ryan W|Ryan W]] 22:44, 24 March 2014 (UTC) Summary: All contributions to DoomWiki.org are considered to be released under the CC BY-SA 4.0 International (see Doom Wiki:Copyrights for details). By contributing, you agree to be bound by the Terms of Use. Your changes will be visible immediately. Please enter a summary of your changes above. Do not submit copyrighted images or text without permission! This includes text taken from in-game codices or logbooks, or from official instruction manuals, strategy guides, and other such books. This project is not affiliated with id Software, Raven Software, ZeniMax Media, Bethesda SoftWorks, or any other commercial software developer or publisher. Use of trademarked logos and other protected intellectual property is solely for the purpose of analysis and critical commentary on the identified products and associated fan community activity, and does not imply any endorsement by any of these organizations or their employees, past or present. Upload images to the wiki. Don't forget to categorize pages! For testing, please use a sandbox. View this template Cancel | Editing help (opens in new window)