Raised This Month: $51 Target: $400
 12% 

Using model skins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tibisfhw
New Member
Join Date: Oct 2016
Old 02-04-2020 , 12:20   Using model skins
Reply With Quote #1

I am looking for a method of using textures from a model's skingroup.

I went through all the methods.

pev_weaponmodel2, pev_viewmodel2, pev_skin even tried something weird with pev_body.



Note: I need this for viewmodels (v_).
I can't switch to multiple submodels instead of skins. The references got too many vertices.
tibisfhw is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-04-2020 , 13:12   Re: Using model skins
Reply With Quote #2

The simple answer: you can't set submodels because the client always predicts the first submodel.
The complicated answer: it is actually doable but in a very hacky and bad way, with multiple drawbacks/issues.

So, even if you somehow switch to submodels it would be (almost) useless.
__________________

Last edited by HamletEagle; 02-04-2020 at 13:12.
HamletEagle is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 06-01-2021 , 18:04   Re: Using model skins
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
The simple answer: you can't set submodels because the client always predicts the first submodel.
The complicated answer: it is actually doable but in a very hacky and bad way, with multiple drawbacks/issues.

So, even if you somehow switch to submodels it would be (almost) useless.
So how can CSXtreme and CSO do it?
I understand that CSO modifies the base game
But CSXtreme uses AMXX and has a file that allows choosing with a variable of 0 and 1 to choose male or female hands
SoulWeaver16 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-01-2021 , 18:56   Re: Using model skins
Reply With Quote #4

That would be easily done with this https://github.com/ValveSoftware/halflife/issues/199
It wasn't added yet, the thread is ~8 years, rip
__________________








CrazY. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-02-2021 , 02:57   Re: Using model skins
Reply With Quote #5

Quote:
Originally Posted by SoulWeaver16 View Post
So how can CSXtreme and CSO do it?
I understand that CSO modifies the base game
But CSXtreme uses AMXX and has a file that allows choosing with a variable of 0 and 1 to choose male or female hands
You answered yourself. CSO is a modified game with a modified client.
I have no idea what CSXtreme is, but they could simply be using duplicated models, modified the client code or something like metahook.
__________________

Last edited by HamletEagle; 06-02-2021 at 02:58.
HamletEagle is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 06-03-2021 , 06:45   Re: Using model skins
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
You answered yourself. CSO is a modified game with a modified client.
I have no idea what CSXtreme is, but they could simply be using duplicated models, modified the client code or something like metahook.
In cs xtreme used single v_ models with 2 sub-models (for M and F hands) for every weapon. I wonder how NST made that but all what we can find is compiled .amxx files. There are no sources that we could use

Last edited by kww; 06-03-2021 at 06:48.
kww is offline
DeMNiX
Veteran Member
Join Date: Nov 2011
Location: Russia
Old 06-03-2021 , 22:33   Re: Using model skins
Reply With Quote #7

Quote:
Originally Posted by kww View Post
In cs xtreme used single v_ models with 2 sub-models (for M and F hands) for every weapon. I wonder how NST made that but all what we can find is compiled .amxx files. There are no sources that we could use
u can change bodygroups for v_ models with hacky method, but it limited by number 255(1Byte).
__________________
My channel with test codes
https://www.youtube.com/user/demnix03

Zombie Riot [Scenario & bots-zombie 11.11.2023]
https://youtu.be/8ZZan-aq2sc
DeMNiX is offline
YankoNL
Junior Member
Join Date: Dec 2018
Old 06-04-2021 , 06:37   Re: Using model skins
Reply With Quote #8

I don't know how you can do it in clasic mode, but in zp50 works with those lines added in the weapon plugin.
Code:
Weapon_OnDeploy(const iItem, const iPlayer, const iClip, const iAmmoPrimary, const iMode)
{
	#pragma unused iClip, iAmmoPrimary, iMode
	
	static iszViewModel;
	if (iszViewModel || (iszViewModel = engfunc(EngFunc_AllocString, MODEL_VIEW)))
	{
		set_pev_string(iPlayer, pev_viewmodel2, iszViewModel);
	}
	
	static iszPlayerModel;
	if (iszPlayerModel || (iszPlayerModel = engfunc(EngFunc_AllocString, MODEL_PLAYER)))
	{
		set_pev_string(iPlayer, pev_weaponmodel2, iszPlayerModel);
	}
	
	// Cancel any reload in progress.
	set_pdata_int(iItem, m_fInReload, 0, extra_offset_weapon);
	set_pdata_int(iItem, m_iModeChange, 0, extra_offset_weapon);

	new hclass = zpnm_get_user_human_class(iPlayer);
	
	// Apply woman and man hands submodel
	// Man
	if(hclass == 0)
	{
		set_pev(iItem, pev_body, 0)
	}
	if(hclass == 1)
	{
		set_pev(iItem, pev_body, 0)
	}
	if(hclass == 2)
	{
		set_pev(iItem, pev_body, 0)
	}

	// Woman
	if(hclass == 3)
	{
		set_pev(iItem, pev_body, 1)
	}
	if(hclass == 4)
	{
		set_pev(iItem, pev_body, 1)
	}
	if(hclass == 5)
	{
		set_pev(iItem, pev_body, 1)
	}

	set_pdata_string(iPlayer, m_szAnimExtention * 4, ANIM_EXTENSION, -1, extra_offset_player * 4);
	
	set_pdata_float(iItem, m_flTimeWeaponIdle, WEAPON_TIME_DELAY_DEPLOY, extra_offset_weapon);
	set_pdata_float(iPlayer, m_flNextAttack, WEAPON_TIME_DELAY_DEPLOY, extra_offset_player);
	
	// Deploy with default weapon settings
	Weapon_DefaultDeploy(iItem, iPlayer, MODEL_VIEW, MODEL_PLAYER, ANIM_DUMMY, ANIM_EXTENSION);
}
YankoNL is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode