Afew source coding noob questions

Please don't post here unless its in response to an existing topic. New discussion is to be shared in the other forums.

Afew source coding noob questions

Postby madgernader » Tue Nov 28, 2006 1:30 pm

Sorry if these questions are so blatently obvious i should be ashamed for asking, but better to ask them then spend all day wondering what if...


Anyway to the questions, First off if you wanted to create a mod that had both a singleplayer and multiplayer componet do you use the create a mod from scratch, or could you modify the HL2 singleplayer (or multiplayer for that matter) to include the other componet aswell? My guess is you would have to build it from scratch, since the other ones give you stuff spefic to that type of mod...


Next, for learning Source sdk coding would you say its better to start with a single or multiplayer mod? I have limited knowedge of c++ and the likes, but i get jests of stuff, so id spend most of my time fiddling, my personal guess would be to go with multiplayer, since many of the things from sp could be done in multiplayer, and in mp you could eventuly move onto more network related things...


*My third question about the mod seeming to not use my .dlls Ive solved. I tried the my first mod tutorial, and changed the rocket speed, and it works, so my issue with the other ones is just me putting them in wrong, so that will be solved by myself, since its better to fix what you can yourself then rely on others :lol: *


Now for the compiling warnings, i know its not needed to fix them, but Id like too anyway so i know if i get a new warning from a code change without having to remember the number i had before...

Now that i think about it chances are these are all just compatibility type things with VS 05 so its not imparitive that they are solved, just would make me feel better.


1>client_hl2 - 0 error(s), 4 warning(s)

1>c:\program files\operation black mesa source code\src\cl_dll\hl2_hud\hud_autoaim.cpp(202) : warning C4189: 'dist' : local variable is initialized but not referenced

1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

1>tier2.lib(MaterialSystemUtil.obj) : warning LNK4204: 'c:\Program Files\Operation Black Mesa Source Code\src\cl_dll\Debug HL2\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info

1>tier2.lib(tier2.obj) : warning LNK4204: 'c:\Program Files\Operation Black Mesa Source Code\src\cl_dll\Debug HL2\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info


2>server_hl2 - 0 error(s), 5 warning(s)

2>choreoobjects.lib(choreoactor.obj) : warning LNK4204: 'c:\Program Files\Operation Black Mesa Source Code\src\dlls\Debug HL2\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info

2>choreoobjects.lib(choreochannel.obj) : warning LNK4204: 'c:\Program Files\Operation Black Mesa Source Code\src\dlls\Debug HL2\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info

2>choreoobjects.lib(choreoevent.obj) : warning LNK4204: 'c:\Program Files\Operation Black Mesa Source Code\src\dlls\Debug HL2\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info

2>choreoobjects.lib(choreoscene.obj) : warning LNK4204: 'c:\Program Files\Operation Black Mesa Source Code\src\dlls\Debug HL2\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info

2>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library



Line 202 of the hud_autoaim.cpp file is
Code: Select all
float dist = (pLocalPlayer->m_HL2Local.m_vecAutoAimPoint - pLocalPlayer->GetAbsOrigin()).Length();


All of the warnings except the autoaim one appeared after I installed the windows SDK, before that I had gotten alot of errors (all cannot find windows.h pretty much)

All the warnings were there before i changed anything, thats why im a bit stumped, If it happens after i add somthing, usually i can go find it, but here I dont know what to do, And yes i know that in actuality, there are only 3 uniqe warnings, but id have rather listed all files effected first time around then have to post again.

The mod file the code is from is a singleplayer mod.
madgernader
New Blood
 
Posts: 24
Joined: Tue Nov 28, 2006 12:55 pm
Location: United States

Postby Bob » Tue Nov 28, 2006 1:43 pm

the easier route to building a mod with both types is to build the mp version, because a single player game in HL2 is only not networked properly for multiplayer, so when you build the single player version you will have to network its code, while the multiplayer code is already finished. The Scratch is simply a stripped version of the code. the weapons and many other features have to be coded in.

It is easier to code for single player mods, since it doesn't require networking, but in all the coding techniques doesn't change much.

im not sure what you mean by the third problem

and as for your compile warnings, there are some extensive issues with MSVS and HL2 Source... its been an on going thing and it wasnt until recently that they rebuilt the app to work right. I wouldnt worry about warnings, as long as your game works you shoudl be fine.

this means that you have created a variable but you arent using it.
1>c:\program files\operation black mesa source code\src\cl_dll\hl2_hud\hud_autoaim.cpp(202) : warning C4189: 'dist' : local variable is initialized but not referenced
Bob
Site Admin
 
Posts: 252
Joined: Mon Nov 20, 2006 12:24 am
Location: San Jose California

Postby Seil » Wed Dec 06, 2006 5:06 pm

Personally I'd find myself a nice C++ reference website, like an ebook or something that you can use side by side of your work........ maybe even a real book if you wish to spend a good $50. It doesn't matter either way, just get a reliable reference you can use to debug syntax and operators and such.

then start with something you want to modify. make it somewhat small but yet challenging for yourself. google the crap out of Quake/Quake2/Quake3 source code in reference to functions that you don't understand. the source engine is still heavily built upon the original HL engine which spawned from Quake. So basically don't limit your searching to just HL2. vector manipulation functions and the likes, some of which are programmed in assembly and difficult to understand for someone like yourself can be easily understood from some simple docs that pertain to the Quake engines. just make sure the function name is the same and it takes the same arguments.

One of the most important things you can do, is research how the game engines work. find a plain-english explanation of how 3d game engines work in terms of how the network engine connects the client and server, when is and what calls the rendering engine, the input processor, etc...... all these different parts work together very FAST in a game. that is, you'd be surprised how much code is called EVERY frame and you're seeing the game run at 125+ frames/second on your pc.........

understanding the concepts of how all these parts work together will allow you to determine where you'll find whatever it is you'll want to modify to achieve the results desired.

if you understand that, then the next tip is that, no matter what you want to do, it's already been done in the code at least once. Which means all you need is the code that exists to tell you how to do anything else you can imagine. :D

keep up the hacking, you'll get it man ;)
Seil
 

Postby Bob » Wed Dec 06, 2006 10:06 pm

I would like to stress the "keep up the hacking," part of that. The most important thing that you can do if you are interested in anything is to keep doing it even when you have fallen off of your horse. Just keep your eye on the prize and you will be able to break through anything.
Bob
Site Admin
 
Posts: 252
Joined: Mon Nov 20, 2006 12:24 am
Location: San Jose California

Postby madgernader » Sun Dec 17, 2006 9:54 pm

Well, As you said if I wanted to create a single and multiplayer mod, I could use the MP code, but would I also need to code in a lot of parts so that it works correctly, like take the steps needed for co-op, or is everything needed already setup apart from npc's in a multiplayer server?
madgernader
New Blood
 
Posts: 24
Joined: Tue Nov 28, 2006 12:55 pm
Location: United States

Postby Bob » Mon Dec 18, 2006 1:00 pm

You should look at the SDK as a stripped down RX7 that you were given and trying to get it to look like a show room car. The SDK comes with damn near nothing that works right. Most everything is coded badly and the inheritance is just fucking irritating at times. I dont even expect the NPCs to be working right.

in other words, you have to code everything!
Bob
Site Admin
 
Posts: 252
Joined: Mon Nov 20, 2006 12:24 am
Location: San Jose California


Return to Unsorted Old Posts

Who is online

Users browsing this forum: No registered users and 1 guest

cron