• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Cinematic Log

  • Like
Reactions: deepstrasz
1zybnd1.png


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.

JASS:
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

JASS:
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<<



  • 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
20:36, 27th Jun 2014 PurgeandFire: (old) Review (minor fix, PM me when ready): http://www.hiveworkshop.com/forums/2547383-post10.html Approved!

Moderator

M

Moderator

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

Approved!
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
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.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
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
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
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
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
a bit slicker function:

JASS:
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
 
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.
 
Top