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
ishkur

Видео файлы в дэйз.

Здравствуйте многоуважаемые знатоки энскрипта и движка игры. Как вы наверное уже догадались, скриптер из меня не очень. Зато идеи умею подкидывать(ну а куда же их деть, с моей то больной фантазией?). Так вот, назрел вопрос-идея: а может ли движок дэйз внутри игры воспроизводить видео, хоть какого-либо формата? Мафон с кассетами уже имеется средь модов, и не один. А вот чтоб телек замутить?! :)

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0

Тоже думал над этим вопросом, но что-то мне кажется маловароятно это провернуть, ну или очень не просто..если учесть что у них даже синхронизация звуков страдает..а что говорить о видео..

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
  • 0
2 часа назад, paranoyk сказал:

....а движок игры сможет воспроизвести обычный ГИФ?

Учитывая, что в воркбенче при настройке лейаутов есть .gif, то в теории возможно. На практике - хрен его знает.

Арма 3 в это могла, но там и не такой движок был, хотя уверен, что принцип загрузки/меню примерно тот же, ибо всё на .paa и .edds.

Share this post


Link to post
Share on other sites
  • 0
3 часа назад, Yuki сказал:

Учитывая, что в воркбенче при настройке лейаутов есть .gif, то в теории возможно. На практике - хрен его знает.

Арма 3 в это могла, но там и не такой движок был, хотя уверен, что принцип загрузки/меню примерно тот же, ибо всё на .paa и .edds.

в а2 можно было в gps е проигрывать видео

Share this post


Link to post
Share on other sites
  • 0

edds может быть анимирован покадрово, но использование видел только в particles. Максимум сможете показывать простенькую гифку, как на телеке в баре 100 рентген.

Share this post


Link to post
Share on other sites
  • 0

Вот что нарыл:

\scripts\5_Mission\GUI\NewUI\MainMenu\MainMenuVideo.c

class MainMenuVideo extends UIScriptedMenu
{
	protected string 				m_BackButtonTextID;
	
	protected TextWidget			m_PlayPauseText;
	protected VideoWidget			m_Video;
	protected ref Timer				m_VideoPlayTimer;
	protected ref WidgetFadeTimer	m_VideoFadeTimer;
	bool							m_IsPaused;
	
	override Widget Init()
	{
		layoutRoot 				= GetGame().GetWorkspace().CreateWidgets( "gui/layouts/xbox/video_menu.layout" );
		m_Video					= VideoWidget.Cast( layoutRoot.FindAnyWidget( "video" ) );
		m_PlayPauseText			= TextWidget.Cast( layoutRoot.FindAnyWidget( "PauseVideoText" ) );
		
		m_VideoPlayTimer		= new Timer();
		m_VideoFadeTimer		= new WidgetFadeTimer();
		
		#ifdef PLATFORM_PS4
			m_Video.LoadVideo( "/app0/video/DayZ_onboarding_MASTER.mp4", 0 );
		#else
			m_Video.LoadVideo( "G:\\video\\DayZ_onboarding_MASTER.mp4", 0 );
		#endif
		m_Video.Play( VideoCommand.REWIND );
		m_Video.Play( VideoCommand.PLAY );
		m_VideoFadeTimer.FadeIn( m_Video, 1.5 );
		m_VideoPlayTimer.Run( 0.005, this, "PlayVideoLoop", null, true );
		
		return layoutRoot;
	}
	
	void ~MainMenuVideo()
	{
	}
	
	//after show
	override void OnShow()
	{
		super.OnShow();
		GetGame().GetUIManager().ShowUICursor(false);
	}

	//after hide
	override void OnHide()
	{
		super.OnHide();
		GetGame().GetUIManager().ShowUICursor(true);
	}
	
	void PlayVideoLoop()
	{
		if( m_Video && !m_IsPaused && !m_Video.Play( VideoCommand.ISPLAYING ) )
		{
			StopVideo();
		}
	}
	
