Search Unity

Quick Time Event system

Discussion in 'Assets and Asset Store' started by Matt3D, Jun 28, 2013.

  1. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    I've just released my Quick Time Event system on the asset store. I programmed it for my game currently in development and required it to be abstract enough so that it's a "system" that can be triggered responded to in multiple ways, Decided to release it on the store since I noticed there wasn't one already.

    Basically there is one "main" script that does all the work logic, Triggering scripts configure the specifics what the QTE is and cause it to happen, and response scripts respond to the result of the QTE and perform an action in the world.
    The system comes with 7 example Response scripts to perform some pretty basic things like playing a legacy animation, changing a mecanim animation controller's parameters, displaying a success or fail GUItexture etc..
    It also comes with a blank template response script for you to write your own custom response to perform exactly what you want to have happen after a QTE completes.

    Asset Store Link
    Web Demo

    $f0ac9944-7218-4753-937a-dd93db9d1042_scaled.jpg

    Does not require Unity Pro, Mobile devices not supported (only because support was not written for them, not because of any limitation)

    • Demo Scene and Documentation Included.
    • Can be Triggered by Colliders, Animation Events, or a Cutscene editor.
    • Repeatable, or single shot
    • Choice between Single, Dual, Tri or Quad buttons, can be manually repositioned on screen.
    • On screen buttons can be GUI textures, or actual 2D billboards in the world.
    • 2D billboards can look at the camera always or not
    • 2D billboards can move along with an object, either by parenting to it, or Traveling along with it.
    • Can make the QTE "invisible" by hiding the On Screen Textures from displaying.
    • Use standard keyboard input, or use Buttons/Axis's defined in Unity's Input manager.
    • Have buttons shake back and forth
    • Have the Triggering script choose a random button, from a list of random buttons, or define a static one the QTE will always use
    • Response scripts that can be stacked to cause multiple things to happen in response to the QTE result
    • Ability to extend the response options to the QTE's by writing your own custom response scripts.

    I am currently working on porting the QTE project over to Unity 3.5. With exception to the mecanim response script, everything else is 100% compatible but I have to remake the example project inside 3.5, I am not sure at the moment how I will be distributing the 3.5 version, either included as part of the download, or a separate listing on the asset store.

    Experiments were done to see about using Movie textures for the Quick time events, although yes they can be loaded and played back, There is no currently built in way to use a movie with transparency via the GUI, also no way to affect the playback speed, so it was abandoned. Third party support using Quicktime movie format integration could be an answer but I did not wish to rely on anything not natively found in Unity.

    In the future I will post any new response scripts I may end up writing for my game or otherwise, and I encourage others to share their own, two that are coming is one for slowing down time, and another for those using uSeqencer like myself to playback a sequence. If anyone needs any help writing a response script feel free to ask and I'll lend a hand.
     

    Attached Files:

  2. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    Just submitted to the asset store v1.1

    -Added Response script for a Slow down "bullet time" effect while the QTE is happening
    -Fixed a bug with the cutscene scripts auto-firing when the scene started
    -lowering required version to base Unity 4 instead of 4.1

    Also submitted a separate listing for a Unity 3.5 version. Exactly the same as the Unity4 version except with the mecanim stuff removed, plus re-built example scene for 3.5.

    The 3.5 version may take longer to become approved then the update to the Unity 4 version.
     
  3. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    why no mobile? Can I customize to QTE to do gesture/swipes? I'm not very clear how your demo QTE works, seems a little strange.
     
  4. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    As stated in my description in the first post mobile devices are not supported, The initial reason is because my game I developed it for isn't going to be ported to mobile, so there is no current functionality to detect gesture/swipes.
    However it can be done in the future, what's stopping me is the fact I don't own a Mac, nor an apple developer account. So I have no way of actually testing any touch functionality in order to get it to work, but I'll explore some options to see what can be done.
    If you have bought the system hoping that it would have mobile support, I would suggest looking into getting a refund from Unity, and perhaps repurchasing when I am able to update the system.

    The Demo scene simply shows plainly the basic functionality of the system by having you walk in front of the signs to trigger a QTE, and then see a response to it, My documentation .pdf covers how to set up the system, and what each option is, If it is still unclear, I can make a tutorial video to explain the system better.
     
  5. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    Hi
    I keep getting this error on the 4.1 version : QTE_System/Scripts/Responses/QTE_Response_DisablePlayer.cs(8,17): error CS0246: The type or namespace name `ThirdPersonController' could not be found. Are you missing a using directive or an assembly reference?

    Should I be putting the scripts somewhere else - i.e. Plugins, Editor? There is a ThirdpersonController in the assets - should it be put somewhere else. Th eproblem is that I'm not a C# coder so when I see an error like this not at all certain what needs to be done about it. Any help would be greatly appreciated.
     
  6. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    It's trying to access a script called "ThirdpersonController" and can't find it, which is the script that comes with Unity's default character controller when you import the "Character Controller" package.

    The only files that need to be in a specific location is anything that came in the "Resources" folder, they must stay there. Anything else should be free to move around the project into any folder you like.

    You can solve the issue by either re-importing the "Character Controller" package into your project, Or if you don't wish to use Unity's default character at all (for example if you have your own character scripts), you can simply delete "QTE_Response_DisablePlayer.cs" from the project entirely, as it will only work with the Default character anyways, it was written to merely demonstrate the effect of stopping the player from moving can be done.
     
    Last edited: Jul 7, 2013
  7. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    @Matt3D - Thanks. Just checking really in case there was something I'm not aware of.
     
  8. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    I just submitted to the asset store v1.2 for both the Unity 4, and 3.5 versions.
    I had some brainstorming the other day on what was missing from the system/what I will need for my game.

    - "Enable Button Fail" option added to the Trigger Scripts, so that the QTE will not fail if wrong button is pressed, instead it will persist until succeed or Times out.
    -Triggering by Animator Curves support added. (Unity 4 Pro only).
    -Added ability for response scripts to detect respond differently to the two different kinds of failures (Wrong button, or Timeout)

    it would appear that V1.1 was never approved for the Unity 4 version, not sure why.
     
  9. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    Version 1.3 submitted to the Asset Store

    • Single Trigger Script
      Originally the triggers where multiple scripts, a script per QTE type (single, dual, tri, quad, mash) and there were two sets of the scripts, a "Collider" version and what I called a "Cutscene" version, making a total of 10 scripts.
      I have combined all functionality into one single script.
      The new single script uses a Custom Editor in the inspector, which creates a layout that is easier to read because it's better organized into sections, rather that the static list the individual scripts were before.
      It also shows and hides relevant/irrelevant options based upon what settings you've chosen.
      And also has tooltips to explain what each option does.

      I realised now that using the word "Cutscene" was not the best way to call those scripts, I now call it triggering the QTE "Manually" by code or some other method, as opposed to using a collider as the trigger.

      The new combined script will auto-configure itself, a label at the top of the script tells you which mode it is using: "Collider" or "Manual". If attached to a gameobject that has a Collider, it will perform as the Collider scripts did before... Triggering the QTE to happen with the player walks into them.
      If no collider is attached, then the script will say "Manual", and in order to cause the QTE to happen you can either call it via code, or use a Cutscene editor.

      The old individual triggering scripts are no longer supported, you will have to update your scenes to replace the old scripts with the new single trigger script
    • QTE Delay
      On top of the already existing "Input Delay" where the QTE appears but input is temporarily not detected to allow for some reaction time.
      I've also now implemented an overall Delay timer to the system, so the QTE fires after it's been triggered and the delay timer finishes.
    • Optional Individual timers for Multi-button QTE's
      The multiple button QTE's (dual, tri, quad) now have the option for each button to have its own timer. This is for having certain buttons disappear before the rest do. As oppose to the only way it was before, having all buttons disappear at once together.
    • Fixed the bug where the Billboard script had to be above the trigger script in the inspector, now it doesn't matter the order.
    • Fixed a bug where the Billboard script wouldn't work in Manual (cutscene) mode, (It probably gave a Null reference error before).
    • Change Camera Response script
      A response script that turns off all cameras in the scene, and then turns on the camera specified when you want it to happen in response to a QTE.

    Things I'm working on/ To Do (not released in this version):

    • Timer visualization
      A script that uses a Circle GUI texture that is twice the size of the button to visually communicate the amount of time the player has to press by scaling it down. When it reaches the size of the button the QTE ends.
    • Mash QTE visualization
      A script that uses a Circle GUI texture to visually communicate the progress of the mashable QTE. As the player mashes the Circle scales up until it reaches an outer ring.

      The two visualizations work, but only when the button is at the center of the screen. The pixel inset method I'm using to place the buttons onscreen scales the textures by the bottom left corner, which causes the circles to be out of place when scaling, Currently I can't see a fix for that.
      I may wish to look into implementing an optional NGUI version. As it would appear that NGUI has free distributables I could include in the project so users don't also have to buy NGUI.
    • Currently the only Axis you can use with the system is the Horizontal/Vertical Axis, and not any other Axis (such as the 2nd joystick on a controller), need to fix that.
     
  10. seapitt_b

    seapitt_b

    Joined:
    Oct 14, 2012
    Posts:
    4
    I think mobile support is important, because many mobile games that use QTE, i will buy the package soon after mobile support ;)

     
  11. Tezelian

    Tezelian

    Joined:
    Oct 22, 2013
    Posts:
    256
    Hey Matt, I will definitely be buying this from the store when I get my new pc which will be in mid/late January and Unity pro with it...

    But before I buy or download it and get Unity pro, all I got to do is download and install it, yes? I don't need to move any files or anything?



    Will this system work in the latest version of unity 4.3.2??????????

    Or do I need to download unity 4.0.0 or 3.5?

    If it doesn't support version 4.3.2, what can I do?

    Regards
     
    Last edited: Dec 24, 2013
  12. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    It doesn't require the use of Unity pro. There are two realeses on the asset store, one for 4.0+, the other for 3.5. However the only difference actually is the Unity 4 version has an extra demo script for Mecanim (which is only in 4.0) aside from that the system will work with any version of Unity including the lastest release. Simply because I'm not using anything that requires the later versions.
    In fact even if you buy the 3.5 version it will still work with Unity 4.

    In a future update, whenever unity gets around to releasing their new GUI system I want to use it instead of the current GUI, when that happens you will need the newest version.

    When you buy the system unity will download the package into its own storage folder where it keeps downloaded packages (C:\Users\accountName\AppData\Roaming\Unity\Asset Store) but Unity will ask to import the contents of the package into any project you want. It has a demo scene and documentation to explain how to set it up and use it. After you import the contents, the "resources" folder must be left alone, but the rest of the files are free to move about the project anywhere you want.


    If you need any more help you can just post here and ask.
     
  13. Tezelian

    Tezelian

    Joined:
    Oct 22, 2013
    Posts:
    256

    Ok thanks so much Matt when I purchase and download it mid/late January I'l let you
     
  14. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    Version 1.4 has been submitted to the Asset store for both versions

    Not a lot of changes:

    -The main script now has a public function you can call "InteruptQTE()" that will halt and cancel out any QTE's that are currently active.
    -Optimizations to the main script, such as most of the update() based timers have been replaced with Coroutine yield timers, I believe these are more efficient.
    -Fixed a Null error bug when using the delay timer with multi-button QTE’s
     
  15. danielwright2311

    danielwright2311

    Joined:
    Apr 11, 2014
    Posts:
    5
    Ok, so I bought your qte system because I am new to scripting with unity, I can code well in other languages but am new to c and java so I bought your cool system. I am A little lost and need your help in order for my game to work right and this is what I need.

    When I trigger a event I need a sound to play once, and one more thing, I need "a" to make b=1, what I mean?

    I am making it a kids game, picking up each letter in the alphabet in order and only in order to each other.

    The letter B can not be picked up unless it =1, only letter a =1 and nothing else till letter a is picked up then letter b will=1

    and so on with each letter, this way the other letters can not be picked up unless the latter letter is .


    I got two events to happen real simple, I love this, thanks for any help.
     
    Last edited: Apr 22, 2014
  16. danielwright2311

    danielwright2311

    Joined:
    Apr 11, 2014
    Posts:
    5
    bump for help
     
  17. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    Attached below is a new response script that plays back a sound effect. You can choose when the sound effect plays, and set weather it's repeatable (plays every time the QTE is triggered), or other wise it plays only once the first time.
    And like the rest of the response scripts.. you can attach multiple copies of the script to have different sound effects play during different conditions.
    Note that you need an Auto source component attached to the trigger to make sound effects play.

    As for your other requirement. My suggestion is that internally in code you use a numerical value that represents the alphabetical letters. (A=1,B=2,C=3 etc...)
    Your player script will have a single integer to keep track of what the last letter he picked up was.
    When they try to pick up a letter, check to see if the value of that letter is +1 to the last one they picked up. If it's not he can't pick it up because its not the next one in the sequence. If it is they pick it up, and then add +1 to the tracker, so now he needs to get the next one in the sequence.

    Hopefully that helps you out.


    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class QTE_Response_SFX : MonoBehaviour
    5. {
    6.         //the sound effect to play
    7.         public AudioClip SoundFX;
    8.         //if Repeatable is true plays every time the QTE is triggered, false only plays the first time.
    9.         public bool Repeatable;
    10.         private bool HasBeenTriggered;
    11.  
    12.         //when the sfx should play
    13.         public bool DuringActive;
    14.         public bool OnCompleted1;
    15.         public bool OnCompleted2;
    16.         public bool OnCompleted3;
    17.         public bool OnCompleted4;
    18.         public bool OnFail;
    19.  
    20.         private QTE_main MainScript;
    21.  
    22.         // Use this for initialization
    23.         void Start ()
    24.         {
    25.        
    26.                 MainScript = GameObject.Find ("QTE_Texture").GetComponent<QTE_main> ();
    27.        
    28.         }
    29.  
    30.         //function that actually plays the SFX
    31.         void PlaySFX ()
    32.         {
    33.             //check to see if the SFX has already been trigged.
    34.                 if (!HasBeenTriggered) {
    35.                        
    36.                         //if it hasn't play it
    37.                         audio.PlayOneShot (SoundFX);
    38.        
    39.                     //if the sound effect is not repeatable, set HasBeenTriggered to true so the sound effect will never play again.
    40.                         if (!Repeatable) {
    41.                                 HasBeenTriggered = true;
    42.                         }
    43.                 }
    44.         }
    45.    
    46.         // Update is called once per frame
    47.         void Update ()
    48.         {      
    49.                 if (MainScript.TriggeringObject == this.gameObject) {      
    50.  
    51.                         if (DuringActive) {
    52.                                 //while the QTE is happening
    53.                                 if (MainScript.QTEactive) {
    54.                     PlaySFX ();
    55.                                 }
    56.                         }
    57.  
    58.                         if (OnCompleted1) {
    59.                                 //if the QTE completed, and he succedded with option 1
    60.                                 if (MainScript.succeeded  MainScript.QTECompleted  !MainScript.QTEactive) {
    61.                     PlaySFX ();
    62.                                 }
    63.                         }
    64.  
    65.                         if (OnCompleted2) {
    66.                                 //if the QTE completed, and he succedded with option 2 (Dual QTE only)
    67.                                 if (MainScript.succeeded2  MainScript.QTECompleted  !MainScript.QTEactive) {
    68.                     PlaySFX ();
    69.                                 }
    70.                         }
    71.  
    72.                         if (OnCompleted3) {
    73.                                 //if the QTE completed, and he succedded with option 3 (Tri QTE only)
    74.                                 if (MainScript.succeeded3  MainScript.QTECompleted  !MainScript.QTEactive) {
    75.                     PlaySFX ();
    76.                                 }
    77.                         }
    78.  
    79.                         if (OnCompleted4) {
    80.                                 //if the QTE completed, and he succedded with option 4 (Quad QTE only)
    81.                                 if (MainScript.succeeded4  MainScript.QTECompleted  !MainScript.QTEactive) {
    82.                     PlaySFX ();
    83.                                 }
    84.                         }
    85.  
    86.                         if (OnFail) {
    87.                                 //if the QTE completed, and he failed
    88.                                 if (!MainScript.succeeded  !MainScript.succeeded2  !MainScript.succeeded3  !MainScript.succeeded4  MainScript.QTECompleted  !MainScript.QTEactive) {
    89.                
    90.                                         if (MainScript.WrongButtonFail) {
    91.                         PlaySFX ();
    92.                                                 //If failed due to pressing the wrong button
    93.                                         } else {
    94.                         PlaySFX ();
    95.                                                 //if failed due to the timer finishing.
    96.                                         }
    97.                                 }
    98.                         }
    99.                 }
    100.        
    101.         }
    102. }
    103.  
     
  18. danielwright2311

    danielwright2311

    Joined:
    Apr 11, 2014
    Posts:
    5
    Thank you for your help, much appreciated.
     
  19. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    Finally got around to releasing this long overdue update.

    v1.5 available now, v1.6 currently in progress that will have mobile devices supported.

    I recommend reading the "Upgrade Notes" section in the documentation if you are going to upgrade from a previous version of this system.

    Video Demonstration of the demo scene


    What's new in 1.5
    • Entire system updated to use Unity new uGUI system, old legacy GUI support dropped. Minimum required version is now Unity 4.6, package also submitted with Unity 5.4.3
    • The Mesh based billboard functionality has been removed, Unity's world space Canvas can be used to accomplish the same effect.
    • Main QTE script is now a singleton, better way of accessing it rather than constantly using Gameobject.Find() in every script that needs to access the main script.
    • General optimization overhaul of the code base. (for example base class, using arrays instead of separate declared variables, Cleaner syntax for response scripts (old scripts still work), other misc. cleanups)
    • System now no longer Instantiates and Destroys objects, Necessary gameobjects are set up in the scene at the start, and when no longer needed they are disabled. more memory efficient.
    • New demo scenes for both Unity 4 and Unity 5
    • New example UI sprites
    • QTE Combo script added to add combo functionality
    • In the triggering script, you no longer have to manually type in a name to use a button defined in the Input manager, instead a drop down list is presented
    • Now any axes defined in the input manager can be used in a QTE, not just the vertical/horizontal axes, and you can choose the threshold the axis must reach to succeed.
    • Along with choosing an any axis, you can choose to detect another axis at the same time to also fail the QTE
    • Wiping Circle Timer Visualization added
    • Fade in buttons option added
    • Mashing Visualization
    Bug Fixes:
    -Calling QTE manually fixed
    -World space UI buttons now can shake and pulsate, previous method of using mesh billboards did not.
    -Fixed a bug where odd behavior would happen after a mashable QTE was completed (Responses triggering twice for example)
    -Fixed a bug where Multi-timer QTEs Buttons would stop disappearing correctly
    -Fixed a bug where Mult-button QTEs would sometimes disappear if a multi-timer QTE was completed previously.
    -When the randomize option is checked, it will now also choose axes along with buttons.
    -QTE triggers that are prefabs now retain their modified settings when hitting play.
     
  20. HotSofaGames

    HotSofaGames

    Joined:
    Jul 6, 2017
    Posts:
    1
    Will it be updated to 1.6 anytime soon?
     
  21. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    I don't have a specific ETA on 1.6, I will be returning to work on it this weekend after a bit of a break. I have already gotten a lot of mobile functionality working. But not all of it that I wish to have working for the next update.

    Tap, Tap & Hold, Swipe, Mashing, and Pressure Sensitivity is all working, but only with a single QTE button. Need to get it working with 2-4 buttons. I think I will be holding off trying to get Accelerometer/Gryoscope detection along with Pinching and other gestures until the next release.

    If you are interested in a specific moblie input/feature you want to use. Let me know and I can see if I can get it into 1.6 at least.
     
  22. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    hey there
    is there any news about mobile version procces matt??
     
  23. adrian6800

    adrian6800

    Joined:
    Jan 29, 2018
    Posts:
    1
    Thank you for your QTE ,system is vary nice.
    I am very excited about the QTE of mobile devices :)
    i hope you will make this system.
     
  24. oprishka

    oprishka

    Joined:
    Feb 26, 2017
    Posts:
    5
    any example how use with QTE kill ? if i need kill
     
  25. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    QTE_main.singleton.InteruptQTE()

    Call that once and any active QTEs will be killed.
     
  26. oprishka

    oprishka

    Joined:
    Feb 26, 2017
    Posts:
    5
    can you make simple tutorial please ((( o make game like lust of us and i need this QTE (((
     
  27. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    The documentation that comes with the system explains how to set it up, or you can modify a trigger that is already set up inside the demo scene.

    But a simple breakdown of how to get started:
    1. Drag the "QTE_main" prefab into the scene found here. "\QTE_System\Prefabs"
    2. Create a Canvas in the scene
      Here's a Tutorial on UI Canvas
    3. Drag the "QTE_UI" prefab into the scene as a child of the Canvas, found here. "\QTE_System\Prefabs"
    4. Assign the Canvas to the "Default Canvas" property on the "QTE_Main" prefab
    5. Assign "QTE_System\Sprites\QTE_Images_Asset.asset" to the "QTE Images Asset" property on the "QTE_Main" prefab
    6. Create an empty gameobject, Attach a box collider to it and set "is Trigger" to true
    7. Attach the script "QTE_Trigger " to that new gameobject, and configure it how you like. It can be found here "\QTE_System\Scripts\Triggers"
    8. Finally, attach response scripts to the new gameobject to have actions in response to the Quick Time event found here "\QTE_System\Scripts\Responses"
    9. You will need to have then some type of Player Controller walk into the box collider to trigger the QTE to happen when playing.
     
  28. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    Hello
    I remember you were talked about the mobile version once in about 1 and half a year ago
    Any progress on that?
    Or its an abandoned feauter add-on?
    Let us know please
    Thanks in advance
     
  29. Tukata

    Tukata

    Joined:
    Apr 28, 2021
    Posts:
    1
    Ahh Hello
    I ran into an issue where Mecanim Animation couldn't Get All Parameters.

    Debug says : NullReferenceException: Object reference not set to an instance of an object QTE_Response_MecanimAnimation_Edtior.OnEnable () (at Assets / QTE_System / Editor / QTE_Response_MecanimAnimation_Edtior).

    Please guide me
    Thank
     

    Attached Files:

  30. Matt3D

    Matt3D

    Joined:
    Apr 12, 2013
    Posts:
    32
    So the error I believe is the fact that that script cannot find an Animator component attached to gameobject specified in the Object To animate field

    Attached is a modified version of that script that has an error check to make sure there is one attached. Try that out.
     

    Attached Files: