forums | blogs | polls | tutorials | downloads | rules | help

Skins

Hi!

Okay, I used to do a little modding with DS:LOA, but now that I finally got BW and wanted to do something similar, I realized that a lot had changed.
For example, that the skin of the character (hands, arms, body in case of the HGs) apart from the face are now also part of the armor!
That's when I understood, why there aren't any skin mods for DS2 out there.
Now, with BW they added Stone Form, which practically replaces every texture of the character. And I thought, dude, that's how you need to do it yourself.
So basically, what I want to do is to add an effect script, that changes the texture of the character at startup (WE_ENTERED_WORLD) and, if necessary, after dying, too (WE_KILLED).
But I can't really figure these new effect scripts out!

I looked at the way effects are handled by other actors, such as the shard soul.

[efct_emitter] { effect = shard_soul_tail; }

But adding this one to the one of the heroes doesn't do anything. It SHOULD create some effects around his/her pelvis area, but nothing happens!

In DS1 I had to put the conditions in with the character information.
But now, they seem to be a part of the effect themselves?!

The following is part of the stone form power skrit.
I figured I deleted all the unnecessary stuff (such as change of footsteps and texturerestoring (cause I don't want the texture to be restored), so what is left is this:

[efct_quicksilver]
{
skrit=[[

property string quick_texture$ = "b_w_shd_001-a" doc = "Texture to swap to while power active.";

Goid catalyst$;
float renderScale$;
FFXID glowFX$;
bool texturechanged$;
//my string textureColl$;

#include "k_inc_collection_utils"

startup state Go$
{

catalyst$ = msg$.GetSendFrom();

// set scale
renderScale$ = catalyst$.Go.Aspect.GetRenderScaleMultiplier();
catalyst$.Go.Aspect.SetRenderScaleMultiplier( renderScale$ * 1.25 );

// set step emitter parameters
//catalyst$.Go.SetComponentString( "step_emitter", "step_sound_left", "s_mn_rac_valdis_mve1" );
//catalyst$.Go.SetComponentString( "step_emitter", "step_sound_right", "s_mn_rac_valdis_mve2" );

//Collect all the characters with in the radius
//if ( IsServerLocal )
//{
// setallwithpower$();
//}
// run effect
//WorldFXMgr.CreateFlickFX( "ffx_generic_single?EffectScript=efct_power_ds2x_stone_form_cast", catalyst$, true, true );

Aspect asp$ = catalyst$.Go.Aspect.GetAspectHandle();

// change child mesh textures
int num_children$ = asp$.GetNumberOfChildren();
int num_textures$;
int i$, j$ = 0;
my string tempString$ = "";
while ( i$ < num_children$ )
{
num_textures$ = asp$.GetChild( i$ ).GetNumSubTextures();
j$ = 0;
while ( j$ < num_textures$ )
{
asp$.GetChild( i$ ).PushTexture( j$ );
asp$.GetChild( i$ ).SetTextureFromTextureName( j$, quick_texture$ );

j$ += 1;
}

i$ += 1;
}

// now do main mesh textures
num_textures$ = asp$.GetNumSubTextures();
i$ = 0;
while ( i$ < num_textures$ )
{
asp$.PushTexture( i$ );
asp$.SetTextureFromTextureName( i$, quick_texture$ );

i$ += 1;
}

texturechanged$ = true;

//this.CreateTimer( 1, time$ );
}

// safety check to set glowFX to 0 in the case it ends for some odd reason
// if we did not do this, we would generate errors when we tried to run FinishFlickFX
// later in the skript
//if ( e$ == WE_FLICKFX_SYNC_END )
//{
// if ( msg$.GetData1() == glowFX$ )
// {
// glowFX$ = 0;
// }
//}
}


}

Now, as I said before, I don't really get all this new stuff. In DS1 all you had to do, was to create an effect and attach it to a bone or an invisible orbiter or some such. But here...
Well, what I get is, that (since shoulder pads and stuff are not part of the main mesh as in DS1) you have to retexture both child and main meshes. But apart from deleting and "//" a whole lot of stuff and changing the name of both texture and texture variable, I didn't do too much.

So, maybe I deleted something that was important. But I myself think, that I need to change something with the conditions. But I don't know how to use the efct_emitters or where to place conditions like WE_ENTERED_WORLD now, in DS2. Therefore, if nobody finds anything wrong with the text above, maybe you can tell me how to get the conditions right.

Greetings,
Heathen.

Somehow the forum cut the lower half of my writing...
Hu. Whenever there it the "smaller than"-sign, it cuts off!
-----------------------------------------------------------

"smaller than" num_children$ )
			{
				num_textures$ = asp$.GetChild( i$ ).GetNumSubTextures();
				j$ = 0;
				while ( j$ "smaller than" num_textures$ )
				{
					asp$.GetChild( i$ ).PushTexture( j$ );
					asp$.GetChild( i$ ).SetTextureFromTextureName( j$, quick_texture$ );

					j$ += 1;
				}

				i$ += 1;
			}
			
			// now do main mesh textures
			num_textures$ = asp$.GetNumSubTextures();
			i$ = 0;
			while ( i$ "smaller than" num_textures$ )
			{
				asp$.PushTexture( i$ );
				asp$.SetTextureFromTextureName( i$, quick_texture$ );

				i$ += 1;
			}

			texturechanged$ = true;

			//this.CreateTimer( 1, time$ );
		}

		// safety check to set glowFX to 0 in the case it ends for some odd reason
		// if we did not do this, we would generate errors when we tried to run FinishFlickFX
		// later in the skript
		//if ( e$ == WE_FLICKFX_SYNC_END )
		//{
		//	if ( msg$.GetData1() == glowFX$ )
		//	{
		//		glowFX$ = 0;
		//	}
		//}
	}

	
}

Now, as I said before, I don't really get all this new stuff. In DS1 all you had to do, was to create an effect and attach it to a bone or an invisible orbiter or some such. But here...
Well, what I get is, that (since shoulder pads and stuff are not part of the main mesh as in DS1) you have to retexture both child and main meshes. But apart from deleting and "//" a whole lot of stuff and changing the name of both texture and texture variable, I didn't do too much.

So, maybe I deleted something that was important. But I myself think, that I need to change something with the conditions. But I don't know how to use the efct_emitters or where to place conditions like WE_ENTERED_WORLD now, in DS2. Therefore, if nobody finds anything wrong with the text above, maybe you can tell me how to get the conditions right.

Greetings,
Heathen.

EDIT: By the way, if you need me to post the whole stone form script, just say so.

Hi and welcome Heathen. Since the forums parse html there will be problems with using < and >. Try using their entity numbers instead i.e. &#60 and &#60 with an ";" at the end. They can be found here: http://www.w3schools.com/tags/ref_ascii.aspinstead

I am slowly getting into messing with DS2 skins myself so I hope someone can shed some light on your question. ^^

@Heathen: It's not clear under what circumstance you want to exchange textures.
If you want to do it from the beginning only for a special actor you could insert your code into a component (like 'hide_object_mesh_const.skrit' - of course to modify) and append that component to your actor's template.
Of course the restriction is evident, it only will work for template containing that component.

For texture exchangement caused by a spell you could put your code into the skrit component of a/your spell (most spells have on, so rather easy to find a template/example).

For texture exchangement cause by a hit of weapon it should be possible to execute any skrit code if the link/reference on that code is include in enchanments:magic of the weapon. (That won't be really flexible and may become tricky, indeed i'm not really familar with this but i guess all weapons/projectiles will receive we_collided event).

For any other texture exchangement it seems to me you would need any controlling/triggered object able to receive events and able to 'catch' the actor, this object would apply then the textrue replacement itself or by starting an effect that does it on the desired actor.



Side note: I'm not sure how you do your testings but it's very probable that commands like 'PushTexture' or 'SetRenderScaleMultiplier' are not supported in v2.2 and v2.3/Mod (which is rather a v2.2+) and that the addon/BW version v2.3 knows (many) more commands. So assumed these commands are unsuppored in v2.2 and v2.3/Mod then they will cause a skrit error preventing the rest of your code from being executed (supposed it will be compiled at all).

Hi!

Yes, that's it: I want to change my main character, in this case the halfgiant, to look like rock all the time. From the beginning of the game. And I don't mind that his weapon and everything will look like rock, too.

Unfortunately, I couldn't find the skrit file you wrote about. I looked through the whole logic.ds2res.

My problem is, that I don't really know how to connect the skrit to the template. I know how to put effect scripts from DS1 into the templates, such as the ice warrior's icy sparkle. And as far as I know, this has changed pretty much with DS2.

As for the testing, well... I tried it with the main program itself. Changes to the skin worked perfectly that way (like facial textures), but that is insufficient, because armors include part of the characters skin now, especially the hands.
That's why, instead of changing just the skins of the character, I am now trying to change the texture of the character as a whole, including armor and everything.
I even tried changing the skins of the armors at first. But I realzied, that the child meshes (like the shoulder pads) are not changed along with them. And if I change them too, seperately, I am afraid that almost every character in the whole game (including NPCs) will partially look like rock.

EDIT: Oh, and does anybody know, why the test with the shard soul's effect didn't work?

[t:template,n:hero_halfgiant]
{
	doc = "halfgiant_npc";
	specializes = base_hero_halfgiant;
	[actor]
	{
		is_hero=true;
		screen_class = "Mercenary";
	}
	[aspect]
	{
		model = m_c_gah_amr_suit_hg_a1;
		[textures]
		{
			0 = b_c_gah_hg_skin_01_21_npc;
			1 = b_c_gah_amr_suit_hg_a1_011_21;
		}
	}
	[inventory]
	{
        custom_head = m_c_gah_amr_hlmt_hg_head-01;
		[equipment]
		{
			es_chest = amr_bdy_merc;
			es_feet = amr_bot_merc;
            es_spellbook = book_glb_magic_01;
            es_weapon_hand 	=  dg_1h_tutorial;
		}

        [pcontent]
        {
			[gold*]  //JMC_GOLD_PENDING
			{
				chance = 1.0;
				max = 100;
				min = 100;
			}
        }
		[other]
		{
			il_spell_1 = spell_ice_tutorial;
			il_spell_2 = spell_fire_tutorial;
			il_main = bw_sh_tutorial;
		}
	}
	[mark_of_the_prisoner] {}
	[efct_emitter] { effect	= shard_soul_tail; }

}

I mean, in DS1 you could simply add the effect script to the template as well. And the engine is still the same, right? So why is there no effect at all?
How DO you add an effect in DS2, if not by using these effect emitters?
What I'm saying is, even if the whole texture-change thingy is crap, the shard soul effect should still be working!

Heathen wrote:

...
My problem is, that I don't really know how to connect the skrit to the template.
...

The solution is probably so close, you don't even see it. Wink

mark_of_the_prisoner.skrit (already used in your template) would be a good example how to do this.


Heathen wrote:
... How DO you add an effect in DS2, if not by using these effect emitters? ...
Well one way is to do it by the follwing row form inside of a custom skrit component:
FFXID effect$ = WorldFXMgr.SCreateFlickFX( effect_name$, actor_goid$ );	
So check once all skrits for 'WorldFXMgr.SCreateFlickFX' to find a pleasant example component, but don't be surprised there are more than one possibility to set up the parrameters for that command. Again, mark_of_the_prisoner.skrit would be a good example.

However before you waste time looking for these things you probably should put up your mind about some general things.

Me at least i'm not really sure on what eg. child texture 0 refers to, is this the helmet (if equipped) or is it the face skin (independing if a helmet is equpped or not). As far as i remember the freezing effect of original DS2 (or the petrifying effect of the addon) only will be applied on monsters that normally don't have any equipement/armors.
So situatively exachanging the hole surface of an equippable actor may become much harder i guess... Sad

Hopefully somebody comes along with more knwoledge about actor models and textres and how to refer on them if items are equipped.

Hi!

Thanks, I'll try working on that. I just looked through the .skrit, now I gotta check the ffx-script itself for comparison, but I guess I could get it running.

Well, concerning your doubts: I checked Stone Form. It changes everything. And I do mean everything. Weapon, armor, face... even if you exchange your weapon or armor for another one while the power is active... so maybe this effect was newly introduced in BW, I dunno. And, to be honest, as long as I get it to work, I don't care too much about the details. Wink