One way to do a cutscene

Based upon suggestions by MrAngel:

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Cutscene">
    <gameid>05dd0048-ff80-44d4-843f-47aa85399d14</gameid>
    <version>2.0</version>
    <firstpublished>2018</firstpublished>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <description type="string"></description>
    <beforeenter type="script">
      CutsceneOneFunction
    </beforeenter>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <object name="CutScene1">
    <inherit name="editor_room" />
    <description><![CDATA[<center><h1>Lorem Ipsum</h1></center><br/><p>On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.</p><br/><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><br/><p>But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?</p><br/><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>]]></description>
  </object>
  <function name="CutsceneOneFunction"><![CDATA[
    msg ("<div id='cutscene' style='display:none;margin-right:5%;margin-left:5%;'><div id='cs1-content'></div><center><button id='end-cutscene1-btn' onclick='backToGame();'>RETURN TO PLAY</button></center><br/><br/></div>")
    JS.eval ("var promptWasDisplayed = isElementVisible('#txtCommandDiv');var panesWereDisplayed = isElementVisible('#gamePanes');if(promptWasDisplayed){  $('#txtCommandDiv').hide();}if(panesWereDisplayed){  $('#gamePanes').hide();}function backToGame(){  if(promptWasDisplayed){    $('#txtCommandDiv').show();  }  if(panesWereDisplayed){    $('#gamePanes').show();  }    scrollToEnd = scrollToEndBak;  $('#gameBorder').fadeIn();  $('#cutscene').fadeOut().remove();};var txtToPrint = '"+CutScene1.description+"<br/><br/>';$('#cs1-content').html($('#cs1-content').html() + txtToPrint);var scrollToEndBak = scrollToEnd;scrollToEnd = function(){};var cs = $('#cutscene');cs.insertBefore($('#dialog'));cs.fadeIn(8000);$('#gameBorder').fadeOut(5000);")
  ]]></function>
</asl>

NOTE TO SELF:

Before disabling the panes or command bar, I need to if(isElementVisible('#gamePanes')){uiHide('#gamePanes');panesWereHidden = true;} and the same thing with "#txtCommandDiv".

That way, I won't show (or hide) anything that was hidden by default upon returning to play.


Speaking of...
Remind me some time to show you my opening scene for X3. And then, of course, you can give me advice on how to tidy it up and make it look “KV KOOL”.


Word up.


Hey, XanMag,

You should show me your opening scene for X3.


I sent you an email. So. Now. Stop reminding me.


I just updated the first post.

Now it checks if elements are visible before doing anything, so it knows if it should display them at the end of the script.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums