News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

How to compile Doom 3 source

Started by Mr A, August 12, 2014, 09:49:18 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Mr A

Can any of you guys help me with this? I'm a total noob when it comes to this and it seems a bit complicated from the sources I've found. 

So I'm guessing I need Visual Studio, but I've read some versions don't work and I may have to buy a version to compile it.  I've also read that I'll need the Direct X SDK from June 2010. 

So yeah I'm really clueless.  If anyone could make an idiots guide I would be most grateful =)

The Happy Friar

The stock D3 code needs MFC so it can compile the tools.  Here's a tutorial on how to do that with the non-pro version of Visual Studio: http://www.moddb.com/company/apgsoftware/tutorials/how-to-compile-doom-3-with-visual-studio-2010

With the latest version of Visual Studio, it's different because MS changed how the newest versions work with the DX SDK, MFC, etc.  I forgot if/what I did.

deadite4

Also, are you just making a mod for Doom 3 or compile the GPL code?  If just the SDK for a Doom 3 mod, you can do that with free tools.

motorsep

Quote from: deadite4 on August 13, 2014, 07:34:07 AM
Also, are you just making a mod for Doom 3 or compile the GPL code?  If just the SDK for a Doom 3 mod, you can do that with free tools.

MSVC is free ;)

Mr A

Quote from: The Happy Friar on August 13, 2014, 06:22:56 AM
The stock D3 code needs MFC so it can compile the tools.  Here's a tutorial on how to do that with the non-pro version of Visual Studio: http://www.moddb.com/company/apgsoftware/tutorials/how-to-compile-doom-3-with-visual-studio-2010

With the latest version of Visual Studio, it's different because MS changed how the newest versions work with the DX SDK, MFC, etc.  I forgot if/what I did.

Ha! I saw that tutorial before, and it confused me =S
I got to step four (4. Install the VC and the DXSDK) and I don't know what VC is.  I got the DXSDK but there's like two install things, and I get an error (I'll try again).

Quote from: deadite4 on August 13, 2014, 07:34:07 AM
Also, are you just making a mod for Doom 3 or compile the GPL code?  If just the SDK for a Doom 3 mod, you can do that with free tools.

Just a Doom 3 gameplay mod.  What extras could I do with the GPL code exactly? Would it be more difficult then an SDK mod?

The Happy Friar

SDK's easier to use (simpler project file setup).  The only legal difference is that with the SDK you can't sell that stuff (as compared to the GPL) and you're not required to give the code away if you distribute a dll (which is required if you use the gpl).

Mr A

Ah well I'm not interesting in making money, just people smile =)

I'm still not having much look on this...has anyone compiled the code themselves before?
Would someone do it for me if I sent them the code =? Heehe. 
All I'm trying to do is make NPCs and monsters leave a pool of blood when fragged. 

solarsplace

Hi

I have not tested this for a while, I think I did this once for bloody footprints or something like that, but you might be able achieve the same thing through scripting fairly quickly if that's easier for you?

Try this:

When the IA is killed spawn a "func_fx" (http://www.iddevnet.com/doom3/fx.php) at its origin.

The fx file will be setup to drop a large blood decal on the floor.

Try doing this from:

void monster_base::state_Killed() for Demons
void monster_zombie_base::state_Killed() for Zombies that override the event above.

sys.setSpawnArg( "fx", "fx/my_blood_decal_fx" );
sys.setSpawnArg( "origin", getOrigin() );
sys.setSpawnArg( "start", "1" );
sys.spawn( "func_fx" );

Hope that helps.

Cheers


Mr A

#8
I've wrote one, but don't I have to add it to compile it?
Oh wait...do I just add this code to the monster's .def files!?

I'm so silly haha, I thought I would have had to compiled the code.  Ok sound man, thanks a lot =)
Oh you don't know if I could modify the gibs effects without compiling the code do you?

solarsplace

Hi

Copy the following 2 files from the Doom 3 / pak000.pk4 file into your mod folder setup and this is where the edits are done. Edit the files using Notepad++ (http://notepad-plus-plus.org/) open file and select "Language C" or Context (http://idtechforums.fuzzylogicinc.com/index.php?topic=15.0)

$\pak000\script\ai_monster_base.script
$\pak000\script\ai_monster_zombie_base.script

Have a look in the same PK4 file in the FX folder for examples on how to create your own FX for the blood decals etc.

Can you be a bit more specific about what you want to do: "if I could modify the gibs effects"

The duration that the gibs stay in the world (4 seconds) will require SDK changes if you want to change that BTW.

Cheers

Mr A

Okay well I've been trying to get this blood spatting to work. I've been failing though haha. 

My FX code looks like:
fx fx/bloodpool
{
   
    {
      delay 0
      duration 36
      decal "textures/decals/dsplat2"
      size 120
   }     
}

I think that's okay.  But it refuses to paint the decal onto the floor. I tried adding a random particle effect to see if it was an error with the ai script, and the particle effect worked fine.  (Here's my ai script just for reference). 
void monster_zombie_security_pistol::state_Killed() {
stopMove();

startFx("fx/bloodpool");

animState( ANIMCHANNEL_TORSO, "Torso_Death", 0 );
animState( ANIMCHANNEL_LEGS, "Legs_Death", 0 );

waitAction( "dead" );
stopThinking();
}


QuoteThe duration that the gibs stay in the world (4 seconds) will require SDK changes if you want to change that BTW.
Yeah that's what I want to change, haha.  I'm also interested in trying to create different gib styles dependent on the weapon the monster is fragged with e.g. large chunks of meat for explosive frags, skeletons for plasma/bfg frags. 

Is there no way to override or replace the gib effect other then modding the SDK?

Also I still haven't figured out how to compile the SDK, the tutorials I've found are too techy for a noob like me. Like what even does "Install the VC" mean?

BloodRayne

Quote from: Mr A on October 21, 2014, 09:41:40 AM
Is there no way to override or replace the gib effect other then modding the SDK?

Also I still haven't figured out how to compile the SDK, the tutorials I've found are too techy for a noob like me. Like what even does "Install the VC" mean?
Well there is, through scripting. You would need to hack the state_killed() events of each monster and call new 'gib' code there.
You could always keep a global variable in memory that remembers which gun the user is using so that upon state_killed in the monster you can add your effects, depending on the weapon selected. Of course, this method fails if the player quickly switches to different weapon types.

For instance: if the player lobs a grenade, then quickly switches to the pistol, the last used gun would be the pistol and the grenade would not throw the right effects.

The only 'clean' way of solving this is via the SDK.

motorsep

Quote from: BloodRayne on October 21, 2014, 09:55:30 AM
For instance: if the player lobs a grenade, then quickly switches to the pistol, the last used gun would be the pistol and the grenade would not throw the right effects.

What if you set a variable "lastGun" (or whatever) to grenade after you fire grenade, and then check for that variable? This way if player switches to pistol after tossing grenade, lastGun would still hold grenade, since pistol wasn't fired.

Or better yet can he check for a projectile instead of last used gun? (unless that's not exposed to script)

Mr A

I thought it would be something similar to how the game brings up weapon specific death messages in multiplayer?

solarsplace

Hi

I can't test this right now as @ work.

I think startFx is more geared towards binding a particle effect to a joint of an MD5 model. In your case you don't want to bind anything to the models joint.

Try spawning a separate func_fx entity like I showed you in the code a couple of posts up. That should work better I think.

Thanks