Source SDK

Source SDK

ArctixSnowPup Nov 14, 2023 @ 12:39pm
[SOLVED] Attempted to create unknown entity type
I have tried to create a new weapon for my very simple mod. I wanted to learn how to code. I have a freshly generated solution from the SDK 2013 GitHub, and using VS 2013. I copied the weapon_pistol.cpp file and renamed every "pistol" to "glock", making sure that every letter is properly capitalized.

I also added the line
"STUB_WEAPON_CLASS(weapon_glock, WeaponGlock, C_BaseHLCombatWeapon);
to c_weapon_stubs_hl2.cpp

I talked in several Discord servers already, and nothing has changed since I started trying a few days ago.

I also made sure I have the weapon_glock.txt file in the mod's scripts folder. When in game, I type
give weapon_glock

I get this error. I don't know what I am doing wrong. I googled around with forums and YouTube. I am no where closer.
Last edited by ArctixSnowPup; Nov 14, 2023 @ 1:04pm
< >
Showing 1-5 of 5 comments
xdshot Nov 14, 2023 @ 12:42pm 
somehow the new dll is not loaded
ArctixSnowPup Nov 14, 2023 @ 12:44pm 
Originally posted by xdshot:
somehow the new dll is not loaded
I made sure it is by copying the new compiled dll to the mod folder. Both server.dll and client.dll I know it works because when I change the fov code to something else, the clamps are changed and I can increase it to ridiculous levels since that's what I coded it to do.
ArctixSnowPup Nov 14, 2023 @ 12:51pm 
How would I make sure that the new cpp is added to the build? I think that may be why.
ArctixSnowPup Nov 14, 2023 @ 1:03pm 
I needed to add the new cpp to the solution where weapon_pistol was. Why did no one tell me about this.
Lychy Nov 15, 2023 @ 7:48am 
Originally posted by ArctixSnowPup:
I needed to add the new cpp to the solution where weapon_pistol was. Why did no one tell me about this.
https://developer.valvesoftware.com/wiki/Authoring_a_Logical_Entity
Its literally on the first coding tutorial on VDC
< >
Showing 1-5 of 5 comments
Per page: 1530 50