Announcement

Collapse
No announcement yet.

Typing Message

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Typing Message

    Hello people,

    I wanted to share this script I am using to create a message across the screen. The script was found after much googling. I wanted something different than the simple "hint" message. The script bellow is in my init.sqf, on CO25 Operation Crosswalk. It makes it appear as if someone is typing a message across the screen. People who have played the campaign in ARMA 3 will recognize how the message performs, as Bohemia Interactive used this script within their missions. I found it on the BI forums by "Kylania." You can see it here: https://forums.bistudio.com/topic/15...ered-messages/ . I am by no part knowledgeable in scripting, but I am trying to learn as I go along. I am sure some of you who are much more attune to the ways of scripting will be able to use this in triggered events. I personally feel this type of message helps create a more cinematic experience within missions.

    CapS123

    Code:
    Bis_printText =
    {
        private["_blocks","_block","_blockCount","_blockNr","_blockArray","_blockText","_blockTextF","_blockTextF_","_blockFormat","_formats","_inputData","_processedTextF","_char","_cursorBlinks","_cursorInvis"];
        _blockCount = count _this;
    
        _invisCursor = "<t color ='#00000000' shadow = '0'>_</t>";
    
        //process the input data
        _blocks = [];
        _formats = [];
    
        {
            _inputData = _x;
    
            _block     = [_inputData, 0, "", [""]] call BIS_fnc_param;
            _format = [_inputData, 1, "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>", [""]] call BIS_fnc_param;
    
            //convert strings into array of chars
            _blockArray = toArray _block;
            {_blockArray set [_forEachIndex, toString [_x]]} forEach _blockArray;
    
            _blocks  = _blocks + [_blockArray];
            _formats = _formats + [_format];
        }
        forEach _this;
    
        //do the printing
        _processedTextF  = "";
    
        {
            _blockArray  = _x;
            _blockNr      = _forEachIndex;
            _blockFormat = _formats select _blockNr;
            _blockText   = "";
            _blockTextF  = "";
            _blockTextF_ = "";
    
            {
                _char = _x;
    
                _blockText = _blockText + _char;
    
                _blockTextF  = format[_blockFormat, _blockText + _invisCursor];
                _blockTextF_ = format[_blockFormat, _blockText + "_"];
    
                //print the output
                [(_processedTextF + _blockTextF_), 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
                playSound "click";
                sleep 0.08;
                [(_processedTextF + _blockTextF), 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
                sleep 0.02;
            }
            forEach _blockArray;
    
            if (_blockNr + 1 < _blockCount) then
            {
                _cursorBlinks = 5;
            }
            else
            {
                _cursorBlinks = 15;
            };
    
            for "_i" from 1 to _cursorBlinks do
            {
                [_processedTextF + _blockTextF_, 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
                sleep 0.08;
                [_processedTextF + _blockTextF, 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
                sleep 0.02;
            };
    
            //store finished block
            _processedTextF  = _processedTextF + _blockTextF;
        }
        forEach _blocks;
    
        //clean the screen
        ["", 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText;
    }; 
    
    // Your Message
    Bis_printSampleText =
    {
        [
            ["Abandoned Oil Platform, 2km off the Coast of Cap Thelos","<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"],
            ["NATO Staging Area","<t align = 'center' shadow = '1' size = '1.0'>%1</t><br/>"]
    
        ] spawn Bis_printText;
    };
    sleep 10;
    0 = [] call BIS_printSampleText;
    Last edited by Unkl; 07-01-2016, 02:02 PM. Reason: put in the code tags

  • #2
    Re: Typing Message

    For the love of BB please use the [code] tags on that garbley gook. And thanks for the post...I was looking for something like that!
    |TG-189th| Unkl
    ArmA 3 Game Officer
    Dean of Tactical Gamer University
    189th Infantry Brigade Member
    SUBMIT A RIBBON NOMINATION OR CONTACT AN ARMA ADMIN
    "We quickly advance in the opposite direction and take cover in a house on the SW side of town." - BadStache

    Comment

    Connect

    Collapse

    TeamSpeak 3 Server

    Collapse

    Advertisement

    Collapse

    Twitter Feed

    Collapse

    Working...
    X