Difference between revisions of "HowTo:Edit Communications"

From VsWiki
Jump to: navigation, search
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
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 [http://sourceforge.net/p/vegastrike/code/HEAD/tree/trunk/data/communications/ data/communications].
+
In-game communications (unit-to-unit chat) are implemented as finite state machine - each state has a set of possible nodes, each node has a text and deltaRelation value. Conversation are faction-dependent and are defined by XML files in [http://sourceforge.net/p/vegastrike/code/HEAD/tree/trunk/data/communications/ data/communications].
  
==Nodes: default positions and values==
+
==Nodes basics==
 
Their default positions and purpose we can see in [http://sourceforge.net/p/vegastrike/code/HEAD/tree/trunk/vegastrike/src/cmd/ai/communication.cpp#l10 the function creating the default set] and following ones. It have only basic text and relationship adjustment values:
 
Their default positions and purpose we can see in [http://sourceforge.net/p/vegastrike/code/HEAD/tree/trunk/vegastrike/src/cmd/ai/communication.cpp#l10 the function creating the default set] and following ones. It have only basic text and relationship adjustment values:
  

Latest revision as of 06:50, 3 March 2014

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

Nodes basics

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 On being udocked. 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 docking operations
N-14 "Docking operation begun." 0 docking operations
N-13 "Clearance denied." 0 docking operations
N-12 "Clearance granted." 0 docking operations
N-11 "No." 0 rejecting FG order
N-10 "Yes." 0 obeying FG order
N-9 "Prepare To Be Searched. Maintain Speed and Course." 0 contraband scan
N-8 "No contraband detected: You may proceed." 0 contraband scan
N-7 "Contraband detected! All units close and engage!" 0 contraband scan Usually is set to -.125 or so. It's in addition to hardcoded "close and engage!" orders and relations.

See also variables - AI/ContrabandMadness, etc.

N-6 "Your Course is deviating! Maintain Course!" 0 contraband scan The patrol also gets upset.
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> ... </edge> -- connection to other nodes. Typically, there are 3 (good-neutral-bad) entries at the top level.
      • index [int] - linked node's number.
    • <sound> ... </sound> -- 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.