In-game Subtitles guide step-to-step

HOW TO PUT SUBTITLES IN A GAME??
Probably you already know how to do but this is a guide anyway so OK.

Step 1:
subtitles block:

add a big (dark is better) block where we will add behaviors

Step 2:
alpha logic:

add 2 inputs (mailboxes in the example) and a label. Inputs send 2 (inputs): if the input is "show sbtitles the block alpha and the òabel alpha will be setted on 100%, if the input is "hide subtitles the alpha will be 0. (note: better to set alpha on 0 once).

Step 3:
text in the list

add a “text list” object and write in it the subtitles in order, or use a “list modify” block to add em during the game.

Step 4:
use the text list

add the input "next subtitle (another mailbox block in the example) to add 1 to a number, trought another (value 1) number block and then connect it with the “one” list input.

Step 5:
send the text list

connect the “one” list output with the “text” label input

done.
Hope this was useful. If ya have any question, ask me.

Also, this is the example game i made and you can copy and paste code from there.

Or copy the direct code (where i added the list modify block and other outputs):

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":4,"outputCount":2,"name":"subtitles example","behaviorType":"logic.NodeGroup","x":-90,"y":-320,"group":"","id":"cba00595e4ed3c4e","isMenuItem":true,"originBundleId":null,"ownBundleId":null,"originPk":null,"v":2,"version":2},{"inputCount":7,"outputCount":5,"name":"Text List","behaviorType":"logic.data.TextList","x":450,"y":96,"group":"cba00595e4ed3c4e","id":"cb8faf70a8ef834f","startVal":["subtitle 1","subtitle 2","subtitle 3","subtitle 4","subtitle 5"],"copy":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-180,"y":-160,"group":"cba00595e4ed3c4e","id":"cb8fc05c85f2b649","startVal":0,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-180,"y":-48,"group":"cba00595e4ed3c4e","id":"cb90afd5a596304d","startVal":100,"tag":"","roundMode":1},{"inputCount":4,"outputCount":4,"name":"Label","behaviorType":"logic.hud.Label2","x":630,"y":-112,"group":"cba00595e4ed3c4e","id":"cb91f6fe4b75fe4f","text":"Label","textColor":6264506,"fontName":"oduda","scale":10,"textAlign":"left","maxWidth":0,"xO":61,"yO":300,"pin":false,"alpha":100,"kerning":0,"outlineColor":0,"outlineSize":0,"weight":0,"outlineBlur":0,"lineHeight":1,"ext":false},{"inputCount":1,"outputCount":1,"name":"Alpha","behaviorType":"logic.properties.Alpha","x":0,"y":-256,"group":"cba00595e4ed3c4e","id":"cb922adcd3aa6e46"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":0,"y":112,"group":"cba00595e4ed3c4e","id":"cb93ac37e7cf474e","startVal":1,"tag":"","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":112,"group":"cba00595e4ed3c4e","id":"cb93dce08f5ef340","startVal":0,"tag":"","roundMode":1},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-360,"y":-160,"group":"cba00595e4ed3c4e","id":"cba06b1bceea3c41","portId":"cba00595e4ed3c4ei0","tag":"show","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-360,"y":-32,"group":"cba00595e4ed3c4e","id":"cba07219fe58244d","portId":"cba00595e4ed3c4ei1","tag":"hide","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-180,"y":128,"group":"cba00595e4ed3c4e","id":"cba0b454b041d34b","portId":"cba00595e4ed3c4ei2","tag":"next","dataType":2},{"inputCount":3,"outputCount":1,"name":"Text List Modify","behaviorType":"logic.data.ListModify","x":270,"y":256,"group":"cba00595e4ed3c4e","id":"cba0e10c5bdae043","mode":1,"copy":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":0,"y":240,"group":"cba00595e4ed3c4e","id":"cba10c148e8ad342","portId":"cba00595e4ed3c4ei3","tag":"new","dataType":2},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":180,"y":48,"group":"cba00595e4ed3c4e","id":"cba139b7ea388e47","resetOnLevelStart":false},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":360,"y":-224,"group":"cba00595e4ed3c4e","id":"cba19c856f0ed84b","portId":"cba00595e4ed3c4eo0","tag":"actual","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":360,"y":-96,"group":"cba00595e4ed3c4e","id":"cba1a3f03a288c41","portId":"cba00595e4ed3c4eo1","tag":"alpha","dataType":2}],"links":[{"input_id":"cba0e10c5bdae043i0","output_id":"cb8faf70a8ef834fo0"},{"input_id":"cb91f6fe4b75fe4fi0","output_id":"cb8faf70a8ef834fo1"},{"input_id":"cb922adcd3aa6e46i0","output_id":"cb8fc05c85f2b649o0"},{"input_id":"cb91f6fe4b75fe4fi1","output_id":"cb8fc05c85f2b649o0"},{"input_id":"cba1a3f03a288c41i0","output_id":"cb8fc05c85f2b649o0"},{"input_id":"cb91f6fe4b75fe4fi1","output_id":"cb90afd5a596304do0"},{"input_id":"cba1a3f03a288c41i0","output_id":"cb90afd5a596304do0"},{"input_id":"cb93dce08f5ef340i2","output_id":"cb93ac37e7cf474eo0"},{"input_id":"cba19c856f0ed84bi0","output_id":"cb93dce08f5ef340o0"},{"input_id":"cb8faf70a8ef834fi3","output_id":"cb93dce08f5ef340o0"},{"input_id":"cb90afd5a596304di1","output_id":"cba06b1bceea3c41o0"},{"input_id":"cb8fc05c85f2b649i1","output_id":"cba07219fe58244do0"},{"input_id":"cb93ac37e7cf474ei1","output_id":"cba0b454b041d34bo0"},{"input_id":"cb8faf70a8ef834fi0","output_id":"cba0e10c5bdae043o0"},{"input_id":"cba0e10c5bdae043i2","output_id":"cba10c148e8ad342o0"},{"input_id":"cb8faf70a8ef834fi2","output_id":"cba139b7ea388e47o0"}],"frames":[]}}}```
1 Like

version 0.2!

image

Added “start”, “pause” and “delay” inputs!!

New inputs:

  • START
    Now the subtitles switch is automated, so if you activate this input a timer, and at the end of this timer the next subtitle will be outputted.

  • PAUSE
    Pause the timer, so maybe if the player clicks on a button, the timer will be paused, and the subtitle will be paused too. So the player can read it will calm.

  • DELAY
    The delay input will change the timer durate.
    The default value is 20 th/seconds (so 2 seconds).

New outputs:

  • DONE
    This output is actived when ALL the text in the list is outputted.

  • NEXT
    This will the outputted when ONLY ONE text line is outputted.

All inputs:

  • DELAY
    The delay input will change the timer durate.
    The default value is 20 th/seconds (so 2 seconds).

  • START
    Now the subtitles switch is automated, so if you activate this input a timer, and at the end of this timer the next subtitle will be outputted.

  • PAUSE
    Pause the timer, so maybe if the player clicks on a button, the timer will be paused, and the subtitle will be paused too. So the player can read it will calm.

  • NEXT
    Go to the next list item, works like the timer, but doesn’t repeat and is manual.

  • NEW
    Insert a new subtitle in the list, can be used for subtitles generated on the spot.

  • SHOW
    Set the subtitles alpha on 100%.

  • HIDE
    Set the subtitles alpha on 0%.

All outputs:

  • ALPHA
    Outputs the object alpha (0 if is invisible, 100 if is visible)

  • NEXT
    Activated when a single text line is outputted from the “text” output

  • TEXT
    Outputs the subtitle text. At the end of the list, will output nothing.

  • DONE
    Activated when the list outputs the last item

  • ONE
    The actual subtitle string number. (for example, if the game is outputting the 3rd text line of the list, this output’s value will be 3).

And here’s the code to paste directly in your game:

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":7,"outputCount":5,"name":"subtitles example","behaviorType":"logic.NodeGroup","x":90,"y":-608,"group":"","id":"19a9bb2788e96e4c","isMenuItem":true,"originBundleId":null,"ownBundleId":null,"originPk":null,"v":2,"version":2},{"inputCount":7,"outputCount":5,"name":"Text List","behaviorType":"logic.data.TextList","x":540,"y":144,"group":"19a9bb2788e96e4c","id":"19a9bb2641062f4a","startVal":["subtitle 1","subtitle 2","subtitle 3","subtitle 4","subtitle 5"],"copy":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":450,"y":496,"group":"19a9bb2788e96e4c","id":"19a9bb277f91c44a","startVal":0,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":450,"y":608,"group":"19a9bb2788e96e4c","id":"19a9bb27853b2b45","startVal":100,"tag":"","roundMode":1},{"inputCount":1,"outputCount":1,"name":"Alpha","behaviorType":"logic.properties.Alpha","x":270,"y":-128,"group":"19a9bb2788e96e4c","id":"19a9bb2712e74e48"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":90,"y":160,"group":"19a9bb2788e96e4c","id":"19a9bb27070df044","startVal":1,"tag":"","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":270,"y":176,"group":"19a9bb2788e96e4c","id":"19a9bb27c2432040","startVal":0,"tag":"","roundMode":1},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":270,"y":496,"group":"19a9bb2788e96e4c","id":"19a9bb28ec206748","portId":"19a9bb2788e96e4ci5","tag":"show","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":270,"y":624,"group":"19a9bb2788e96e4c","id":"19a9bb29cfca3e4c","portId":"19a9bb2788e96e4ci6","tag":"hide","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-180,"y":272,"group":"19a9bb2788e96e4c","id":"19a9bb29f38c654c","portId":"19a9bb2788e96e4ci3","tag":"next","dataType":2},{"inputCount":3,"outputCount":1,"name":"Text List Modify","behaviorType":"logic.data.ListModify","x":360,"y":304,"group":"19a9bb2788e96e4c","id":"19a9bb292bec8247","mode":1,"copy":false},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":90,"y":272,"group":"19a9bb2788e96e4c","id":"19a9bb2965e81248","portId":"19a9bb2788e96e4ci4","tag":"new","dataType":1},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":180,"y":48,"group":"19a9bb2788e96e4c","id":"19a9bb298936df45","resetOnLevelStart":false},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":540,"y":320,"group":"19a9bb2788e96e4c","id":"19a9bb2947a3ed48","portId":"19a9bb2788e96e4co4","tag":"one","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":450,"y":-48,"group":"19a9bb2788e96e4c","id":"19a9bb29e12a0a45","portId":"19a9bb2788e96e4co0","tag":"alpha","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":1260,"y":112,"group":"19a9bb2788e96e4c","id":"19a9bb293f65aa43","portId":"19a9bb2788e96e4co2","tag":"text","dataType":1},{"inputCount":3,"outputCount":2,"name":"Timer","behaviorType":"logic.triggers.Timer","x":-180,"y":96,"group":"19a9bb2788e96e4c","id":"19aac7a9631eec46","delay":20,"count":0,"v":3,"version":3},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-360,"y":128,"group":"19a9bb2788e96e4c","id":"19aaf27c85814141","portId":"19a9bb2788e96e4ci1","tag":"start","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-360,"y":16,"group":"19a9bb2788e96e4c","id":"19ab1cfe96b33c4c","portId":"19a9bb2788e96e4ci0","tag":"delay","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-360,"y":240,"group":"19a9bb2788e96e4c","id":"19ae62f088b45d4a","portId":"19a9bb2788e96e4ci2","tag":"pause","dataType":2},{"inputCount":1,"outputCount":1,"name":"Text List Count","behaviorType":"logic.data.ListCount","x":720,"y":160,"group":"19a9bb2788e96e4c","id":"19b17e665652f648"},{"gateVal":0,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter2","x":900,"y":240,"group":"19a9bb2788e96e4c","id":"19b1a5615d415b43"},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":1170,"y":240,"group":"19a9bb2788e96e4c","id":"19b224306fb2ce46","portId":"19a9bb2788e96e4co3","tag":"done","dataType":2},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":720,"y":64,"group":"19a9bb2788e96e4c","id":"19b57e875ca9bf4a","startVal":1,"tag":"","roundMode":1},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":900,"y":80,"group":"19a9bb2788e96e4c","id":"19b5a005a7217e4c","portId":"19a9bb2788e96e4co1","tag":"next","dataType":2},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":1080,"y":112,"group":"19a9bb2788e96e4c","id":"19be8377b3f97247","_startVal":1}],"links":[{"input_id":"19b17e665652f648i0","output_id":"19a9bb2641062f4ao0"},{"input_id":"19a9bb292bec8247i0","output_id":"19a9bb2641062f4ao0"},{"input_id":"19b57e875ca9bf4ai1","output_id":"19a9bb2641062f4ao1"},{"input_id":"19be8377b3f97247i2","output_id":"19a9bb2641062f4ao1"},{"input_id":"19a9bb2712e74e48i0","output_id":"19a9bb277f91c44ao0"},{"input_id":"19a9bb29e12a0a45i0","output_id":"19a9bb277f91c44ao0"},{"input_id":"19a9bb29e12a0a45i0","output_id":"19a9bb27853b2b45o0"},{"input_id":"19a9bb27c2432040i2","output_id":"19a9bb27070df044o0"},{"input_id":"19a9bb2641062f4ai3","output_id":"19a9bb27c2432040o0"},{"input_id":"19b1a5615d415b43i1","output_id":"19a9bb27c2432040o0"},{"input_id":"19a9bb2947a3ed48i0","output_id":"19a9bb27c2432040o0"},{"input_id":"19a9bb27853b2b45i1","output_id":"19a9bb28ec206748o0"},{"input_id":"19a9bb277f91c44ai1","output_id":"19a9bb29cfca3e4co0"},{"input_id":"19a9bb27070df044i1","output_id":"19a9bb29f38c654co0"},{"input_id":"19a9bb2641062f4ai0","output_id":"19a9bb292bec8247o0"},{"input_id":"19a9bb292bec8247i2","output_id":"19a9bb2965e81248o0"},{"input_id":"19a9bb2641062f4ai2","output_id":"19a9bb298936df45o0"},{"input_id":"19a9bb27070df044i1","output_id":"19aac7a9631eec46o0"},{"input_id":"19aac7a9631eec46i2","output_id":"19aaf27c85814141o0"},{"input_id":"19aac7a9631eec46i0","output_id":"19ab1cfe96b33c4co0"},{"input_id":"19aac7a9631eec46i1","output_id":"19ae62f088b45d4ao0"},{"input_id":"19b1a5615d415b43i0","output_id":"19b17e665652f648o0"},{"input_id":"19be8377b3f97247i0","output_id":"19b1a5615d415b43o0"},{"input_id":"19b224306fb2ce46i0","output_id":"19b1a5615d415b43o0"},{"input_id":"19be8377b3f97247i1","output_id":"19b1a5615d415b43o1"},{"input_id":"19b5a005a7217e4ci0","output_id":"19b57e875ca9bf4ao0"},{"input_id":"19a9bb293f65aa43i0","output_id":"19be8377b3f97247o0"}],"frames":[]}}}

END

Hope this little guide’s update was useful.
Byee.

1 Like