Home   Help Search Login Register  

Author Topic: How can I randomize a cut scene?  (Read 3013 times)

0 Members and 1 Guest are viewing this topic.

How can I randomize a cut scene?
« on: 20 Jul 2014, 16:42:20 »
Hi there!

I pretty sure this question will be easy... I have a tv that plays cut scenes via the action menu... is it possible to have it randomize between 4 different cut scenes? I have 4 different angles watching the same location and would like to have it play one of 4 different scenes, I'll try lay out what I mean below...

Player uses action menu to call up vid...
tv3act1 =  tv3 addaction ["Access East Outpost CCTV.","vidOutpost.sqs"];

then would like to have vidOutpost.sqs play 1 of 4 cut scenes play randomly:

cut scene 1
or
cut scene 2
or
cut scene 3
or
cut scene 4
exit

I have the cuts scenes completed so just need help with the randomize part  ???. any help is much appreciated! :)

Oh - also does anyone know if it's possible to end a cut scene before it ends on it's own? Meaning if someone is watching but wants to leave the cut scene - is there a button or command I could implement so that they could exit the video? Am I crazy for asking this stuff?!   :blink:
« Last Edit: 20 Jul 2014, 16:46:55 by ÐurbanPoison™ »

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: How can I randomize a cut scene?
« Reply #1 on: 20 Jul 2014, 17:57:10 »
I'm not very knowledgeable about multiplayer scripting, but I can give you some idea of how to get random results.

Simplest solutions are often the best. I would use a system of generating a random number and assigning a corresponding cutscene of the generated number is above or below a certain amount.

Example:

Code: [Select]
_number = random 5

? _number <= 1: goto "scene1"
? _number > 1 and <= 2: goto "scene2"

etc

I imagine something along those lines would work for you. It's been a while since I last did scripting, but this was a system I frequently used to generate randon results. As always, syntax not guaranteed.

Hope this helps you out.
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba