Forum Thread
  Posts  
DOOM 3 Modding Question: Setting A Custom Head For Mars City and Modifying Monster Behavior For The Dig (Forums : PC Gaming : DOOM 3 Modding Question: Setting A Custom Head For Mars City and Modifying Monster Behavior For The Dig) Locked
Thread Options
Mar 29 2016 Anchor

I'm wondering if anyone knows a way to change the head that is loaded for the player on mars_city1 as I would like to give the doomguy back his helmet and it's basically finished except for this map which is before he gets his equipment. Changing the head for the player affects all maps, but mars_city1 uses a different unarmored marine body so I'm wondering if I could also set a custom head for this map?

Also, I've disabled burnaway/removal of dead monsters, which is fine until you get to the final battle with the cyberdemon. Somewhere there is scripting that spawns 4 demons (imps/maggots) and then will only spawn more to replace those demons as they are removed by the game, so my change makes the battle impossible as the soul cube is needed to kill the cyberdemon and you can't charge the soul cube if the game is refusing to load more monsters in. I'm wondering if anyone knows where this behavior is set at so it can be modified.

fva
fva
Mar 31 2016 Anchor

Regarding the head issue, search for "model marscity_head_player" in "def\map_marscity.def". I believe that you will find your way from there. You can also look for all occurrences of "head_player" in "def\heads.def" and "def\player.def".

About the spawning issue, search for "spawner" in "maps\game\hellhole.map". There are 4 occurrences there, each related to an entity that spawns an imp or a maggot. A brief explanation of "spawner" can be found (in comments) in "def\monster_default.def". The code that actually drives the spawners seems to be the function "state_Spawner" in "script\ai_monster_base.script" (there is another "state_Spawner" in "script\ai_character.script", but I think this one does not apply to your case).

Edited by: fva

Mar 31 2016 Anchor

The map_*.def files are definitions for special events in those maps such as the cinematics and npc models and heads, correct?

The marine is already set with the regular head_player in all of the cinematics for mars_city1 and that's why he is shown without helment in cinematics as I want. The issue is the mesh used for when you are in control of the player, as head_player is set to use head_player_helmet which is what I want with the exception of this map. What I'm curious on is to know how to change the head from the in-game player model in just a single map (mars_city1.) The rest of the game is all set with cinematics using the helmet and the player mesh using the helmet. I just need to know how to change the non-cinematic player mesh head for mars_city1. I think I wrote the initial post badly and it resulted in a miscommunication on what I'm trying to do.

Alright, changed spawner behavior so that part is done. Thanks for helping me solve half the puzzle so far.

Edited by: deuxsonic

fva
fva
Mar 31 2016 Anchor

Got it, you want a different head just for mars city 1. Unfortunately, there seems to be no way to do it using only scripting. You will probably have to modify the game dll to accomplish this task.

Mar 31 2016 Anchor

The SDK builds the game DLL, correct? What would need changed?

Mar 31 2016 Anchor

you mean like this?

--

Go play some Quake 2: q2server.fuzzylogicinc.com
It's like Source v0.9, only... better!
Play Paintball for Doom 3!: d3server.fuzzylogicinc.com
Doom 3 Paintball to the Max!

Mar 31 2016 Anchor

Yes, that is exactly what I'm trying to fix. For every other map in the game, having def_head set to head_player_helmet is not a problem. For mars_city1 though, he doesn't have his gear yet so it is the one exception to this I need. It's frustrating because it feels like such a tiny change and yet there is seemingly nowhere to make an exception for this map, to tell the game to use his head for just that map instead of the helmet. Now I'm hearing it will likely require a change to the game itself, and although I can build the game's DLL from the SDK, I have no clue what to modify in the game's code to get the result that I want.

Edited by: deuxsonic

Apr 1 2016 Anchor

I just replaced the entitydef player_doommarine's "def_head" with "head_marine_helmet." Maybe "head_player_helmet" is difference?

--

Go play some Quake 2: q2server.fuzzylogicinc.com
It's like Source v0.9, only... better!
Play Paintball for Doom 3!: d3server.fuzzylogicinc.com
Doom 3 Paintball to the Max!

Apr 1 2016 Anchor

Yes, I've changed the head, but I need an exception for mars_city1.

Apr 1 2016 Anchor

Oh, I read it that you wanted it in mars_city1.

Yup, doesn't look like the code allows you to specify the head except by the player. Looks like you can change the skin though. So, a possible solution: put both head models in the same .md5mesh/anim files & use a skin to hide the one you don't want.

--

Go play some Quake 2: q2server.fuzzylogicinc.com
It's like Source v0.9, only... better!
Play Paintball for Doom 3!: d3server.fuzzylogicinc.com
Doom 3 Paintball to the Max!

fva
fva
Apr 1 2016 Anchor

So, a possible solution: put both head models in the same .md5mesh/anim files & use a skin to hide the one you don't want.

This is a good idea. If you manage to do it, you will not need to modify any native code.

The SDK builds the game DLL, correct? What would need changed?

Yes, you can use the SDK code to build the game dll. Or you can go open source instead, and use the "Doom 3 GPL source release" (here) or one of its forks (like dhewm3). If you choose the open source route, I think that you will also need to include the doom 3 engine (the one that you will compile) along with your mod (this should solve any licensing concerns). People will then run your mod using the included engine.

As for what needs to be changed, I think that the simplest solution is to modify the function "idActor::SetupHead" in "neo\game\Actor.cpp". For instance, the line

headModel = spawnArgs.GetString( "def_head", "" );

can be replaced by

if (!gameLocal.isMultiplayer
	&& strcmp(gameLocal.GetLevelMap()->GetName(), "maps/game/mars_city1") == 0
	&& strcmp(name.c_str(), "player1") == 0 ) {
	headModel = "head_player";
} else {
	headModel = spawnArgs.GetString("def_head", "");
}

This ensures that "head_player" will be used in mars city 1. In all other maps, the model specified via "def_head" in "def\player.def" will be used.

Edited by: fva

Apr 1 2016 Anchor

All he'd need to do is use the SDK (game) part of the GPL code. The SDK game dll code included with the GPL code works with the retail D3 edition when compiled.

--

Go play some Quake 2: q2server.fuzzylogicinc.com
It's like Source v0.9, only... better!
Play Paintball for Doom 3!: d3server.fuzzylogicinc.com
Doom 3 Paintball to the Max!

Apr 1 2016 Anchor

Inserted code into the SDK and it works. Initially it didn't seem to work but I found the game was overwriting the new copy of the DLL.

I did think of going the skin route, but I couldn't get it to work via skins. Then again I'm in above my head on this.

Thanks so much for your help you guys. I knew there had to be someone out there who still knew all of this well enough to help, but I didn't know if I was going to get in touch with them.

Edited by: deuxsonic

Apr 2 2016 Anchor

The game takes whatever dll/so is in the game##.pk4 & overwrites whatever is in the game folder, so put the dll in a pk4 and you're all set.

--

Go play some Quake 2: q2server.fuzzylogicinc.com
It's like Source v0.9, only... better!
Play Paintball for Doom 3!: d3server.fuzzylogicinc.com
Doom 3 Paintball to the Max!

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.