there could be a few things wrong. i haven't delved deeply into weapons coding yet, so i can't immediately give you a good answer. here's a great tutorial that should give you some guidance: http://collective.valve-erc.com/index.php?doc=1026171711-73606300
barret ----- Original Message ----- From: "Bodek" <[EMAIL PROTECTED]> To: "HLCODERS LIST" <[EMAIL PROTECTED]> Sent: Monday, December 23, 2002 6:35 PM Subject: [hlcoders] Adding new weapons, ammo, engine crashing > Hi! > > I'm new here and I have problems with adding new weapons. First od all I > will try to explain what I do in sdk (I'm sure everything I done properly). > But every time I'm picking up the weapon (my or orginal weapon (like > shotgun) engine crashes with annoying windows message 'Program run bad > code...' (I'm not sure it's equivalent to english message, because I'm from > Poland and I'm using polish version of MS Windows, but I'm think you know > what I mean) or sometimes when weapon were picked up and I'm trying to > shoot(any weapon), game crashes again with this same windows message. > 1. New weapon based on MP5 source code (a little changed code), also is a > new ammo > 2. Weapon and ammo was precached with > UTIL_PrecacheOtherWeapon(),UTIL_PrecacheOther() in weapons.cpp > 3. In cl_dlls/hl/hl_weapons.cpp I'm added: new variable based on my new > weapon class: > > CTripmine g_Tripmine; > CSqueak g_Snark; > CMinigun g_Minigun; //my weapon > > 4. HUD_PrepEntity( &g_Minigun, &player); > 5. HUD_WeaponsPostThink() - in this function I'm added a piece of code like > this: > > case WEAPON_MINIGUN: > pWeapon = &g_Minigun; > break; > > 6. I'm also added some code into ev_hldm.cpp file (function like EV_FireMP5) > 7. in hl\hl_events.cpp added gEngfuncs.pfnHookEvent( "events/minigun.sc", > EV_FireMinigun ); > > Also I added some code in other files, but just cvars for new ammo. > What's wrong ? > > I'm sorry if I asking of thing which might be asked and solved in past but I > didn't viewed all the archive of this list. > > with respect for real programmers > > Bodek > > > > ***************r-e-k-l-a-m-a************** > > Masz dosc placenia prowizji bankowi ? > mBank - zaloz konto > http://epieniadze.onet.pl/mbank > _______________________________________________ > 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

