Alternative skins system

Discuss all aspects related to modding Zandronum here.
Post Reply
ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

Alternative skins system

#1

Post by ZzZombo » Sun Jul 06, 2014 6:46 am

http://zandronum.com/tracker/view.php?id=1873

Since many modders don't visit the tracker, I post this here. I proposed there a new, more flexible skins format. It should allow to apply the same skin to different player classes/genders, allowing to make, for example, weapons w/ preferred skins looking different on different classes, and in general, be applicable to any actor, so you don't need to copy-paste the same code just to have differently looking props. It can also remap several sprites, in that rare case you used different sets of sprites, and remap arbitrary sounds played by actors. Skins also can be changed using the SetSkin() action special, allowing to make, for example, differently looking each map load props and whatnot.

Example skin:

Code: Select all

Doom64Guy
{
	displayname="Doom 64 Guy"
	hidden=false
	game=Doom
 	spriteremaps
	{
		PLAY D64G
	}
	soundremaps
	{
		*death		64pdieth
		*xdeath		64pdiehi
		*grunt		64oof
		*usefail		64oof
		*fist		64punch
		*pain		64plpain
	}
}
Preferred skin for a weapon wielded by two classes:

Code: Select all

BaseSkin //base stuff identical for both classes.
{
	hidden=true
	game=Doom
}
BFGGuy:BaseSkin
{
	displayname="Marine (BFG9000)"
	classes
	{
		Marine
	}
 	spriteremaps
	{
		PLAY PLAB //general remap
		PLYC PLYB //IIRC "PLYC" is default crouching sprite, we remap it too.
	}
}
BFGGuy:BaseSkin
{
	displayname="Officer (BFG9000)"
	classes
	{
		Officer
	}
 	spriteremaps
	{
		OFCA OFCB //general remap
		OFCC OFBC //crouching remap
	}
}
Spoiler: Differently looking objects (Open)

Code: Select all

RndSkin1
{
	displayname="Tree"
	hidden=true
	classes
	{
		RandomTree
		RandomBush
	}
 	spriteremaps
	{
		TREE TREA //remap tree sprites
		BUSH BUSA //remap bush sprites
	}
}
RndSkin2:RndSkin1
{
 	spriteremaps
	{
		TREE TREB //remap tree sprites
		BUSH BUSB //remap bush sprites
	}
}
RndSkin3:RndSkin1
{
 	spriteremaps
	{
		TREE TREC //remap tree sprites
		BUSH BUSC //remap bush sprites
	}
}

//Decorate.txt
actor RandomTree
{
	...
	States
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 SetSkin(0,"RndSkin1")
		goto Idle
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 SetSkin(0,"RndSkin2")
		goto Idle
		TNT1 A 0 SetSkin(0,"RndSkin3")
		Idle:
		TREE A -1
		stop
	}
}
actor RandomBush
{
	...
	States
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 SetSkin(0,"RndSkin1")
		goto Idle
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 SetSkin(0,"RndSkin2")
		goto Idle
		TNT1 A 0 SetSkin(0,"RndSkin3")
		Idle:
		BUSH A -1
		stop
	}
}
Note how I use only 3 skins for both actors and not 6, because it remaps only those sprites that are actually used there.

If you like my idea, go to the page I linked and support it by voting!
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

Post Reply