Help with GoldSrc Engine Created 11 years ago2013-04-28 22:21:01 UTC by zenaro147 zenaro147

Created 11 years ago2013-04-28 22:21:01 UTC by zenaro147 zenaro147

Posted 11 years ago2013-04-28 22:21:01 UTC Post #313376
Hi,
I wonder if someone could teach me, or has a tutorial to create new weapons in GoldSrc Engine (v2.3)

I followed this tutorial http://web.archive.org/web/20070815212753/http://collective.valve-erc.com/index.php?doc=1026171711-73606300 , but don't work.

I tried to "copy" existing weapons without error when compiling. But in the game, closes himself when you get the gun.Also wanted to know how to add a weapon in the FGD to use in the Hammer Editor, because i had copied the original weapon, i copied the information in FGD default.

Thanks.
Posted 11 years ago2013-04-28 23:59:38 UTC Post #313377
For getting it to appear in the FGD, just copy the entry for an existing weapon and change the entity's name. If you copied the entry for the 9mm handgun, change weapon_9mmhandgun to weapon_[name]. If you're using Hammer 3.5 and an FGD that supports models in-editor, be sure to change the model file to the new weapon's one as well.

As for code itself, I have no experience with that, but there are people here who have some. Try PM'ing 2muchvideogames, he knows his way around code. You'll have to check in once in a while, though, as I haven't seen him around the last little bit.
Notewell NotewellGIASFELFEBREHBER
Posted 11 years ago2013-04-29 09:52:42 UTC Post #313381
Well, at least the FGD, I did the right thing.

I will try to create a copy of an original gun again.
Thanks for the PM, I sent him.
Posted 11 years ago2013-04-29 14:08:48 UTC Post #313385
I tried again to copy an original weapon, I could not again...
Posted 11 years ago2013-04-29 17:11:08 UTC Post #313387
That tutorial should work! Make sure you change the fgd according to the classname in the code. The engine links your code with an entry in the fgd here

LINK_ENTITY_TO_CLASS( weapon_m16, CM16 );
LINK_ENTITY_TO_CLASS( ammo_m16, CM16AmmoClip );

so the fgd entry has to be called weapon_m16 if you just copied code from the tutorial
ChickenFist ChickenFist<Witty Title>
Posted 11 years ago2013-04-29 18:40:07 UTC Post #313388
From what I saw, the tutorial is for version 2.2 ... I'm using 2.3.
I did not actually try follow this tutorial in version 2.2

In my case, only works for mp.dll
Already in Client.dll am with the following error when compiling:

hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CM249::WeaponIdle(void)" (?WeaponIdle@CM249@@UAEXXZ)
hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CM249::Reload(void)" (?Reload@CM249@@UAEXXZ)
hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CM249::PrimaryAttack(void)" (?PrimaryAttack@CM249@@UAEXXZ)
hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CM249::Deploy(void)" (?Deploy@CM249@@UAEHXZ)
hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CM249::GetItemInfo(struct ItemInfo *)" (?GetItemInfo@CM249@@UAEHPAUItemInfo@@@Z)
hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CM249::AddToPlayer(class CBasePlayer *)" (?AddToPlayer@CM249@@UAEHPAVCBasePlayer@@@Z)
hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CM249::Precache(void)" (?Precache@CM249@@UAEXXZ)
hl_weapons.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CM249::Spawn(void)" (?Spawn@CM249@@UAEXXZ)

In the case of FDG, I think I understood how to do.
Posted 11 years ago2013-04-30 11:32:41 UTC Post #313393
I managed to compile the DLLs. But now, to get the gun, an error occurs and the game closes.
From what I saw, the munitions function normally.
User posted image
Posted 11 years ago2013-04-30 13:36:15 UTC Post #313394
I don't want sound like a noob, but what to use to decompile goldsrc?
Posted 11 years ago2013-04-30 13:43:05 UTC Post #313395
Posted 11 years ago2013-04-30 16:04:36 UTC Post #313396
and how to compile it? or is the compiler included?
Posted 11 years ago2013-04-30 16:18:14 UTC Post #313397
to compile, you need a compiler. it is not included.

You can use compilers like "Borland C++ Compiler" or "Microsoft Visual C++ 6"
Posted 11 years ago2013-04-30 17:04:58 UTC Post #313399
The original projects that let you compile the .dlls were written in Visual Studio 6, but using that nowadays is very impractical on any OS beyond Win XP.

You can convert the projects to any newer version of Visual Studio - it will just take some effort to fix up the various semantic issues in the old code for it to work with the newer compilers. That may be tricky if you're new to C++ though, in which case I'd probably try & set up VC6 somehow like zenaro suggested.
Daubster DaubsterVault Dweller
Posted 11 years ago2013-04-30 18:33:09 UTC Post #313400
thanks, i am running xp and I will try Visual Studio 6
Posted 11 years ago2013-04-30 22:14:19 UTC Post #313401
finally managed to compile "correctly" DLLs.
But now the model does not appear
(I swear I do not know what I did, I'll try to see it later and create a tutorial, maybe)
User posted image
I want to take and ask: Anyone know invert the hand of a model with anims(left >> Right)? or create a cvar like "cl_righthand"?
You must be logged in to post a response.