HowTo:Edit Communications

From VsWiki
Revision as of 05:43, 3 March 2014 by Tbeholder (talk | contribs) (Created page with "In-game communications (unit-to-unit chat) are implemented as conversation finite state machine - each state has a set of possible nodes, each node has a text and deltaRelation v...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In-game communications (unit-to-unit chat) are implemented as conversation finite state machine - each state has a set of possible nodes, each node has a text and deltaRelation value. They are defined by XML files in data/communications.

Nodes: default positions and values

Their default positions and purpose we can see in the function creating the default set and following ones. It have only basic text and relationship adjustment values:

# Node text Value Hardcoded Comment
0 "welcome to cachunkcachunk.com" 0 (starting node: Don't link here) Its edges list starting nodes (depending on relations).
1 "I love you!" +.1
2 "J00 0wnz m3" +.08
3 "You are cool!" +.06
4 "You are nice!" +.05
5 "Ya you're naled! NALED PAL!" -.02
6 "i 0wnz j00" -.08
7 "I hate you!" -.1
... Built-ins:
N-16 "Docking operation complete" 0 Dock/undock. usually set to 0.01 or so: you do business with them, they like you.
N-15 "Please move into a green docking box and press d." 0
N-14 "Docking operation begun." 0
N-13 "Clearance denied." 0
N-12 "Clearance granted." 0
N-11 "No." 0
N-10 "Yes." 0
N-9 "Prepare To Be Searched. Maintain Speed and Course." 0
N-8 "No contraband detected: You may proceed." 0
N-7 "Contraband detected! All units close and engage!" 0 Value is set to -.125 or so. The actual "engage" part is done via ship relations.
N-6 "Your Course is deviating! Maintain Course!" 0
N-5 "Request Clearance To Land." 0
N-4 0 (killed)
N-3 0 (dealt damage)
N-2 0 (got damaged)
N-1 "*hit*" -.2 (got hit) Not a communication, just reaction on damage. Still supports friendly/neutral/hostile edges.

XML schema description

  • <comm> ... </comm> -- Marks the beginning and end of the XML file.
  • <node> ... </node> -- basic data.
    • text [string] [""] - What they say.
      • (see above)
    • text1, etc [string] [""] - Variant text (to be chosen randomly).
    • relationship [float] [0.0] - relationship adjustment.
      • (see above)
    • <edge> ... </node> -- connection to other nodes. Typically, there are 3 (good-neutral-bad) entries at the top level.
      • index [int] - linked node's number.
    • <sound> ... </node> -- voice. Sound nodes corresponding to text, text1, etc are simply added in this order
      • file [string] [""] - OGG file name, relative to data ("communications/sounds/lihw/lihw_good-day.ogg")
      • gain [float] [1.0] - relative volume.
      • sex [unsigned small int] [0] - FIXME Support for variant sounds, doesn't seem to be used yet.