HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Canceling Cinematics

07-07-2003, 12:19 AM#1
Guvante
I am currently making an RPG in my spare time, which is using quite a few cinematics (And considering it is multiplayer that could prove annoying) but I also figured out a way to cancel out of the cinematics, so here goes...

The first step in doing this is creating a special trigger
Code:
Events
     Player 1 cancels a cinematic
     Player 2 cancels a cinematic
     [repeat for number of players]
Conditions
Actions
    Set Canceled = True
Then replace ANY instance of a wait type event with this
Code:
Countdown Timer - Start TempTime as a One-shot timer that will expire in X seconds
Wait until (((Remaining time for (Last started timer)) Less than or equal to 0.00) or (Canceled Equal to True)), checking every 0.10 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        Canceled Equal to True
    Then - Actions
        Trigger - Run EndTrig (checking conditions)
        Skip remaining actions
    Else - Actions
This will have the effect of waiting X amount of seconds, you until someone hits escape, (whichever comes first), then if they did hit escape, it would run the corrisponding ending function (which is what you should replace EndTrig with

A few things to note tho, you need to be sure and set Canceled=False before every cinematic (and for redudancy, at the end of your "EndTrig" function) this way hitting escape during some random part of the game or to skip the first cinematic won't skip every cinematic, also note that is the text as it should read in the editor (w/o custom script), I would provide it in that format but I have yet to take the time to learn the array of functions that are availible in JASS, so I just use the World Editors way


Well I hope people find this as useful as I did, and I also hope that I will be able to finish my map so I can show some of the other fun concepts I made too :ggani:

Please reply with any findings/comments, and I will try to check back and read them