Talk:Simulated Bullets: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 39: Line 39:


I'm currently failing the <code>if ( !m_ThinkEntries.IsInList( (unsigned long)hThink ) )</code> line in <code>CClientThinkList::PerformThinkFunctions()</code>. It fires the assert in <code>CUtlLinkedList<T,I>::Previous</code> with ''i''==42, ''m_TotalElements''==43, and unknown contents of ''m_Memory[i]''. If I rerun it I get different values of ''i'', but it's always one less than ''m_TotalElements''. This might be related to the <code>SetNextClientThink( TICK_NEVER_THINK );</code> problem you mentioned. &mdash;'''[[User:Maven|Maven]]''' <sup>([[User talk:Maven|talk]])</sup> 08:59, 28 Nov 2005 (PST)
I'm currently failing the <code>if ( !m_ThinkEntries.IsInList( (unsigned long)hThink ) )</code> line in <code>CClientThinkList::PerformThinkFunctions()</code>. It fires the assert in <code>CUtlLinkedList<T,I>::Previous</code> with ''i''==42, ''m_TotalElements''==43, and unknown contents of ''m_Memory[i]''. If I rerun it I get different values of ''i'', but it's always one less than ''m_TotalElements''. This might be related to the <code>SetNextClientThink( TICK_NEVER_THINK );</code> problem you mentioned. &mdash;'''[[User:Maven|Maven]]''' <sup>([[User talk:Maven|talk]])</sup> 08:59, 28 Nov 2005 (PST)
Did you catch my edit?
in <code>clientmode_shared.cpp</code>
<pre> HOOK_MESSAGE( Bullet );
if(!g_pBulletManager)
{
g_pBulletManager = (C_BulletManager *)CreateEntityByName("bullet_manager");
ClientEntityList().AddNonNetworkableEntity(g_pBulletManager);
}</pre>
&mdash;'''[[User:Ts2do|ts2do]]'''&nbsp;<sup>([[User talk:Ts2do|Talk]]&nbsp;|&nbsp;[mailto:tsdodo@gmail.com @])</sup> 16:26, 28 Nov 2005 (PST)

Revision as of 17:26, 28 November 2005

I'd really like assistance with this if anyone can do any implementation of this or any fixes to the bullet simulator... implementation includes making the gun shoot them out, making the bullets hurt, and making clientside effects... I have a feeling that other mods WILL want to use timed bullets, and this code will do the trick... I just need help (or plenty of time) getting it finished first and then it will be available to everyone!—ts2do (Talk | @) 23:06, 20 Nov 2005 (PST)

Yes ts2do (you went away before i came back), the myth was busted, best to contact Wrayith at Nightfall mod for more info. He was interested, and was implementing something like this with the quake 2 code, and was going to port it to hl2 latter. MSN wraiyth@gmail.com --Amckern 01:07, 21 Nov 2005 (PST)

[snip]

I was thinking that too...I put a constructor and deconstructor in the manager that prints warnings saying created and destroyed...I'll see if it's destroying it too soon then—ts2do (Talk | @) 19:19, 27 Nov 2005 (PST)

Ok...I made it so it creates the manager when it does the clientshared thing...haven't tried restarting the server and seeing if it's still intact yet tho...what I did b4 was made it when the clientdll initialized WHICH ISN"T GOODZ!—ts2do (Talk | @) 19:32, 27 Nov 2005 (PST)

Now it fails Assert( !"CreateNoSpawn: only works for CBaseEntities" );.

	server.dll!CBaseEntity::CreateNoSpawn(const char * szName=0x22a8b92c, const Vector & vecOrigin={...}, const QAngle & vecAngles={...}, CBaseEntity * pOwner=0x00000000)  Line 2451 + 0x69	C++
	server.dll!CBaseEntity::Create(const char * szName=0x22a8b92c, const Vector & vecOrigin={...}, const QAngle & vecAngles={...}, CBaseEntity * pOwner=0x00000000)  Line 2436 + 0x15	C++
	server.dll!CGameRules::CreateStandardEntities()  Line 552 + 0x16	C++
	server.dll!CHL2MPRules::CreateStandardEntities()  Line 183	C++
	server.dll!CWorld::Precache()  Line 605	C++
	server.dll!CWorld::Spawn()  Line 513	C++
	server.dll!DispatchSpawn(CBaseEntity * pEntity=0x0bd13400)  Line 1727	C++
	server.dll!MapEntity_ParseAllEntities(const char * pMapData=0x118cf1d8, IMapEntityFilter * pFilter=0x00000000, bool bActivateEntities=false)  Line 329 + 0xc	C++
	server.dll!CServerGameDLL::LevelInit_ParseAllEntities(const char * pMapEntities=0x118cf040)  Line 27 + 0xd	C++
	server.dll!CServerGameDLL::LevelInit(const char * pMapName=0x0de1fb10, const char * pMapEntities=0x118cf040, const char * pOldLevel=0x00000000, const char * pLandmarkName=0x00000000, bool loadGame=false, bool background=false)  Line 700	C++
	szName		"bullet_manager"				const char *
	vecOrigin	{x=0.00000000 y=0.00000000 z=0.00000000 }	const Vector &
	vecAngles	{x=0.00000000 y=0.00000000 z=0.00000000 }	const QAngle &
	pOwner		0x00000000 					CBaseEntity *

Maven (talk) 20:10, 27 Nov 2005 (PST)

well I did LINK_ENTITY_TO_CLASS...do you have that?—ts2do (Talk | @) 20:30, 27 Nov 2005 (PST)

Oops. Yes, I did miss that. —Maven (talk) 07:29, 28 Nov 2005 (PST)

I solved it not thinking on the client...but now it's giving me an assert when SetNextClientThink( TICK_NEVER_THINK ); in RemoveBullet is done—ts2do (Talk | @) 20:53, 27 Nov 2005 (PST)

Do you mean Assert( GetClientHandle() != INVALID_CLIENTENTITY_HANDLE ); in C_BaseEntity::SetNextClientThink? —Maven (talk) 08:59, 28 Nov 2005 (PST)

ok it did crash on restart...what's also notable is the fact that there's a slight difference between the serverside and clientside direction vectors (normal)—ts2do (Talk | @) 23:38, 27 Nov 2005 (PST)

I'm currently failing the if ( !m_ThinkEntries.IsInList( (unsigned long)hThink ) ) line in CClientThinkList::PerformThinkFunctions(). It fires the assert in CUtlLinkedList<T,I>::Previous with i==42, m_TotalElements==43, and unknown contents of m_Memory[i]. If I rerun it I get different values of i, but it's always one less than m_TotalElements. This might be related to the SetNextClientThink( TICK_NEVER_THINK ); problem you mentioned. —Maven (talk) 08:59, 28 Nov 2005 (PST)

Did you catch my edit? in clientmode_shared.cpp

	HOOK_MESSAGE( Bullet );
	if(!g_pBulletManager)
	{
		g_pBulletManager = (C_BulletManager *)CreateEntityByName("bullet_manager");
		ClientEntityList().AddNonNetworkableEntity(g_pBulletManager);
	}

ts2do (Talk | @) 16:26, 28 Nov 2005 (PST)