Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:all-features:dialogue-tree [2019/10/26 18:04]
blurymind [The basic life cycle of a dialogue]
gdevelop5:all-features:dialogue-tree [2020/08/29 18:46] (current)
cacodemon
Line 42: Line 42:
 ## 1. Text line type ## 1. Text line type
 The text is what the user will see displayed when they reach the dialogue branch it is on. If you don't put any special wrappers of the other type around your text - it will remain ordinary text. Yarn will give you a hint when that is not the case by changing its colour. ​ The text is what the user will see displayed when they reach the dialogue branch it is on. If you don't put any special wrappers of the other type around your text - it will remain ordinary text. Yarn will give you a hint when that is not the case by changing its colour. ​
- 
-<note important>​ It is worth noting that while Yarn supports editing bbcode tags, the proper rendering of bbcode is not yet supported in Gdevelop, but it is a planned feature.</​note>​ 
  
 <​note>​New lines are interpreted by yarn as logical pauses between two text line types. So whenever you write text on a new line - that is also used to tell the game engine to start printing the text on the new line after the player has pressed a button. Of course that behaviour is entirely optional and depends on how you use the  extension. Since it is the most common one, it should be noted that it is there by design.</​note>​ <​note>​New lines are interpreted by yarn as logical pauses between two text line types. So whenever you write text on a new line - that is also used to tell the game engine to start printing the text on the new line after the player has pressed a button. Of course that behaviour is entirely optional and depends on how you use the  extension. Since it is the most common one, it should be noted that it is there by design.</​note>​
Line 142: Line 140:
 <note important>​ Avoid using options that contain a link to a non existent node or no link at all. That may cause the extension to crash your game</​note>​ <note important>​ Avoid using options that contain a link to a non existent node or no link at all. That may cause the extension to crash your game</​note>​
  
 +**Gotchas to watch out for:
 +**
 +If you try to do conditional options like this:
 + <​code>​
 +Ok kids we're gonna go with...
 +[[Actually, I'm not sure yet...|NotSure]]
 +<<if $robot_head_0_done == 1>>
 +[[Frog Head|PickRobotMascot0]]
 +<<​endif>>​
 +</​code>​
 +
 +Yarn will send the player to "​NotSure"​ instead of displaying this as two options, even when the if is true.
 +The correct way to do this would be:
 +
 +<​code>​
 +Ok kids we're gonna go with...
 +<<if $robot_head_0_done == 1>>
 +[[Actually, I'm not sure yet...|NotSure]]
 +[[Frog Head|PickRobotMascot0]]
 +<<​else>>​
 +[[Actually, I'm not sure yet...|NotSure]]
 +[[Bird Head|PickBirdMascot0]]
 +<<​endif>>​
 +</​code>​
 +
 +If you want to just send the player to another node (PickRobotMascot0) without displaying any options when the if statement is true, you can do:
 +<​code>​
 +Ok kids we're gonna go with...
 +<<if $robot_head_0_done == 1>>
 +[[Frog|PickRobotMascot0]]
 +<<​else>>​
 +[[Actually, I'm not sure yet...|NotSure]]
 +[[Bird Head|PickBirdMascot0]]
 +<<​endif>>​
 +</​code>​
 +
 +----
 +
 +## Known issues:
 +
 +*  Using a -> shortcut crashes my game - This is a known bug in bondage.js - the library that the dialogue tree extension is using to parse yarn files. See [[https://​github.com/​hylyh/​bondage.js/​issues/​31]] to check if that has been fixed. The reason it happens is that bondagejs expects you to indent any linked text with tabs, otherwise its seen as a syntax error. If you want to use the shortcut syntax, please refer to this example json file as  to howto do it without crashing the parser [[https://​github.com/​hylyh/​bondage.js/​blob/​master/​tests/​yarn_files/​shortcuts.json]]
 +
 +* an empty space is clipped from text that comes after <<​command>>​ - this is a known bug in bondagejs [[https://​github.com/​hylyh/​bondage.js/​issues/​61]]
 +
 +<note important>​If you ever encounter an issue  that in its message mentions the file **bondage.min.js** , it is more than likely that it's an issue with the library. Please report it at the bondagejs git tracker, not gdevelop'​s [[https://​github.com/​hylyh/​bondage.js/​issues/​]]</​note>​
 +
 +* I encountered a problem while using Yarn to edit my dialogue - If that happens, unless you have encountered the problem when opening or saving your dialogue - it's likely a bug in Yarn, not Gdevelop.
  
 +<note important>​To report Yarn editor bugs, please use the Yarn bug tracker, where more developers working on Yarn will see it. 
 +[[https://​github.com/​YarnSpinnerTool/​YarnEditor]]</​note>​
  
-## Useful links:+* I encountered a problem with the styling of the text coming from the Dialogue Tree - If that happens, it's likely a bug with another extension. If you are using the BBcode extension, and for example underlined text style does not work or some combination of styles does not work, the problem more than likely lies with the pixi-multistyle-text library that it is using. It is also worth noting that **pixi currently does not support __text underlining__ style in general. So while you can see it in Yarn editor, it will not work in your game**.
  
-Official documentation and tutorials for yarn: +<note important>​To report pixi-multistyle-text bugs, please use the tracker below: [[https://​github.com/​tleunen/pixi-multistyle-text]]</​note>​
-[[ https://​github.com/​YarnSpinnerTool/YarnSpinner/​blob/​master/​Documentation/​YarnSpinner-Dialogue/​README.md]]+
  
-General usage: 
-[[https://​github.com/​YarnSpinnerTool/​YarnSpinner/​blob/​master/​Documentation/​YarnSpinner-Dialogue/​General-Usage.md]] 
  
-Syntax doc: 
-[[https://​github.com/​YarnSpinnerTool/​YarnSpinner/​blob/​master/​Documentation/​YarnSpinner-Dialogue/​Yarn-Syntax.md]] 
  
 ---- ----
Line 329: Line 371:
 tag name - The tag name to check for tag name - The tag name to check for
  
-* **Branch title has been visited ​before**+* **Branch title has been visited**
  
-Check if the current ​branch has been visited ​before+Check if branch ​title has been visited ​by the player in the past. This becomes true upon that node's visitation. Use this to trigger events in your game, based on what the player has read without the need to set and get yarn state variables.
  
 Parameters Parameters
  
-branch title - The branch title to check if it has been visited before, when the player visits it.+branch title - The branch title to check for being visited before.
  
 * **Compare dialogue state variable** * **Compare dialogue state variable**