Announcement

Collapse
No announcement yet.

Triggered Messages

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

  • Triggered Messages

    Hello People of TG,

    I wanted to post this script because I personally enjoy seeing it in my missions. The script that I have in my few missions; types a message across the screen every time someone joins the server. The message only displays for that person and wont play for everyone across the server. The script helps bring a slightly more cinematic feel to missions. I found the script over at the Bohemia Interactive Forums, by Kylania. The script is what BI used in their campaign, and so if you have played the ARMA 3 campaign you might recognize it. You can find the original forum thread here: https://forums.bistudio.com/topic/15...ered-messages/ .

    The script below is the one I have in my init.sqf. It plays upon joining the server, however, it is possible to set this up so it is triggered within a mission. If you want to trigger this kind of message check out that forum post at BI forums.


    Bis_printText =
    {
    private["_blocks","_block","_blockCount","_blockNr","_bloc kArray","_blockText","_blockTextF","_blockTextF_", "_blockFormat","_formats","_inputData","_processed TextF","_char","_cursorBlinks","_cursorInvis"];
    hint "in";
    _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;

  • #2
    Re: Triggered Messages

    Thanks for adding to the script bin Shawn.

    Current ARMA Development Project: No Current Project

    "An infantryman needs a leader to be the standard against which he can judge all soldiers."

    Friend of |TG| Chief

    Comment

    Connect

    Collapse

    TeamSpeak 3 Server

    Collapse

    Advertisement

    Collapse

    Twitter Feed

    Collapse

    Working...
    X