Okay, I played around a bit and it seems like calling an engine->ServerCommand("respawn_entities\n") from respawn() in hl2_client.cpp and moving the pPlayer->RemoveSolidFlags( FSOLID_NOT_SOLID ) to the function that actually respawns the entities (which is void FrameUpdatePostEntityThink() in entitylist.cpp) works fine. No more getting stuck in my HEV suit now ;> There's two little issues though, well, let's say three:
1. For some reason the FrameUpdatePostEntityThink() gets called twice with the parameter m_bRespawnAllEntities set to true. This is weird because the first thing that's done in the if-statement is setting the variable to false so the if-statement is ignored on the next think. When you execute the respawn_entities command, the function void RespawnEntities() gets called which sets the m_bRespawnAllEntities variable to true. void FrameUpdatePostEntityThink() { g_TouchManager.FrameUpdatePostEntityThink(); if ( m_bRespawnAllEntities ) { m_bRespawnAllEntities = false; // ... This is annoying because I'm starting demo recording right after respawning as well. If the function gets called twice, there'll always be the console output "Already recording." which looks kind of sloppy. 2. This only happens on a test map I made myself. When I respawn, the HEV suit spawns as well, obviously, but apparently the player already spawns with one causing there to be another suit in the map which you can't pick up. If I respawn on any map from HL2, all items spawn properly, you have your suit but there's not a second one standing around in the map. 3. This happened a couple of times on certain HL2 maps. After respawning, textures started to look light blue, sometimes the distance fog wouldn't be rendered. This occured on d2_coast_07 as well as on others. Also, sometimes items won't spawn at all, just the player and certain key input seems to be ignored (e.g. F1 which I use to open the console). I cannot tell how to reproduce this unfortunately. It seems as if this only happens with HL2 maps, Ep2 maps don't seem to have the graphics issues, but the item issue happens there, too occasionally. For example, ep2_outland_08. If I make it to the chopper fight, then die and respawn, I start in the tunnel at the very beginning and don't get any items at all. The mod is based on Ep2 which is why I have AppID 420 in my gameinfo.txt. Beside that, I parse the HL2 content via AdditionalContentId 220. 2010/5/14 Klaus Müller <tloeffl...@googlemail.com> > The first part worked great, the second not so much :/ > I added this to respawn(): > > if( pEdict->IsPlayer() ) > { > CBasePlayer *pPlayer = (CBasePlayer*) pEdict; > pPlayer->Spawn(); > pPlayer->RemoveSolidFlags( FSOLID_NOT_SOLID ); > } > > If I do an additional call to engine->ServerCommand("respawn_entities\n"), > I get stuck in my suit :> What's even worse though is that there are no > decals anymore after the ServerCmd call. Also, the console command restart > doesn't work anymore with this. > But speaking of solid flags, how come the player doesn't collide with > broken creates anymore? He used to in HL2, but since Ep1 they seem to be > unaffected by the player. I've been meaning to change that as well. Any > insight? :> > > > 2010/5/14 Tom Edwards <t_edwa...@btinternet.com> > > The first issue is a deficiency of CBasePlayer, I believe. You'll need >> to call RemoveSolidFlags( FSOLID_NOT_SOLID ) in your player's spawn() >> func. >> >> The second issue can be resolved with respawn_entities console command, >> which may well work around your first issue too. >> >> On 14/05/2010 3:09, Klaus Müller wrote: >> > Hey, >> > >> > I've got a problem again with a different project though. It's a single >> > player mod based on Ep2 (Source engine 2k7). I want my player to respawn >> > after he dies, and not reload the entire map. Therefore, I simply did a >> > pEdict->Spawn() call in void respawn( CBaseEntity *pEdict, bool >> fCopyCorpse >> > ) in hl2_client.cpp by default. That's also what happens in MP mode. >> > However, once respawned (without suit, obviously), the collision types >> seem >> > to be wrong. For instance, if I jump onto an object, say a wooden pallet >> or >> > a wooden box, I slowly get pushed away from it which doesn't happen on >> > initial spawn. Also, if I grab an object and jump a couple times while >> > looking to the ground, I get stuck in the object (message: server got >> stuck >> > in object bla.mdl). The weirdest thing, however, is that eventuall I'll >> > "fall" through the object and completely out of the level. I tried >> calling >> > an additional Activate() in respawn() but that didn't do anything. >> > >> > That's one question. The second one deals with items. Since I already >> picked >> > up the items when I first spawned the map, they are gone once I respawn. >> I >> > thought about making a copy of the item list when the player dies and >> just >> > pass them to the respawn func and give them to the player after >> respawning. >> > However, any other objects on the map will still be the same (e.g. boxes >> > might be broken), and I need them to be where they were when the map >> spawned >> > the first time (due to gameplay reasons). The reason I don't want to >> reload >> > the map is that it takes too long and thus will ruin the playflow of the >> > mod. Does anyone know how I could reset the map and its entities without >> > using a engine->ServerCommand("reload\n") call? >> > >> > Kind regards, >> > Klaus >> > _______________________________________________ >> > To unsubscribe, edit your list preferences, or view the list archives, >> please visit: >> > http://list.valvesoftware.com/mailman/listinfo/hlcoders >> > >> > >> > >> >> _______________________________________________ >> To unsubscribe, edit your list preferences, or view the list archives, >> please visit: >> http://list.valvesoftware.com/mailman/listinfo/hlcoders >> >> > _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders