Quick (Easy) coding question Created 17 years ago2007-08-19 21:59:16 UTC by aaron_da_killa aaron_da_killa

Created 17 years ago2007-08-19 21:59:16 UTC by aaron_da_killa aaron_da_killa

Posted 17 years ago2007-08-19 21:59:16 UTC Post #232455
This is really going to sound n00by. How to I compile the source files into say "hl.dll"? I have 2.3 source sdk and I'm just experminting with the code and I cant figure out how to compile into a simple file. I know how to use my compiler ........ I think I am adding the wrong files or something.

Gold Source is in c++ right? Not MSVB?
Posted 17 years ago2007-08-19 22:08:20 UTC Post #232456
First, what compiler are you using. You really need to use Microsoft Visual C++ 6 as it will compile the dsp project files into a dll. Use of any other program, I cannot help you. With MSVC++6 open the dsp file and click build.
Posted 17 years ago2007-08-19 22:12:40 UTC Post #232457
dsp? Dont you have to compile the *.cpp and *.h files? Anyway my compiler is called C++BuilderX (Name of desktop shortcut) I think its a normal c++ compiler, I got with a c++ book.

Does anyone know ehere I can get a cheap (small download size) MSVC++6 Compiler?
Posted 17 years ago2007-08-19 22:24:28 UTC Post #232458
Email muzzleflash. And no, the dsp is a project file. It links the individual .cpp and .h files into one group and compiles the lot and any external files that compiling the code files cannot reach. Example, cl_dll code all some files from the dll code and vice versa.
Posted 17 years ago2007-08-19 22:31:51 UTC Post #232460
Ahh I see, thankyou hl hotdog ( I lol'd at the name). Thats where I went wrong.

Are these dsp files inculded in the source?
Posted 17 years ago2007-08-19 22:38:29 UTC Post #232461
They should be. Because valve used MSVC++ 6 to make HL and they are located with the code files. And yes, hlife_hotdog is a bit funny but my real nickname is hotdog so I added the hlife 'cause I love mapping for (duh) HL :biggrin:
Posted 17 years ago2007-08-19 22:40:08 UTC Post #232462
Lol. So when I get a compiler what do I do to compile the thing into a dll. How do I use the dsp?
Posted 17 years ago2007-08-19 23:55:11 UTC Post #232468
OMG I can not find a Microsoft Visual Basic 6 Compiler anywhere!!!!!
Posted 17 years ago2007-08-20 01:26:31 UTC Post #232472
Does anyone else find it hilarious that he asked if HL's code was Visual Basic?
Penguinboy PenguinboyHaha, I died again!
Posted 17 years ago2007-08-20 02:49:41 UTC Post #232474
cough bittorrent cough
Posted 17 years ago2007-08-20 05:53:59 UTC Post #232479
Ahem. Keep illegal discussions out of the forums please, there are more private ways to discuss it.
Strider StriderTuned to a dead channel.
Posted 17 years ago2007-08-20 07:41:55 UTC Post #232482
Gold Source is in c++ right? Not MSVB?
OMG I can not find a Microsoft Visual Basic 6 Compiler anywhere!!!!!
HAHAHAHA! Oh wow!

Yes Penguinboy, very. Heheh...
Posted 17 years ago2007-08-20 16:47:34 UTC Post #232499
Well I was reading coding for half-life before and they mentioned MSVC++6. It Kinda sucks how it is in that language and not in normal c++.

Anyways I found a compiler and gonna test it today after school. Its only 70 megs so thats awesome for me.

Whats this bittoernt stuff that you guys are all giggling about?
Posted 17 years ago2007-08-20 17:26:09 UTC Post #232503
hlife_hotdog said:
Email muzzleflash.
I think you missed that little part, aaron. Because you would allready be coding if you didn't. ;)
Posted 17 years ago2007-08-20 18:06:36 UTC Post #232509
Dude, it IS written in c++, MSVC is not a different language.
Posted 17 years ago2007-08-21 02:41:56 UTC Post #232523
No, c++ is a cool language, Microsoft Visual ++ 6 is microsofts modified version of the code, or so I hear.
Posted 17 years ago2007-08-21 02:51:23 UTC Post #232524
no. It's a program. A GUI for coding. that's it.
C++ is the language. Microsoft Visual C++ is a program which makes coding easier.

BitTorrent is a peer-to-peer method of obtaining less than legal files(mostly) and people, myself included, are not giggling at that, we're giggling at the fact you thought HL was coded in VB.
Archie ArchieGoodbye Moonmen
Posted 17 years ago2007-08-21 04:02:06 UTC Post #232526
No, c++ is a cool language, Microsoft Visual ++ 6 is microsofts modified version of the code, or so I hear.
Somebody didn't read their Wiki. ;)
Posted 17 years ago2007-08-21 04:42:00 UTC Post #232528
yeah, everybody shutup. i agree.
personally, i'd use Visual Studio 6, which is called an IDE for C++, for HL1, because thats what valve used, thats what the project in the SDK opens in iirc.
use Visual Studio 2003 for HL2, for the same reason as above.
for any other C++ applications, get Code::Blocks and GCC MingW32 compiler.

and finally, stop asking about this. if you dont know these basic things, you obviously dont have the brain capacity to code. don't just jump into half-life's source with no experience.
Penguinboy PenguinboyHaha, I died again!
Posted 17 years ago2007-08-22 03:54:39 UTC Post #232585
I didn't realise that there where tutorials on coding. I've tried a tut to add a weapon but failed. I'm getting 2 errors:

C:Documents and SettingsAaronDesktopCodecl_dllev_hldm.cpp(254) : error C2065: 'M16_FIRE1' : undeclared identifier
C:Documents and SettingsAaronDesktopCodecl_dllev_hldm.cpp(300) : error C2065: 'BULLET_PLAYER_M16' : undeclared identifier

Does anybody know how to fix?
Posted 17 years ago2007-08-22 08:00:40 UTC Post #232589
You need edit some more files, not just your m16 cpp file.
Posted 17 years ago2007-08-23 02:19:48 UTC Post #232656
I followed the tut, did exactly what it told me to. Mabye its because I have the 2.3 sdk and it was a tut using 2.2 sdk.

Here is the tut: http://collective.valve-erc.com/index.php?doc=1026504803-74538300

I was hopeing that mabye someone like muzzleflash could follow the tut using the 2.3 sdk and tell me what is wrong and how to fix it. It doesn't take me long. I finished the tut in 10 minutes with my low level of experence.
Posted 17 years ago2007-08-23 04:00:45 UTC Post #232658
Uhh. You really need to read the introduction! This tut assumes you have already followed the previous tutorials. There is a link at the start you need to click to go to FIRST AND did you realise this is a Tour of Duty mod tutorial?

By the way, check out this sniper rifle scope I coded (i'm quite proud of it seeing as i'm a noob at coding:

http://hlifehotdog.googlepages.com/scifipic4.jpg
Posted 17 years ago2007-08-23 14:53:17 UTC Post #232693
Google, people! There's a million sites that introduce you to the basics!
Even our links page has links to a couple of the best ones.
Daubster DaubsterVault Dweller
Posted 17 years ago2007-08-23 14:53:58 UTC Post #232694
Posted 17 years ago2007-08-25 11:06:49 UTC Post #232852
Make sure you modify all necessary files, your error is a result of this. When creating a weapon you need to add code to ev_hldm.cpp, evhldm.h, hl_events.cpp, hl_weapons.cpp and those are on the client side.

On the server side you also need to look at weapons.cpp and weapons.h and this is also where you need your example.cpp.

Finally make sure the client shares your example.cpp by just adding the file to the client. The last thing I think is the event file. Just copy and modify one from another weapon. Those are located in your mods files and if it's not then just create a folder called events and copy some other weapon from any mod and then edit the file.

Well I'm not writing a tutorial here so I better stop haha. Hope I could help.
Posted 17 years ago2007-08-25 18:16:38 UTC Post #232878
What exactly does "undeclared identifier" mean? How do I decear it and could someone give me a short example os somthing being declared?

Thanks Jess that helps a bit, thanks caboose that is a good website/
Posted 17 years ago2007-08-25 18:23:43 UTC Post #232879
Usually it means you're referencing a variable that doesn't exist.
Posted 17 years ago2007-08-25 18:28:39 UTC Post #232881
I thought it was the other way around. I'm missing a referance. Hmmm thats interesting.
You must be logged in to post a response.