Scripts / Entity Plays Video

Author
Message
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 27th May 2020 11:46
How can I get an entity (not the Story Zone) to play a video?
Julian - increasingly disillusioned and jaded
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 27th May 2020 16:28
Interesting question. I never tried to play a video from script.
But here's a snipit from the storyinzone.lua ;
if g_storyinzone_mode[e] == 1 then
PlaySound(e,0)
PlayVideo(e,1)
StopSound(e,0)
g_storyinzone_mode[e] = 2
else

How is a video file slot signified by a regular entity? IDK??
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 27th May 2020 17:24
Thanks. I tried assigning default.lua to the story zone marker and then calling the video from another entity using the marker's e number but it didn't work.
Julian - increasingly disillusioned and jaded
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 27th May 2020 22:29
@ lordjulian
What you exactly want to achieve?
I've tried to recreate in a video what I think you want to do:



If so, let me know and I'll upload the script and how to.
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
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 28th May 2020 05:02
Sure, that'd be great 3com. I'd like to know cause global.lua has a PlayVideo,
but where is the file access function!?
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 28th May 2020 10:13
Thanks. Well, I had a fallen tree which blocks an entrance. To remove the block the player needs a chainsaw. I just wanted a short cutscene of the player cutting into the tree, but I couldn't use the normal storyinzone script because it would activate regardless of whether the player had the chainsaw.

So I changed the storyinzone script so instead of the player being in the zone the zone entity just needs to be activated. Then I set my invisible wall to activate the zone before destroying itself. I was very shocked when it actually worked! I am a rubbish scripter and I've just come back after a long time without doing any Lua so this seems like a miracle.
Julian - increasingly disillusioned and jaded
PM

Login to post a reply

Server time is: 2024-12-22 02:49:39
Your offset time is: 2024-12-22 02:49:39