Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.




Introduced in

Version:1.30

Description

Description:This makes a unit
"
speak
" via
, using a speech bubble above
his
their head.
The bubble is only displayed if the
player
unit is in
range to
the given range, where they can hear it.
Alternatively, the unit can "emote"
. This
, which shows a text description of something the unit is doing
;
(useful when there
isn't an
is no appropriate animation
. The
, the emote is only displayed if the player is close enough
and is looking when the emote happens
).

Syntax

Syntax:[speaker, text, range,
<dimensions>
dimensions,
<emote?>
emote] call fn_vbs_speak
Parameters:
unit
  • Unit to speak / emote.
  • text: String -
text
  • Text of speech / emote
  • range: Number -

player
  • Player must be this close to hear the speech or see the emote.
    Note

that optics
  • : Optics magnification

IS
  • is taken into account for emotes, allowing them to be seen from further away.

  • dimensions: Array -
array
  • Array defining the size of the displayed bubble
.
  • :
    format: [lines, width_mult, font_mult]
bubble will
    • Bubble that hold this many lines of text vertically.
    • width_mult: Number -
default
    • Default bubble width is multiplied by this.
    • font_mult: Number -
default
    • Default font size is multiplied by this

Optional. If
    • (optional - if ommitted, or if an empty array is passed, defaults
will be
    • are used: [4, 1, 1])
  • emote
?
optional, default false.
  • If true, this is an emote, not speech (optional, default: false).
Return Value:Boolean -
was
Indicates whether the speech / emote was heard /
emote
seen
?
.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
[man1, "Good day to you sir! This is a speech bubble!", 50] call fn_vbs_speak;
Image Modified
[man1, "This is an emote. He is gesticulating wildly!", 20,[4, 1.2, 1], true] call fn_vbs_speak;
Image Modified

Additional Information

See also: fn vbs observation, fn vbs infobubble
Multiplayer:This is local in MP. It should be called on all clients if required.
Problems: 

Notes