	void StopVideo()
	{
		if( m_Video )
		{
			m_VideoPlayTimer.Stop();
			m_Video.Play( VideoCommand.KILL );
			GetGame().GetUIManager().Back();
		}
	}
	
	void PlayPauseVideo()
	{
		if( m_Video )
		{
			if( m_Video.Play( VideoCommand.ISPLAYING ) )
			{
				m_Video.Play( VideoCommand.STOP );
				//m_PlayPauseText.SetText( "Play" );
				m_IsPaused = true;
			}
			else
			{
				m_Video.Play( VideoCommand.PLAY );
				//m_PlayPauseText.SetText( "Pause" );
				m_IsPaused = false;
			}
		}
	}
	
	override void Update(float timeslice)
	{
		if( GetGame().GetInput().LocalPress("UAUICtrlX",false) )
		{
			//PlayPauseVideo();
		}
		if( GetGame().GetInput().LocalPress("UAUIBack",false) )
		{
			StopVideo();
		}
	}
	
	override void OnVisibilityChanged(bool isVisible)
	{
		if ( !isVisible )
		{
			m_Video.Play( VideoCommand.KILL );
		}
	}
	
	/// Initial texts load for the footer buttons
	protected void LoadFooterButtonTexts()
	{
		TextWidget uiBackText 	= TextWidget.Cast(layoutRoot.FindAnyWidget( "BackText" ));		
		
		if (uiBackText)
		{
			uiBackText.SetText(m_BackButtonTextID);
		}
	}
	/// Set correct bottom button texts based on platform (ps4 vs xbox texts)
	protected void LoadTextStrings()
	{
		#ifdef PLATFORM_PS4
			m_BackButtonTextID = "ps4_ingame_menu_back";
		#else 
			m_BackButtonTextID = "STR_rootFrame_toolbar_bg_ConsoleToolbar_Back_BackText0";	
		#endif
	}
	
}

Так что, походу оно таки может.

подробнее тут:

\1_Core\proto\EnWidgets.c

//VideoWidget
enum VideoCommand
{
	PLAY,
	STOP,
	REWIND,
	POSITION,
	REPEAT,
	ISPLAYING,
	KILL
};

class VideoWidget extends Widget
{
	proto native int Play(VideoCommand cmd);
	proto native bool LoadVideo(string name, int soundScene);
	proto native void DisableSubtitles(bool disable);
};

 

Edited by ishkur (see edit history)

Share this post


Link to post
Share on other sites
  • 0
20 минут назад, ishkur сказал:

Вот что нарыл:

\scripts\5_Mission\GUI\NewUI\MainMenu\MainMenuVideo.c

