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
Sign in to follow this  
NoyName

Партиклы от игрока

Сделал партиклы на основе дейзовских от игрока (кровотечения, рвоты) :
 

void CreateParticlePtc()
	{
		if (!GetGame().IsServer())
		{
		ref ptc1 m_puddle;
		Particle m_ptc1Particle;
		vector bodypos = dBodyGetCenterOfMass(this);	
        vector pos;
        pos[1] = GetGame().SurfaceY(pos[0], pos[2]);
        vector ori = GetGame().GetSurfaceOrientation(pos[0], pos[2]);
        m_ptc1 = new ptc1();
        SEffectManager.PlayInWorld( m_ptc1, bodypos);
        m_ptc1Particle = m_ptc1.GetParticle();
        
        m_ptc1.GetParticle().AddAsChild(this, bodypos, ori);
	    }
	}

class ptc1 : EffectParticle
{
	void ptc1()
	{
		SetParticleID(ParticleList.ptc1PTC);
	}
}

Но никак не могу  вызвать их работу, пробывал void OnScheduledTick(float deltaTime) в PlayerBase
Работает только чистый вызов(CreateParticlePtc), если добавлять проверку то функция так же работает, однако создание партиклов не происходит. Есть у кого идеи?

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Дополнение : если функция CreateParticlePtc не активирована при старте сразу, то активировать ее потом не получается через функции в deltaTime. Однако получается вызвать с помощью триггера например CheckDeath.
Можно вызвать создание партикла через симптом на подобие Vomit. Однако вообще не понятно что именно является функцией отвечающей за создание партикла :
**оригинальный симптом дейза**

class VomitSymptom extends SymptomBase
 {
  //just for the Symptom parameters set-up and gets called even if the Symptom doesn't execute, don't put any gameplay code in here
  override void OnInit()
  {
  m_SymptomType = SymptomTypes.PRIMARY;
  m_Priority = 100;
  m_ID = SymptomIDs.SYMPTOM_VOMIT;
  m_DestroyOnAnimFinish = true;
  m_SyncToClient = false;
  m_Duration = 5;
  }
  
  override void OnUpdateServer(PlayerBase player, float deltatime)
  {
  
  }
  
  override void OnUpdateClient(PlayerBase player, float deltatime)
  {
  
  }
  
  override void OnAnimationStart()
  {
  m_Player.GetStatToxicity().Set(0);
  m_Player.m_PlayerStomach.ClearContents();
  //Print("------------ vomit start -------------");
  }
  
  override void OnAnimationFinish()
  {
  m_Player.GetStaminaHandler().DepleteStamina(EStaminaModifiers.OVERALL_DRAIN);
  }
  
  override bool CanActivate()
  {
  return ( m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_MOVE || m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_ACTION );
  } 
  
  override void OnGetActivatedServer(PlayerBase player)
  {
  PlayAnimationFB(DayZPlayerConstants.CMD_ACTIONFB_VOMIT,DayZPlayerConstants.STANCEMASK_CROUCH, GetDuration() );
  //timer.Run(10, this, "Destroy");
  if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated");
  }
  
  override void OnGetDeactivatedServer(PlayerBase player)
  {
  if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated");
  }
  
  override void OnGetDeactivatedClient(PlayerBase player)
  {
  if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated");
  }
  
  override SmptAnimMetaBase SpawnAnimMetaObject()
  {
  return new SmptAnimMetaFB();
  }
 }

**сам партикл рвоты**

class EffVomit : EffectParticle
 {
  void EffVomit()
  {
  SetParticleID(ParticleList.VOMIT);
 // SetSoundName("Action_Vomitting_0");
  }
  
  
  override void Event_OnStarted()
  {
  // Uncomment this to spawn fake decal of vomit on ground.
  /*
  vector pos = m_Character.GetPosition();
  vector ori = m_Character.GetOrientation();
  
  Particle p = Particle.Play(ParticleList.VOMIT_CHUNKS, pos);
  p.SetOrientation(ori);
  */
  }
 }

 

Edited by NoyName (see edit history)

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
Sign in to follow this  

×
×
  • 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.