Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Thu May 23, 2013 1:14 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: changing the player skin dynamically
PostPosted: Mon Jan 23, 2006 8:35 am 
Offline
picked up 200 ammo

Joined: Sun Jan 30, 2005 10:59 am
Posts: 278
This is the solution of a previous question asked in the scripting forum. The solution used SDK modification, so I thought it might be useful to post it in this forum as well. The basic idea is, to change the player's skin while a map is running - a feature which for me turned out much more complicated as I thought.

I added a new variable in player.h:

after 'const idDeclSkin * powerUpSkin;' I added:

const idDeclSkin * headSkin;

set it to NULL in player.cpp:

after 'powerUpSkin = NULL;' I added:

headSkin = NULL;

In player.cpp, I changed two occurences of

headRenderEnt->customSkin = NULL;

into

headRenderEnt->customSkin = headSkin;

I added code to select the skin:


Code:
if(skinselected=="default") {

skin = declManager->FindSkin("skins/characters/player/d3xp_sp");
SetSkin( skin );
renderEntity.shaderParms[6] = 0.0f;
headSkin =declManager->FindSkin("skins/characters/player/normalhead");
headRenderEnt = head.GetEntity()->GetRenderEntity();
headRenderEnt->customSkin = headSkin;
}
                                 
if(skinselected=="ninja") {

skin = declManager->FindSkin( "skins/characters/player/ninja" );
SetSkin( skin );
renderEntity.shaderParms[6] = 0.0f;
headSkin = declManager->FindSkin( "skins/characters/player/ninjahead" );
headRenderEnt = head.GetEntity()->GetRenderEntity();
headRenderEnt->customSkin = headSkin;
}


Specifically, I added this code into a script event, which I then control from the map script and voila, the skin can be changed dynamically while the map is running.

Before that I tried various alternative routes including the use of shaderparms - all without success. Changing the playerskin was easy but in order to change the headskin as well, it was important to disable the default reset of the head's skin (due to the possibility that an influence might act on the skin). I think that monsters do not have this default reset and might be easier to cope with.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 27, 2006 7:53 am 
Offline
picked up 100 armour
User avatar

Joined: Sat Feb 18, 2006 10:54 pm
Posts: 124
Location: Virginia, USA
I was working on something like this for a while.

What I wanted to do was when you equip the soulcube in D3, have the players arms and hands turn ancient and dead like when you equip the bloodstone in RoE.

What worked:
put the dead arm textures in my mod in a folder that is pointed to by a material file I named deadarm.MTR. I copied the normal 'arm2' stuff (where it tells the game where the normal arm textures are located)from player.MTR into my deadarm.MTR then just renamed everything deadarm_d, deadarm_local, deadarm_s (local, diffuse, & shaders)

then, in the view_soulcube.MESH i changed the shader from arm2 to deadarm.

So now when i equip the soul cube my hands look dead.


I would really love to have his fingers wrigling when he has the soulcube equiped- exactly like his fingers move in RoE with the ancient bloodstone equiped, but I'd probably just crash the game 100 times trying to do it, and still fail, so for now Im not messing with that.

Hellborg:
I noticed in your mod you have the 'spell" anmiation where his fingers wrigling. Thats what I'm trying to do, but only If i can have the soulcube there idling as well. hell, the 'fire' bloodstone animation looks exactly like the 'fire' soulcube animation (looks like he is pushing his hands out) so that seems like it would be perfect.

Do you think thats easily possible?

By the way, you couldn't you also counter the influence by renaming a copy of the playerhead_d.tga deadhead_d.tga?

or even better
tell the player.MTR to use the regular playerhead.tga even when dead?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 28, 2006 9:30 am 
Offline
picked up 200 ammo

Joined: Sun Jan 30, 2005 10:59 am
Posts: 278
concerning the spell animations in the DungeonDoom mod: For this I just used the heart artifact animations and added a nodraw material to the artifact itself. Was pretty straightforward - but I am not sure, how easy it would be to add the soulcube. You probably would need to redo all the animations if you exchage the artifact and soulcube models, but you might just want to give it a quick try?

Concerning the influence stuff, I don't think that simply replacing a texture would do the trick. The problem was, that the skin was basically updated constantly in the original SDK code.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group