1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  4. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  5. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Cinematic Log

Submitted by Chaosy
This bundle is marked as approved. It works and satisfies the submission rules.
[​IMG]

This is a method I happend to develop while creating cinematics for my project. I found it very useful and as far as I know there is no existing system which does the same. So, when a player is in cinematic mode the dialog isn't added into the log. This is a work around to that problem. This should be very useful to most RPG maps and campaigns. (even though it can be a little troublesome in campaigns since they don't compile vjass)

Please note that you need JNGP which you can download here

Additionally, if you want to use game messages during your cinematic you need to put the message action after the transmission.


  • example
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Cinematic - Send transmission to (All players) from Archmage 0001 <gen> named Derp: Play No sound and display thingsToSay[(Random integer number between 1 and 5)]. Modify duration: Set to 2.00 seconds and Don't wait
      • Game - Display to (All players) the text: Press "esc" to exit...


Anyway, here's the actuall "system" if I may call it that.
triggers

Code (vJASS):
hook TransmissionFromUnitWithNameBJ msg

  • GUI function
    • Events
    • Conditions
    • Actions
      • Custom script: endfunction
      • Custom script: function msg takes force toForce, unit whichUnit, string unitName, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
      • Custom script: local string udg_text = message
      • Custom script: local unit udg_unit = whichUnit
      • Custom script: local force udg_force = toForce
      • Game - Display to force the text: (text + ( - + (Name of unit)))
      • Cinematic - Clear the screen of text messages for force

alternative trigger

Code (vJASS):
function msg takes force toForce, unit whichUnit, string unitName, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
    call DisplayTextToForce(toForce, message + " - " + GetUnitName(whichUnit))
    call ClearTextMessagesBJ( toForce )
endfunction

hook TransmissionFromUnitWithNameBJ msg

//make sure the function name is the same as hook TransmissionFromUnitWithNameBJ >>X<<



demo triggers

  • init test
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set thingsToSay[1] = I like to watch anime.
      • Set thingsToSay[2] = Have you seen my tame unicorn?
      • Set thingsToSay[3] = What an blue apple.
      • Set thingsToSay[4] = I'd love to visit France.
      • Set thingsToSay[5] = I think you need more salt.
      • Cinematic - Turn cinematic mode On for (All players)

  • Test
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Cinematic - Send transmission to (All players) from Archmage 0001 <gen> named Derp: Play No sound and display thingsToSay[(Random integer number between 1 and 5)]. Modify duration: Set to 2.00 seconds and Don't wait
      • -------- delete the action bellow if you want a cleaner log in the test map. --------
      • Game - Display to (All players) the text: Press "esc" to exit...

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Trigger - Turn off Test <gen>
      • Cinematic - Turn cinematic mode Off for (All players)



Keywords:
cinematic, trick, log, shadowing, hook, Chaosy
Contents

Just another Warcraft III map (Map)

Reviews
Moderator
20:36, 27th Jun 2014 PurgeandFire: (old) Review (minor fix, PM me when ready): http://www.hiveworkshop.com/forums/2547383-post10.html Approved!
  1. 20:36, 27th Jun 2014
    PurgeandFire: (old) Review (minor fix, PM me when ready):
    http://www.hiveworkshop.com/forums/2547383-post10.html

    Approved!
     
  2. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    campaigns can compile vJass with the "not currently working(for me at least)" campaign builder/compiler, or if you compile the map and import it in.

    However this is not really good thing. I can just use
    DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 0.1, message)
    and after that the transmission.

    I mean, this is not bad thing and I see the use for it, but you hook a potentionally non existant function. You are doing the hook, so you are the one responsible for providing the function msg for the user.
     
  3. GywGod133

    GywGod133

    Joined:
    Jul 16, 2012
    Messages:
    646
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    its look useful if GUI-friendly :/
     
  4. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,573
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    The thing is, I can't add more GUI.

    The hook is needed, and the first two lines in the "GUI function" is also needed. You can't replace it. The local variables is there so you can use the last two actions in GUI. Else I'd just use the alternative trigger, it's a little shorter.

    @edo
    I know that it is working, you can extract the map > save it > import it again but I said it was troublesome, not impossible :) Well it's existant if you copy the trigger :p
     
  5. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    I understand that hook here is necessary unless you want people to call custom script(I assume this is aimed at GUIers, which it most likely is), but you could also provide the msg function not in custom script but with the hook alltogether. Because if they forget to copy the function....oops some weird magic error goes off :D

    also you should state that this requires JNGP to work
     
  6. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,573
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    I agree, the best option would indeed to merge them together I'll actually change the alternative trigger to make that. Will update in a minute.
     
  7. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    a bit slicker function:

    Code (vJASS):

    function msg takes force toForce, unit whichUnit, string unitName, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 1, message + " - " + GetUnitName(whichUnit))
        //for the sake of one liners
        call ClearTextMessagesBJ( toForce )
    endfunction
     


    a bit more efficient solution, but whichever is fine
     
  8. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    that Category doesn't mention vJass though
     
  9. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,573
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    I wasn't able to select both vjass and gui.
     
  10. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    It is good, but you should edit your description to include "Requires JassNewGenPack (or JassHelper)" and note that "This will clear all messages displayed on the screen each time a transmission occurs". Some cinematics will use "Game - Display text message", so they should be aware that this system will automatically clear the screen of them.