Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
DenisRef

Зараженные зоны в 0.63

Наткнулся в одной группе ВК на пост, где было написано, что создать зараженные зоны в 0.63 вполне реально через данные файлы на сервере dta/scripts.pbo/4_World/Classes/AreaDamage

Вопрос, сможет ли кто нибудь такое провернуть?

//Самый первый файлик в этой папочке

class AreaDamageBase
{
	EntityAI				m_ParentObject;
	AreaDamageTrigger		m_AreaDamageTrigger;
	AreaDamageType			m_AreaDamageType;

	float					m_LoopInterval;
	float					m_DeferredInterval;
	float					m_PlayerDamage;
	float					m_OthersDamage;
	ref TStringArray 		m_HitZones;
	ref TStringArray		m_RaycastSources;
	string					m_AmmoName;
	int 					m_DamageType;
	vector					m_ExtentMin;
	vector 					m_ExtentMax;
	
	void AreaDamageBase(EntityAI parent)
	{
		m_ParentObject		= parent;
		m_ExtentMin 		= Vector(0, 0, 0);
		m_ExtentMax 		= Vector(0, 0, 0);
		m_LoopInterval 		= 0.0;
		m_DeferredInterval	= 0.0;
		m_PlayerDamage		= 0.0;
		m_PlayerDamage		= 0.0;
		m_HitZones			= new TStringArray;
		m_HitZones.Insert("Head");
		m_HitZones.Insert("Lungs");
		m_HitZones.Insert("LeftHand");

		m_RaycastSources	= new TStringArray;
		m_RaycastSources.Insert("0.0 0.1 0.0");

		m_AmmoName			= "MeleeDamage";
		m_DamageType 		= 3;

		LoadConfigParams();
	}
	void ~AreaDamageBase() {}

	void Spawn()
	{
		CreateDamageTrigger();
	}
	
	void Destroy()
	{
		DestroyDamageTrigger();
	}
	
	void SetExtents( vector mins, vector maxs )
		{ m_ExtentMin = mins; m_ExtentMax = maxs; }
	void SetAreaDamageType( int area_dmg_type )
		{ m_AreaDamageType = area_dmg_type; }
	void SetHitZones( array<string> hitzones )
		{ m_HitZones = hitzones; }
	void SetRaycastSources( array<string> raycast_sources )
		{ m_RaycastSources = raycast_sources; }
	void SetAmmoName( string ammo_name )
		{ m_AmmoName = ammo_name; }
	void SetDamageType( int pDamageType )
		{ m_DamageType = pDamageType; }
	void SetLoopInterval( float time )
		{ m_LoopInterval = time; }
	void SetDeferInterval( float time )
		{ m_DeferredInterval = time; }
    void SetParentObject( EntityAI obj )
		{ m_ParentObject = obj };
	
	void CreateDamageTrigger()
	{
		if(Class.CastTo(m_AreaDamageTrigger, g_Game.CreateObject( "AreaDamageTrigger", m_ParentObject.GetPosition(), false, false, false )))
		{
			m_AreaDamageTrigger.SetOrientation( m_ParentObject.GetOrientation() );
			m_AreaDamageTrigger.SetExtents( m_ExtentMin, m_ExtentMax );
			m_AreaDamageTrigger.SetAreaDamageType( m_AreaDamageType );
			m_AreaDamageTrigger.SetHitZones( m_HitZones );
			m_AreaDamageTrigger.SetRaycastSources( m_RaycastSources );
			m_AreaDamageTrigger.SetAmmoName( m_AmmoName );
			m_AreaDamageTrigger.SetDamageType( m_DamageType );
			m_AreaDamageTrigger.SetLoopTime( m_LoopInterval );
			m_AreaDamageTrigger.SetDeferTime( m_DeferredInterval );
			m_AreaDamageTrigger.SetParentObject( m_ParentObject );
		}
	}
	
	void DestroyDamageTrigger()
	{
		if ( GetGame() && m_AreaDamageTrigger ) // It's necesarry to check if the game exists. Otherwise a crash occurs while quitting.
		{
			GetGame().ObjectDelete( m_AreaDamageTrigger );
			m_AreaDamageTrigger = NULL;
		}
	}

	protected void LoadConfigParams()
	{
		string areadamage_subcfg = "CfgVehicles " + m_ParentObject.GetType() + " " + ClassName() + " ";
		
		// Read all config parameters
		if ( ConfigParamExists(areadamage_subcfg, "extentMin") )
			{ m_ExtentMin = GetGame().ConfigGetVector(areadamage_subcfg + "extentMin"); }
		if ( ConfigParamExists(areadamage_subcfg, "extentMax") )
			{ m_ExtentMax = GetGame().ConfigGetVector(areadamage_subcfg + "extentMax"); }
		if ( ConfigParamExists(areadamage_subcfg, "loopInterval") )
			{ m_LoopInterval = GetGame().ConfigGetFloat(areadamage_subcfg + "loopInterval"); }
		if ( ConfigParamExists(areadamage_subcfg, "deferredInterval") )
			{ m_DeferredInterval = GetGame().ConfigGetFloat(areadamage_subcfg + "deferredInterval"); }
		if ( ConfigParamExists(areadamage_subcfg, "hitZones") )
			{ GetGame().ConfigGetTextArray(areadamage_subcfg + "hitZones", m_HitZones); }
		if ( ConfigParamExists(areadamage_subcfg, "raycastSources") )
			{ GetGame().ConfigGetTextArray(areadamage_subcfg + "raycastSources", m_RaycastSources); }
		if ( ConfigParamExists(areadamage_subcfg, "ammoName") )
			{ GetGame().ConfigGetText(areadamage_subcfg + "ammoName", m_AmmoName); }
		if ( ConfigParamExists(areadamage_subcfg, "damageType") )
			{ m_DamageType = GetGame().ConfigGetInt(areadamage_subcfg + "damageType"); }
	}
	
	protected bool ConfigParamExists(string path, string option)
	{
		return GetGame().ConfigIsExisting(path + option);
	}
}

 

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Edited by DenisRef (see edit history)

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

DenisRef Можно - всё. Главное желание. Хотя сейчас вряд ли кто этим заниматься будет

Share this post


Link to post
Share on other sites



  • 0

Пока нет документации по новому языку, это проблематично. Тут методом тыка изучаешь функции выдачи лута, уж не говоря о всяких зараженных зонах, так что рекоммендую всетаки не торопиться с этим, и класть знания в копилочку, чтобы после очередного обновления серверок в стиме с документацией от разрабов уже знать куда лезть и что делать.

Share this post


Link to post
Share on other sites
  • 0

Есть человек, который собрал скрипт. Не бесплатно, поэтому могу только скинуть ник этого пользователя.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.