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
paranoyk

Обновление навмеш. Как?

Вопрос простой и краткий..Как обновить навмеш, что бы через катомные здания не проходили зомби и прочие.
Почему спрашиваю. До сего момента всё было светло и уютно- добавил кастомную локацию, всё пучком..Сейчас добавляю-через некоторые проходят зомби,через некоторые-нет. Поэтому прошу помощи (а то расширение Рогово как то хочется поставить,а не получается)

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Ну, елси быть внимательным, то

 

	private Object SpawnObject(string objectName, vector position, vector orientation)
	{
		Object obj = NULL;
		obj = Object.Cast(GetGame().CreateObject(objectName, "100 100 100"));
		if (obj)
		{
			//m_ObjectsCount++; //Это у меня обьекты считаются - для статистики в лог
			obj.SetPosition(position);
			obj.SetOrientation(orientation);

			if (obj.CanAffectPathgraph())
			{
				obj.SetAffectPathgraph(true, false); //Вот оно как раз и есть
				GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj); //Вот оно
			}
			else
			{
				ForceCollisionUpdate(obj);
			}
		}
      	return obj;
    }

	void ForceCollisionUpdate(Object object) //Это для тех, кому навмеш не предусмотрен
	{
		vector roll = object.GetOrientation();
		roll[0] = roll[0] - 1;
		object.SetOrientation(roll);
		roll[0] = roll[0] + 1;
		object.SetOrientation(roll);
		roll[1] = roll[1] - 1;
		object.SetOrientation(roll);
		roll[1] = roll[1] + 1;
		object.SetOrientation(roll);
		roll[2] = roll[2] - 1;
		object.SetOrientation(roll);
		roll[2] = roll[2] + 1;
		object.SetOrientation(roll);
	}

 

Но это для 1.07

Для 1.08 по другому - там сразу при создании обьекта двиг сам все делает
 

Но об это в следующий раз

Edited by BorizzK (see edit history)

Share this post


Link to post
Share on other sites



  • 0

@BorizzK Наступил новый 1,08...С новым патчем! С новым багом!....Если будет время разжуйте что куда почем....
 

Share this post


Link to post
Share on other sites
  • 0

@paranoyk Там же новая команда есть, которая сразу заносит здание в навмеш

Share this post


Link to post
Share on other sites
  • 0
proto native Object CreateObjectEx( string type, vector pos, int iFlags, int iRotation = RF_DEFAULT );

 

Edited by Selleti (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

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