• Source 2007 Mod: Attempt at implementing bullsquid
    22 replies, posted
I have almost understanding of programing language, but I thought it a good idea to attempt to make a source mod. I want to impiment the bullsquid code that is already in the source engine, so I: Moved the "npc_bullsquid.cpp" and "npc_bullsquid.h" to where the rest of the npc_ files are located in the server/hl dll folder. Uncommented all instances of "CLASS_BULLSQUID" in the "hl2_gamrules.cpp". When I try to compile, I get an error in every code line where "CLASS_BULLSQUID" is located in the "hl2_gamerules.cpp" that says: [code]error C2065: 'CLASS_BULLSQUID' : undeclared identifier[/code] How can I fix this? In layman's terms if possible?
Uncomment all instances of CLASS_BULLSQUID in all .h files. If there isn't CLASS_BULLSQUID, find the place where the classifications are declared and add one by yourself. Make sure it doesn't collide with other classifications, or you'll have combine bullsquids attacking rebels.
All .h files in both the client and server sides of the project? Or just the server project where the npcs are located? And does anybody know what header file(s) might contain said classifications? I havn't much luck personally, an example of code that declares classifications would help.
Run a find operation across all files for "CLASS_BULLSQUID". It'll get you started.
I did a search and it only came up with what was in the "hl2_gamerules.cpp" that has to do with npc relations.
Look for "enum Class_T" on baseentity.h, uncomment CLASS_BULLSQUID.
Sweet, it worked! Thank you Gran PC!
Also don't forget to add relations between CLASS_BULLSQUID and other CLASS_es, or nobody will care about bullsquid and bullsquid won't care about anybody.
That was the first thing I found, but thank you for the reminder.
what in the hell is a bullsquid?
[QUOTE=Duskling;39721769]what in the hell is a bullsquid?[/QUOTE] [url]http://combineoverwiki.net/wiki/Bullsquid[/url]
[QUOTE=Simspelaaja;39725254][url]http://combineoverwiki.net/wiki/Bullsquid[/url][/QUOTE] Jesus.
I'm also trying to add the houndeye aswell, and I THINK I have it working. Unfortunately, I can't get the client to compile, the "energy_wave.cpp" has an error. The compile log looks like this: [code] 2>------ Build started: Project: Client Episodic, Configuration: Debug Win32 ------ 2> energy_wave.cpp 2>d:\conscriptedmod\src\game\server\energy_wave.cpp(252): error C2039: 'GetDynamicMesh' : is not a member of 'IMaterialSystem' 2> d:\conscriptedmod\src\public\materialsystem\imaterialsystem.h(535) : see declaration of 'IMaterialSystem' 2>d:\conscriptedmod\src\game\server\energy_wave.cpp(321): error C2039: 'GetDynamicMesh' : is not a member of 'IMaterialSystem' 2> d:\conscriptedmod\src\public\materialsystem\imaterialsystem.h(535) : see declaration of 'IMaterialSystem' [/code] I tried removing the lines in question from the energy_wave.cpp, but that only creates more errors in other files. I assume I have to add some lines to the imaterialsystem.h, but I have no clue what I'm doing. Does anyone know how to fix this?
Can you post the lines that are causing the error please?
line 252 of [url=http://hlssmod.net/he_code/game/client/hl2/c_energy_wave.cpp]energy_wave.cpp[/url] [code] IMesh* pMesh = materials->GetDynamicMesh( true, NULL, NULL, m_pWireframe ); [/code] line 535 of [url=http://hlssmod.net/he_code/public/materialsystem/imaterialsystem.h]imaterialsystem.h[/url] [code] abstract_class IMaterialSystem : public IAppSystem [/code]
From what I can tell, "GetDynamicMesh" seems to be a member of the IMatRenderContext class, while 'materials' is a pointer to an instance of IMaterialSystem. I think what you want to try is changing your code to this: [cpp]IMesh* pMesh = materials->GetRenderContext()->GetDynamicMesh(true, NULL, NULL, m_pWireframe);[/cpp] I'm not 100% sure, though, so sorry if that doesn't help at all.
Thank you, it worked, the file compiled. Unfortunately the houndeye doesn't quite work ingame, but I'll monkey around with it.
Glad to hear you got it working, be sure to post your progress in the 'What are you working on?' thread!
I got the bullsquid almost working in-game. The problem other people seem to run into is the bullsquid won't spit, but if you decompile the model and add a mouth attachment, the bullsquid will actually spit. Unfortunately, the spit is the antlion worker's spit, but with the modification of a few values, you have working bullsquid spit at the cost of the antlion worker's spit (unless you make a seperate file for the spit, which I have yet to do). The only non-working part of the code is where the bullsquid tries to kill headcrabs, it just can't hit them for some reason. [editline]2nd March 2013[/editline] Does anyone happen to know where CGrenadeSpit is defined?
server/hl2/grenade_spit.h
I found my error, I forgot to include my modifed "grenade_spit.h" in the "npc_bullsquid.cpp." I also changed a few values I shouldn't have, and I finally figured out that the red line is there to tell me I have an error.
So I tried making a copy of the "grenade_spit" .cpp and .h files, renaming them, and modifying the name values, but now my bullsquid's spit just sorta floats where it makes it. This is the error I get in the log: [code] vector.h (1064) : Assertion Failed: IsFinite(b) dt_send.cpp (200) : Assertion Failed: v.IsValid() npc_bullsquid thinking for 1470.42ms!!! (SCHED_RANGE_ATTACK1); r0.45 (c0.18, pst0.00, ms0.26), p-r1469.91, m0.01 dt_send.cpp (200) : Assertion Failed: v.IsValid() [/code] I don't recall messing with any vector's in the grenade_spit.cpp (which is where I assume the problem is at). I KNOW I didn't mess with the vector.h or dt_send.cpps (I assume they're just for debugging errors). What are the possible lines of code I might've messed up that would cause the spit to just float where it spawns? Here's relevant (I think) "grenade_spit.cpp" code that I've modified. [code] -removed-[/code]
Well I gave up on making an independent spit.cpp for the bullsquid, I'm just going to sacrifice the antlion worker instead. Unfortunately, I found another error, the bullsquid can't hurt other npcs, it does a tailwhip attack animation but doesn't do any damage. I also get the error "Unhandled animation event AE_NPC_BODYDROP_HEAVY for npc_bullsquid" Any clue about where to um, handle? the animation event? Or a way to disable the tailwhip completely?
Sorry, you need to Log In to post a reply to this thread.