class MainMenuVideo extends UIScriptedMenu { protected string m_BackButtonTextID; protected TextWidget m_PlayPauseText; protected VideoWidget m_Video; protected ref Timer m_VideoPlayTimer; protected ref WidgetFadeTimer m_VideoFadeTimer; bool m_IsPaused; override Widget Init() { layoutRoot = GetGame().GetWorkspace().CreateWidgets( "gui/layouts/xbox/video_menu.layout" ); m_Video = VideoWidget.Cast( layoutRoot.FindAnyWidget( "video" ) ); m_PlayPauseText = TextWidget.Cast( layoutRoot.FindAnyWidget( "PauseVideoText" ) ); m_VideoPlayTimer = new Timer(); m_VideoFadeTimer = new WidgetFadeTimer(); #ifdef PLATFORM_PS4 m_Video.LoadVideo( "/app0/video/DayZ_onboarding_MASTER.mp4", 0 ); #else m_Video.LoadVideo( "G:\\video\\DayZ_onboarding_MASTER.mp4", 0 ); #endif m_Video.Play( VideoCommand.REWIND ); m_Video.Play( VideoCommand.PLAY ); m_VideoFadeTimer.FadeIn( m_Video, 1.5 ); m_VideoPlayTimer.Run( 0.005, this, "PlayVideoLoop", null, true ); return layoutRoot; } void ~MainMenuVideo() { } //after show override void OnShow() { super.OnShow(); GetGame().GetUIManager().ShowUICursor(false); } //after hide override void OnHide() { super.OnHide(); GetGame().GetUIManager().ShowUICursor(true); } void PlayVideoLoop() { if( m_Video && !m_IsPaused && !m_Video.Play( VideoCommand.ISPLAYING ) ) { StopVideo(); } } void StopVideo() { if( m_Video ) { m_VideoPlayTimer.Stop(); m_Video.Play( VideoCommand.KILL ); GetGame().GetUIManager().Back(); } } void PlayPauseVideo() { if( m_Video ) { if( m_Video.Play( VideoCommand.ISPLAYING ) ) { m_Video.Play( VideoCommand.STOP ); //m_PlayPauseText.SetText( "Play" ); m_IsPaused = true; } else { m_Video.Play( VideoCommand.PLAY ); //m_PlayPauseText.SetText( "Pause" ); m_IsPaused = false; } } } override void Update(float timeslice) { if( GetGame().GetInput().LocalPress("UAUICtrlX",false) ) { //PlayPauseVideo(); } if( GetGame().GetInput().LocalPress("UAUIBack",false) ) { StopVideo(); } } override void OnVisibilityChanged(bool isVisible) { if ( !isVisible ) { m_Video.Play( VideoCommand.KILL ); } } /// Initial texts load for the footer buttons protected void LoadFooterButtonTexts() { TextWidget uiBackText = TextWidget.Cast(layoutRoot.FindAnyWidget( "BackText" )); if (uiBackText) { uiBackText.SetText(m_BackButtonTextID); } } /// Set correct bottom button texts based on platform (ps4 vs xbox texts) protected void LoadTextStrings() { #ifdef PLATFORM_PS4 m_BackButtonTextID = "ps4_ingame_menu_back"; #else m_BackButtonTextID = "STR_rootFrame_toolbar_bg_ConsoleToolbar_Back_BackText0"; #endif } }


class MainMenuVideo extends UIScriptedMenu
{
	protected string 				m_BackButtonTextID;
	
	protected TextWidget			m_PlayPauseText;
	protected VideoWidget			m_Video;
	protected ref Timer				m_VideoPlayTimer;
	protected ref WidgetFadeTimer	m_VideoFadeTimer;
	bool							m_IsPaused;
	
	override Widget Init()
	{
		layoutRoot 				= GetGame().GetWorkspace().CreateWidgets( "gui/layouts/xbox/video_menu.layout" );
		m_Video					= VideoWidget.Cast( layoutRoot.FindAnyWidget( "video" ) );
		m_PlayPauseText			= TextWidget.Cast( layoutRoot.FindAnyWidget( "PauseVideoText" ) );
		
		m_VideoPlayTimer		= new Timer();
		m_VideoFadeTimer		= new WidgetFadeTimer();
		
		#ifdef PLATFORM_PS4
			m_Video.LoadVideo( "/app0/video/DayZ_onboarding_MASTER.mp4", 0 );
		#else
			m_Video.LoadVideo( "G:\\video\\DayZ_onboarding_MASTER.mp4", 0 );
		#endif
		m_Video.Play( VideoCommand.REWIND );
		m_Video.Play( VideoCommand.PLAY );
		m_VideoFadeTimer.FadeIn( m_Video, 1.5 );
		m_VideoPlayTimer.Run( 0.005, this, "PlayVideoLoop", null, true );
		
		return layoutRoot;
	}
	
	void ~MainMenuVideo()
	{
	}
	
	//after show
	override void OnShow()
	{
		super.OnShow();
		GetGame().GetUIManager().ShowUICursor(false);
	}

	//after hide
	override void OnHide()
	{
		super.OnHide();
		GetGame().GetUIManager().ShowUICursor(true);
	}
	
	void PlayVideoLoop()
	{
		if( m_Video && !m_IsPaused && !m_Video.Play( VideoCommand.ISPLAYING ) )
		{
			StopVideo();
		}
	}
	
	void StopVideo()
	{
		if( m_Video )
		{
			m_VideoPlayTimer.Stop();
			m_Video.Play( VideoCommand.KILL );
			GetGame().GetUIManager().Back();
		}
	}
	
	void PlayPauseVideo()
	{
		if( m_Video )
		{
			if( m_Video.Play( VideoCommand.ISPLAYING ) )
			{
				m_Video.Play( VideoCommand.STOP );
				//m_PlayPauseText.SetText( "Play" );
				m_IsPaused = true;
			}
			else
			{
				m_Video.Play( VideoCommand.PLAY );
				//m_PlayPauseText.SetText( "Pause" );
				m_IsPaused = false;
			}
		}
	}
	
	override void Update(float timeslice)
	{
		if( GetGame().GetInput().LocalPress("UAUICtrlX",false) )
		{
			//PlayPauseVideo();
		}
		if( GetGame().GetInput().LocalPress("UAUIBack",false) )
		{
			StopVideo();
		}
	}
	
	override void OnVisibilityChanged(bool isVisible)
	{
		if ( !isVisible )
		{
			m_Video.Play( VideoCommand.KILL );
		}
	}
	
	/// Initial texts load for the footer buttons
	protected void LoadFooterButtonTexts()
	{
		TextWidget uiBackText 	= TextWidget.Cast(layoutRoot.FindAnyWidget( "BackText" ));		
		
		if (uiBackText)
		{
			uiBackText.SetText(m_BackButtonTextID);
		}
	}
	/// Set correct bottom button texts based on platform (ps4 vs xbox texts)
	protected void LoadTextStrings()
	{
		#ifdef PLATFORM_PS4
			m_BackButtonTextID = "ps4_ingame_menu_back";
		#else 
			m_BackButtonTextID = "STR_rootFrame_toolbar_bg_ConsoleToolbar_Back_BackText0";	
		#endif
	}
	
}

Так что, походу оно таки может.

подробнее тут:

\1_Core\proto\EnWidgets.c

//VideoWidget enum VideoCommand { PLAY, STOP, REWIND, POSITION, REPEAT, ISPLAYING, KILL }; class VideoWidget extends Widget { proto native int Play(VideoCommand cmd); proto native bool LoadVideo(string name, int soundScene); proto native void DisableSubtitles(bool disable); };


//VideoWidget
enum VideoCommand
{
	PLAY,
	STOP,
	REWIND,
	POSITION,
	REPEAT,
	ISPLAYING,
	KILL
};

class VideoWidget extends Widget
{
	proto native int Play(VideoCommand cmd);
	proto native bool LoadVideo(string name, int soundScene);
	proto native void DisableSubtitles(bool disable);
};

 

ну молодец, сам ответил)) далее остается научиться работать с объектом класса VideoWidget, благо пример ты буквально выше и скинул, который проигрывает видео на экране. Остается тока разобраться в коммандах и видео-формате. Проще говоря, пол дела сделано)

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
  • 0
19 часов назад, ishkur сказал:

Да это понятно, что в виджете. Надо ещё покопаться в потрохах игры, вдруг можно как-то натянуть на объект...

На такое движок игры не способен. Максимум - анимация в edds, которую можно создать в виде партикла без прозрачности и поместить в нужном месте, но это совершенный геморрой. 

Share this post


Link to post
Share on other sites
  • 0

https://www.youtube.com/watch?v=v45uiTZxxRI&ab_channel=BoiseCowboy

 

Share this post


Link to post
Share on other sites
  • 0
24.08.2020 в 19:29, ishkur сказал:

Да это понятно, что в виджете. Надо ещё покопаться в потрохах игры, вдруг можно как-то натянуть на объект...

Помещаем это чудо во фрейм и поверх готового фрейма с видео накидываем кнопки, все готово можно играть.

Share this post


Link to post
Share on other sites
  • 0
22 часа назад, tokarboss сказал:

Помещаем это чудо во фрейм и поверх готового фрейма с видео накидываем кнопки, все готово можно играть.

 

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.