Scripts / Play video on a screen or tv set

Author
Message
sacdaly
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 20th Jun 2023 19:33
Hi All,
I have GGMax and GGClassic, i have a script from GGC that will play a video on a screen , I wander if this can be used in GGM, or if indeed this can be done now already,
this is my first attempt at using GGM so I have no idea how things work yet ,I have made a map with objects and I would like a Video of which I will make,to play on a tv or a screen like what I can do in GGC.

Here is the GGC script you are probably aware of it anyhow many thanks in advance for any reply's :

-- plays the specified mp4 video file onto the entity texture when player in range
-- note for performance reasons, master in-game videos at an appropriate size, e.g 640x360, 170kbps (or lower)

video_to_play = {}
loop_video = {}
video_trigger_range = {}
prompt_to_start_video = {}
prompt_to_stop_video = {}
play_once = {}

function play_video_on_entity_init(e)

-- adjust these values ----------------------------------------------------------------
video_to_play[e] = "videobank\\GG_mars_helicopter.mp4"
--video_to_play[e] = "videobank\\GG_Video.mp4"
--video_to_play[e] = "videobank\\GG_western.mp4"
--video_to_play[e] = "videobank\\GG_tesla.mp4"
--video_to_play[e] = "videobank\\GG_firefx.mp4"
loop_video[e] = 0 -- 0 to play video once, 1 to loop video
video_trigger_range[e] = 300
prompt_to_start_video[e] = "Press E key to Start Video"
prompt_to_stop_video[e] = "Press ALT key to Stop Video"
---------------------------------------------------------------------------------------

play_once[e] = 0
end

function play_video_on_entity_main(e)

PlayerDist = GetPlayerDistance(e)
if PlayerDist < video_trigger_range[e] then
if play_once[e] == 0 or IsVideoOnEntityPlaying() == 0 then
Prompt(prompt_to_start_video[e])
play_once[e] = 0
if g_KeyPressE == 1 then
play_once[e] = 1
PlayVideoOnEntity(e,video_to_play[e],loop_video[e])
end
end
if IsVideoOnEntityPlaying() == 1 and play_once[e] == 1 then
Prompt(prompt_to_stop_video[e])
if g_KeyPressALT == 1 then
StopVideoOnEntity(e)
play_once[e] = 0
end
end
else
if play_once[e] == 1 then
StopVideoOnEntity(e)
play_once[e] = 0
end
end

end
s clarke
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Jun 2023 09:46
@ sacdaly
I never had seen that script in GG or GGMax, even commands such as PlayVideoOnEntity() don't exist in global.lua, although it would be nice to have
Look for seccam.lua and secmon.lua, even the txt guides in:

C:\Users\username\Documents\GameGuruApps\GameGuruMAX\Files\scriptbank\Community\6704278\core\objects

Tha's was kindly done by the user Necrym59, ty mate.

Although what you are looking for was done in GG via fx shader, GGMax does not support it.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
sacdaly
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 22nd Jun 2023 18:35
Hi 3com,
Thanks for the reply.
Ye I'm sure the above was from an update, given for free , it had Game Guru adverts on it, I just directed it to my own video's
s clarke
mikeven
12
Years of Service
User Offline
Joined: 31st Dec 2011
Location:
Posted: 22nd Jun 2023 21:49
Hello sacdaly and 3com,

About that command 'PlayVideoOnEntity()' I found it in the content of this 'darkLUA.cpp' thanks to a Bing Search.
This is the link to that file : https://github.com/TheGameCreators/GameGuruRepo/blob/master/GameGuru%20Core/Dark%20Basic%20Public%20Shared/Dark%20Basic%20Pro%20SDK/DarkSDKMore/DarkLUA/DarkLUA.cpp

PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 22nd Jun 2023 22:34
@ mikeven
You are right, I've missed it, ty for the tip

@ sacdaly
You are welcome
That's a Cyber's GG code improved, something like that would be nice to have in GGMax as well.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
sacdaly
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 23rd Jun 2023 16:03 Edited at: 23rd Jun 2023 16:06
Here it is used in a demo I did at the 9:50 mark

https://youtu.be/l7bmScRhlFg
s clarke

Login to post a reply

Server time is: 2024-12-21 18:25:26
Your offset time is: 2024-12-21 18:25:26