Having Problems Programming New Mod

Grab your favourite IDE and tinker with the innards of game engines

Having Problems Programming New Mod

Postby uNCLEsAM098 on Mon May 21, 2012 3:03 pm

Hello there. Sorry if I'm posting in the wrong area, I didn't see an area better suited for Mod Help.

I also have done numerous searches on Google and here, and I very well could have missed what I'm looking for, but I have yet to find a solution to my problem.

I am attempting to get my feet wet at programming a mod, and currently am working with an Ep 2 build.

https://developer.valvesoftware.com/wiki/My_First_Mod

I have attempted to follow the above directions many, many times. I am using Visual Studio 2010, and did my best to follow the directions guided for both 2008 and 2010 versions, as instructed.

The problem comes to when I attempt to fix the Debug Compilation, as instructed https://developer.valvesoftware.com/wiki/Compiling_under_VS2008#Fix_debug_compilation. As soon as I either add or replace the last section with 'libcmtd', the whole compiler goes crazy. The 'error LNK2001' does not go away, and jumps from having 90-some errors, to over 8,000.

This whole thing is rather frustrating trying to set up, and I'm pulling my hair out trying to fix this. I've been giving this half-hearted attempts many times over quite a few years, and as soon as I hit this brick wall, I just quit trying altogether. This time, I want to see it through.

If anyone could please give me some desperately needed guidance, I would appreciate it.
uNCLEsAM098
Regular
Regular
 
Joined: Thu Oct 18, 2007 6:30 pm

Re: Having Problems Programming New Mod

Postby zombie@computer on Mon May 21, 2012 4:14 pm

did you do a full rebuild ('rebuild solution' instead of 'build solution')? What are the errors you getting then?
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Having Problems Programming New Mod

Postby Gary on Mon May 21, 2012 5:00 pm

uNCLEsAM098 wrote:Hello there. Sorry if I'm posting in the wrong area, I didn't see an area better suited for Mod Help.


There is a programming subform: viewforum.php?f=25

Moved.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Having Problems Programming New Mod

Postby uNCLEsAM098 on Mon May 21, 2012 5:38 pm

Well, you won't believe this, but the problem lied within that I didn't use 'exactly' the line provided (libc;libcd;libcmtd). Once I changed that (trying things desperately), the problems went away. I dunno why, I had those three portions plus more... Anyway.

Another problem came up. I installed Steam within a custom folder inside my D drive (I've always done this), but now it turns out that there's a problem with that location.

Because I did not have Steam installed in the Program Files (x86) location, I'm having issues here:
https://developer.valvesoftware.com/wik ... mmand_line

Is there some simpler form of doing this? I feel like I'm constantly hitting every error known to man. There's got to be something simple I'm screwing up.

------------------------------

A second question. I saw another thread that seems to have a similar problem: viewtopic.php?f=25&t=36004

According to that thread, running Visual Studio 2010 is a problem. Is that true? Is 2005 the best to run for this? Is this why I'm having so many problems?

------------------------------

Gary wrote:
uNCLEsAM098 wrote:Hello there. Sorry if I'm posting in the wrong area, I didn't see an area better suited for Mod Help.


There is a programming subform: viewforum.php?f=25

Moved.


Thank you, sorry about that.
uNCLEsAM098
Regular
Regular
 
Joined: Thu Oct 18, 2007 6:30 pm

Re: Having Problems Programming New Mod

Postby zombie@computer on Mon May 21, 2012 7:17 pm

uNCLEsAM098 wrote:Well, you won't believe this, but the problem lied within that I didn't use 'exactly' the line provided (libc;libcd;libcmtd). Once I changed that (trying things desperately), the problems went away. I dunno why, I had those three portions plus more... Anyway.


Is there some simpler form of doing this? I feel like I'm constantly hitting every error known to man. There's got to be something simple I'm screwing up.
Well, in all honesty, if you have problems to follow tutorials to the letter (I didn't use 'exactly' the line provided (libc;libcd;libcmtd)) then yeah, programming is gonna be nearly impossible for you.

uNCLEsAM098 wrote:Another problem came up. I installed Steam within a custom folder inside my D drive (I've always done this), but now it turns out that there's a problem with that location.

Because I did not have Steam installed in the Program Files (x86) location, I'm having issues here:
https://developer.valvesoftware.com/wik ... mmand_line
Can you be any vaguer? What is the issue? Please dont tell me you dont know how to change directories in a link.

uNCLEsAM098 wrote:------------------------------

A second question. I saw another thread that seems to have a similar problem: viewtopic.php?f=25&t=36004

According to that thread, running Visual Studio 2010 is a problem. Is that true? Is 2005 the best to run for this? Is this why I'm having so many problems?

------------------------------
the sdk was written in 2005, most likely because when hl2 was made visual studio 2010 didn't exist. And yeah, compiling in 2005 probably enables you to run the code straight from the box, but 2008 and 2010 work fine as long as you follow the tutorials to fix the code.
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Having Problems Programming New Mod

Postby uNCLEsAM098 on Mon May 21, 2012 7:33 pm

zombie@computer wrote:
uNCLEsAM098 wrote:Well, you won't believe this, but the problem lied within that I didn't use 'exactly' the line provided (libc;libcd;libcmtd). Once I changed that (trying things desperately), the problems went away. I dunno why, I had those three portions plus more... Anyway.


Is there some simpler form of doing this? I feel like I'm constantly hitting every error known to man. There's got to be something simple I'm screwing up.
Well, in all honesty, if you have problems to follow tutorials to the letter (I didn't use 'exactly' the line provided (libc;libcd;libcmtd)) then yeah, programming is gonna be nearly impossible for you.


I'm still new to programming, but the difference was that I didn't replace, I added, as was implied. It was just a simple mistake.

zombie@computer wrote:
uNCLEsAM098 wrote:Another problem came up. I installed Steam within a custom folder inside my D drive (I've always done this), but now it turns out that there's a problem with that location.

Because I did not have Steam installed in the Program Files (x86) location, I'm having issues here:
https://developer.valvesoftware.com/wik ... mmand_line
Can you be any vaguer? What is the issue? Please dont tell me you dont know how to change directories in a link.


I did change the location, and properly changed it dependent on the location of my test modification. I'm not sure what else I'm missing, but if there's any information I can give to clarify the issue, let me know and I'll post it.

I do appreciate the help, and hope you can help me see this basic intro through, but please don't be slam me for misunderstanding.

:)

--EDIT--

Hopefully this helps.

Image
uNCLEsAM098
Regular
Regular
 
Joined: Thu Oct 18, 2007 6:30 pm

Re: Having Problems Programming New Mod

Postby zombie@computer on Mon May 21, 2012 9:00 pm

uNCLEsAM098 wrote:I did change the location, and properly changed it dependent on the location of my test modification. I'm not sure what else I'm missing, but if there's any information I can give to clarify the issue, let me know and I'll post it.

For starters, it would be helpful if you'd provide any info about 'what is wrong'. Do you get errors? Messages? Does your pc jump out the window? Nothing happens? etc.

The info looks okay, though iirc you need to start the sourcesdk base 2007/hl2.exe (the wiki mentiones another hl2.exe i see, perhaps i recalled incorrectly. still, worth a shot)
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Having Problems Programming New Mod

Postby uNCLEsAM098 on Tue May 22, 2012 4:50 am

I have attempted the Episode 2 HL2.exe file, as well as the Source SDK Base 2007 HL2.exe files in the spot shown from the picture above, and each time I try compiling, this error shows. (I will search the tutorial to see which version it recommends after this post)

Image

However, something different happened this time, running from the Base 2007 .exe like you recommended. The normal Ep2 HL2.exe file would not load the game, but Base 2007 HL2.exe actually ran. I had the purple and black checkerboard background since no maps were available, but it loaded. I used GCFScape to put an Episode 2 map in the folder and ran it, but it froze on loading just over halfway through.

I alt tabbed out, to find this error again as well:

Image

I've had this error before, and checked out the wiki on it. I changed the Product Dependencies, checking off the box within Client Episodic as stated, and attempted to run again.

I feel like I'm so close... If I can just get a map to load, maybe I can actually test that basic RPG speed...

-------------------------
EDIT
-------------------------

I attempted to run the mod from steam rather than the compiled version, and oddly the EP2 version tried running, where it did not load the main menu from before. But, I alt-tabbed out, and saw a new error message:

Image

This is odd, as it was the EP2 background trying to be loaded, and then 'reverted' to the Valve intro logo to display that error.

I also recall the wiki telling me in certain areas to change to Debug, so I wonder what that is the problem?
uNCLEsAM098
Regular
Regular
 
Joined: Thu Oct 18, 2007 6:30 pm

Re: Having Problems Programming New Mod

Postby Gary on Tue May 22, 2012 3:39 pm

Right click the mod in steam, goto advanced options and add -allowdebug to the command line.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Having Problems Programming New Mod

Postby uNCLEsAM098 on Tue May 22, 2012 3:54 pm

Gary wrote:Right click the mod in steam, goto advanced options and add -allowdebug to the command line.


Thanks for the response!

I did that, and attempted to run the mod from Steam. It crashed shortly after showing the Valve Logo.

I followed up by attempting to run a compiled build, which showed a blurry HL2 (original) background, but switched over to the same purple/black checkerboard background. Attempted to run a map from console, but it did not even attempt to load the map this time.

Then went back into Visual Studio, and switched from SDK Base 2007 to SDK Base. I compiled, but strangely, two things happened (or more specifically, didn't happen)... It didn't give me an error about HL2.exe, and it didn't run the game. It simply said "Build Completed".

Thinking/hoping this was good news, I attempted to run the mod from within Steam, but only got to the Valve intro screen and crashed.

How come it seems that what I'm running from within Steam and what is being compiled, are two different versions?
uNCLEsAM098
Regular
Regular
 
Joined: Thu Oct 18, 2007 6:30 pm

Re: Having Problems Programming New Mod

Postby Gary on Tue May 22, 2012 4:22 pm

You need to change the AppId found in your gameinfo.txt. I'm mobile, so I can't look to see which one I use... Hopefully someone here with a mod could post the Id number.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Having Problems Programming New Mod

Postby uNCLEsAM098 on Tue May 22, 2012 5:50 pm

HA... Oh man!

Ok, so I changed that value a couple times, and stupidly realized I needed to quit out of Steam for it to properly work.

With the value changed to 218, I reloaded Steam, and attempted to run the mod again. The Debug Mode worked, and still had problems loading the map I pulled from Episode Two (froze upon loading), so I said screw it and made an empty box with a player start.

Compiled and ran, and was surprised to see the map loaded perfectly!

Ran SV_Cheats 1 and Impulse 101 to pull up the RPG with modified rocket speed as My First Mod instructed.

Everything was running fine until I fired the RPG, but then the game froze. I alt-tabbed out to quit, but saw a very unique box:

Image

At least this told me my code was trying to be run as soon as I attempted to fire a rocket. For whatever reason, I clicked "Ignore This Assert", and heard my rocket fire!

I tabbed back in, and saw my rocket firing ridiculously slow, which is exactly what I wanted to see :D

Thank you all so much, and now I'm going to get a bit better feel for this before I try something bigger!

Whew... what a problem this all was!
uNCLEsAM098
Regular
Regular
 
Joined: Thu Oct 18, 2007 6:30 pm

Re: Having Problems Programming New Mod

Postby stoopdapoop on Tue May 22, 2012 7:15 pm

nice work.

I would reccomend compiling release builds over debug builds though. They're faster and almost as easily debugged.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Having Problems Programming New Mod

Postby Gary on Tue May 22, 2012 10:00 pm

Asserts are always going to happen in debug. I recommend running the mod in windowed mode.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Having Problems Programming New Mod

Postby uNCLEsAM098 on Wed May 23, 2012 3:24 am

stoopdapoop wrote:nice work.

I would reccomend compiling release builds over debug builds though. They're faster and almost as easily debugged.


I've read that in another post.

Is there a post or link you could point me to that would best explain how to do that? Not that I won't be looking anyway!

Gary wrote:Asserts are always going to happen in debug. I recommend running the mod in windowed mode.


I was wondering/worrying about that. Thanks for the tip!
uNCLEsAM098
Regular
Regular
 
Joined: Thu Oct 18, 2007 6:30 pm
Next

Return to Programming

Who is online

Users browsing this forum: No registered users