Warcraft III: MapsModelsSkinsIconsSpellsToolsTutorials
WC3 JASS: Code SnippetsJASS and vJASS Spells and SystemsJass Tutorials
Chat @Discord

Author Topic: [Snippet] Disable Transmission Skip  (Read 9074 times)

  • Rookie - level 1
  • *
  • Posts: 45
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 13
    • View Profile
[Snippet] Disable Transmission Skip
« on: July 02, 2013, 02:48:08 AM »
This library will allow you to disable/enable the feature that allows you to skip cinematic transmissions by pressing ESC. Some RPG's are ruined when other players press ESC during a cinematic because it skips the transmission for everyone. This neat script can prevent that.

Code: jass  [Select]
  1. library TransmissionSkip /* v.1.0.0.0
  2. ********************************************************************
  3. *
  4. *   The normal GUI cinematic functions allow you to skip
  5. *   transmissions by pressing ESC. This snippet will allow
  6. *   you to disable/enable that feature.
  7. *
  8. ********************************************************************
  9. *  
  10. *   Functions
  11. *
  12. *       DisableTransmissionSkip()
  13. *
  14. *           - Prevents players from skipping cinematic
  15. *             transmissions by pressing ESC.
  16. *
  17. *       EnableTransmissionSkip()
  18. *
  19. *           - Allows players to skip cinematic transmissions
  20. *             by pressing ESC, if you use the BJ/GUI functions.
  21. *
  22. ********************************************************************/
  23.  
  24.     function DisableTransmissionSkip takes nothing returns nothing
  25.         if bj_cineSceneBeingSkipped == null then
  26.             call TryInitCinematicBehaviorBJ()
  27.         endif
  28.         call DisableTrigger(bj_cineSceneBeingSkipped)
  29.     endfunction
  30.  
  31.     function EnableTransmissionSkip takes nothing returns nothing
  32.         if bj_cineSceneBeingSkipped == null then
  33.             return
  34.         endif
  35.         call EnableTrigger(bj_cineSceneBeingSkipped)
  36.     endfunction
  37.    
  38. endlibrary

Example code:
Example Code
Code: jass  [Select]
  1. scope Test initializer onInit
  2. /*
  3.     Implementing this code will disable skipping transmissions
  4.     until EnableTransmissionSkip() is called
  5. */
  6.     private function onInit takes nothing returns nothing
  7.         call DisableTransmissionSkip()
  8.     endfunction
  9. endscope

To use it, just create a new trigger and paste the code in there. If you do not have JNGP, then here is a JASS version:
Vanilla JASS Version
Code: jass  [Select]
  1. // TransmissionSkip Library
  2.    
  3.     function DisableTransmissionSkip takes nothing returns nothing
  4.         if bj_cineSceneBeingSkipped == null then
  5.             call TryInitCinematicBehaviorBJ()
  6.         endif
  7.         call DisableTrigger(bj_cineSceneBeingSkipped)
  8.     endfunction
  9.  
  10.     function EnableTransmissionSkip takes nothing returns nothing
  11.         if bj_cineSceneBeingSkipped == null then
  12.             return
  13.         endif
  14.         call EnableTrigger(bj_cineSceneBeingSkipped)
  15.     endfunction
  16.  
  17. // End TransmissionSkip Library

Simply paste that into the map header. To access the map header, open the trigger editor and click on the map name listed on the left. Paste the code there. Then you can make a trigger like so:

Trigger: Test 1630739253
   
           
  • My Trigger
  •     Events
  •         Map Initialization
  •     Conditions
  •     Actions
  •         Custom script:    call DisableTransmissionSkip()
           

And it should disable transmission skipping for the entire game until you call "EnableTransmissionSkip()". To disable it again, simply call "DisableTransmissionSkip()" again.

Credits to: Troll-Brain for the suggestion long ago to disable the trigger instead of doing it the odd way I did it before.
« Last Edit: August 14, 2013, 11:33:27 AM by Purgeandfire »

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
[Snippet] Disable Transmission Skip
« Reply #1 on: July 02, 2013, 11:58:46 AM »
I love this kind of scripts: small and straight to the point.

~Approved

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Rookie - level 1
  • *
  • Posts: 45
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 13
    • View Profile
[Snippet] Disable Transmission Skip
« Reply #2 on: July 02, 2013, 01:34:55 PM »
Thanks moyack :D

Yeah, I'm trying to remember all these little snippets that I used to use before I forget them. :P Oh and thanks for fixing the trigger for me.

 

[Snippet] Group Units in line, with distance and optional spread-value

Started by rvonsonsnadtzBoard Codes & Snippets

Replies: 5
Views: 12107
Last post March 13, 2013, 06:52:16 PM
by rvonsonsnadtz
[Snippet] Single Player Detector

Started by moyackBoard Codes & Snippets

Replies: 12
Views: 21804
Last post March 13, 2013, 12:48:49 PM
by Magtheridon96
[Snippet] Simple Unit Indexer

Started by moyackBoard Codes & Snippets

Replies: 17
Views: 27672
Last post September 30, 2013, 08:07:19 AM
by moyack
[Snippet] Timed Effects

Started by moyackBoard Codes & Snippets

Replies: 0
Views: 7870
Last post January 09, 2012, 07:03:32 PM
by moyack
[Snippet] Parabolic Function

Started by moyackBoard Codes & Snippets

Replies: 1
Views: 7457
Last post January 13, 2012, 12:11:45 PM
by Magtheridon96
Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena
  Mod DB - Change the Game Power of Corruption - A Warcraft III altered melee map Chaos Realm - The world of Game modders and wc3 addicts Follow us on Facebook!!