Adding new entities to FGD? Created 10 years ago2014-02-01 22:45:56 UTC by DinkyDonk DinkyDonk

Created 10 years ago2014-02-01 22:45:56 UTC by DinkyDonk DinkyDonk

Posted 10 years ago2014-02-01 22:45:56 UTC Post #317714
I wanted to find a way to add the Barney Zombie enemy and
Soldier Zombie enemy into my mod without having to just use the Opposing
Force FGD. So I made a copy of my HL FGD and after looking through both it
and the other, I found that adding the following lines made it work:

@PointClass base(Monster, Sequence) size(-16 -16 0, 16 16 72) studio("models/zombie_barney.mdl") = monster_zombie_barney : "Barney Zombie" []

@PointClass base(Monster, Sequence) size(-16 -16 0, 16 16 72) studio("models/zombie_soldier.mdl") = monster_zombie_soldier : "Soldier Zombie" []

@PointClass base(RenderFields,Appearflags, Angles) size(-16 -16 0, 16 16 72) studio("models/zombie_soldier.mdl") = monster_zombie_soldier_dead : "Dead Soldier Zombie"
[
pose(Choices) : "Pose" : 0 =
[
    0 : "On back"
    1 : "On stomach"
]
]
I also added the .mdls and sound files into my mod's directory. Sound files
because I also tried to put Otis into my mod as well.

With these in the FGD, I can now place these monsters into my map and can
view their models in Hammer, too. They seem to work fine. I can edit their
properties and everything. But obviously there's some other step that I'm
missing because they do not show up at all when I play the map. They're
there in Hammer, but they seem to just dissapear in-game.

Am I getting ahead of myself? I don't yet know how to completely edit
.mdl's (if that's necassary) or FGD's. But it seems like what I'm doing
is working as far as actually getting things to show up in Hammer.
Posted 10 years ago2014-02-02 00:40:42 UTC Post #317715
Short answer: You are getting ahead of yourself when it comes to adding NPCs.

Long answer:

The data in the FGD is seperate from the game's code. Just because there's a reference to the entity in the FGD doesn't mean it's coded into the game, and just because it's coded into the game doesn't necessarily mean it's referenced in the FGD. To introduce new code into the game will require at least a rudimentary knowledge of C++ and analysis of the existing code. We have a few tutorials here that can help you along your way for that.

So, to get monster_zombie_barney and monster_zombie_grunt into your maps, you'll need to do one of three things, all of which require making your map and/or mappack into a full mod:
1) Use the Op4 DLL files, which will include code for all Op4 entities. Use of Op4 is needed, extra code is not possible.
2) Use the HL SDK code to make your own mod DLL that includes copies of monster_zombie using the desired models/sounds/etc. Coding is needed.
3) Use Spirit of Half-Life, (Backup/download links courtesy of our own Penguinboy) and then use regular monster_zombies with the model field set to the desired models. Coding is optional, but possible.
Notewell NotewellGIASFELFEBREHBER
Posted 10 years ago2014-02-02 02:20:53 UTC Post #317717
Woah. There's a lot more to it than I thought.
I'll still give it a try though. At least I know where to start.

C++, though.. Which version of that am I going to need? Or does it not matter? Because somebody said to me a long time ago that I would need version 6 or something for this but that doesn't work on Windows 7.
Posted 10 years ago2014-02-02 04:14:13 UTC Post #317718
I can't recall what version of C++ IDE or compiler you'd need to work with HL - I've never programmed for the engine. I'm sure there's a knowledgeable individual around here somewhere who will pop in soon.
Until then, I'd personally recommend going with one of Sprit's mod skeletons, since the code is already compiled - it gives you a lot more options as a mapper in addition to the new monster options, like having entities moving with other ones - such as having breakable glass in an openable door.
Notewell NotewellGIASFELFEBREHBER
Posted 10 years ago2014-02-02 11:11:20 UTC Post #317721
recently i managed to compile it, the visual 6 can be found somewhere in snarkpit (does work on w7), and the setup tut somewhere in wavelength, with the help of the internet archive you can find quite a few coding tuts for hl1
Posted 10 years ago2014-02-02 15:47:13 UTC Post #317725
Ive compiled HL on vs2008 with some editing to make it work, but nothing much.
rufee rufeeSledge fanboy
Posted 10 years ago2014-02-17 06:19:31 UTC Post #317984
I managed to find an equivalent (or so It's been called) to Visual Studio called Code::Blocks. I also have the Half-Life SDK installed, and i looked at the C++ files and whatnot and got the basic idea of how these things are supposed to work.

After looking around online for hours for tutorials on basic coding, I can't find anything at all. I don't know why. Is there anything I can be linked to to learn how to make even the most basic edits, like changing the color of the HUD?
Posted 10 years ago2014-02-17 09:45:48 UTC Post #317986
There's a tutorial for HUD color right here on twhl
http://twhl.info/tutorial.php?id=80

There is also a lot of coding tutorials at the (now dead) site thewavelength.
http://articles.thewavelength.net/section/7/
ChickenFist ChickenFist<Witty Title>
Posted 10 years ago2014-02-17 09:50:57 UTC Post #317987
i would like to add "fog" in outside areas to give this look of large map
Posted 10 years ago2014-02-17 11:52:27 UTC Post #317989
Thanks for the links, CF. Those will help!
However in the HUD coloring tutorial you linked, I'm stuck on something. The tutorial says "Now, open up the header file, cl_util.h.". I'm not sure what he means by "header". I know what a header is, but does he mean for me to open a folder titled "header"? And I can't seem to find anything titled "cl_util".
Forgive my noobness.

Ninja Defuse, there's a thread already going on about creating fog here: http://twhl.info/forums.php?thread=18523
Posted 10 years ago2014-02-17 12:20:10 UTC Post #317990
Headers (.h, .hpp) and sources (.c, .cpp) are split up into virtual folders that the IDE creates, look in the solution explorer its not hard to find.
I don't think Code::Blocks will compile HL SDK because it uses the MinGW compiler instead of the Visual Studio one, you can link to an external compiler in CB if you want to.
There are free Visual Studio versions labelled "express" which should work fine with the HL SDK code, i wouldn't go over the 2008 (vs9 ?) version since i don't think it will compile on later ones, 2012 will not work.
rufee rufeeSledge fanboy
Posted 10 years ago2014-02-17 12:59:37 UTC Post #317991
I must be the single stupidest individual on the planet because clearly I'm missing something that's right in front of my face.
I just installed and registered Visual Studio Express 2008 and I'm in CL_DLL, and I still have no idea where CL_UTIL.H is. I tried adding a new .h file with the same name in the "headers" folder and it said that file with that name already exists, but I don't see it.

wat do
Posted 10 years ago2014-02-17 13:14:26 UTC Post #317992
Look in the "External dependencies" folder, that's where it appears for me.
Penguinboy PenguinboyHaha, I died again!
Posted 10 years ago2014-02-17 13:20:49 UTC Post #317993
I don't see any folder with that name nor would I know where to look.
Posted 10 years ago2014-02-17 14:18:27 UTC Post #317994
Search your computer for a file with that name. In 2.3 SDK a couple of files were for some reasons not added in the msvs solution, but they are there in the dirs.
ChickenFist ChickenFist<Witty Title>
Posted 10 years ago2014-02-17 14:20:34 UTC Post #317995
Saw that you already found the file. In msvs, right click cl_dlls folder/tree. Click add file to solution. Browse to the file. Voila.
ChickenFist ChickenFist<Witty Title>
Posted 10 years ago2014-02-17 15:23:39 UTC Post #317996
Ah! There it is.
Thank you. Again. Hopefully the rest will go swimmingly.
Scratch that, there's something else I'm not understanding.
The tutorial also says to replace the CL_DLL in the Valve folder after building the project. I've built the project (although it's saying "0 succeeded, 1 errors" or something but it seems to work anyway) But there is no file actually called CL_DLL that I can replace as far as I know. Only a "client" and "hl". Which do I replace with what file? :u
Posted 10 years ago2014-02-17 17:07:32 UTC Post #317997
You'll only have a file if the build succeeds. Check what the error is.
ChickenFist ChickenFist<Witty Title>
Posted 10 years ago2014-02-17 23:24:40 UTC Post #317998
This is what it says:
1>BSCMAKE: error BK1506 : cannot open file '.Debugmenu.sbr': No such file or directory
1>Build log was saved at "file://c:sierraHalf-LifeSDKSingle-Player Sourcecl_dllDebugBuildLog.htm"
1>cl_dll - 274 error(s), 258 warning(s)
Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
Posted 10 years ago2014-02-22 11:33:43 UTC Post #318053
You have 247 errors. They probably result from using a too new version of MSVC.
ChickenFist ChickenFist<Witty Title>
Posted 10 years ago2014-02-22 12:58:07 UTC Post #318059
Those are fixable and pretty simple, all you need to do is add the correct namespace in front of every method, there are only a few more different issues.
Read the error it will tell you what to do.
rufee rufeeSledge fanboy
You must be logged in to post a response.