Commands
In t-Plot, you can control the game using commands. Commands look like this:
<<wait 2>>
<<typing 4>>
Commands are not shown directly to the player; instead, they are used for actions like waiting or, for example, sending a "typing" status.
Chat Commandsβ
If you need to change the default values of wait
, time_for_status
, or reaction
for a specific message, or if the story requires a pause in the dialogue, sending a "typing" status, or changing the reaction to an unexpected user message, you can use the following commands:
wait
β
The wait
command pauses the dialogue for a specified number of seconds and then resumes it.
Example:
// Wait for 2 seconds
<<wait 2>>
typing
β
The typing
command sends the "typing" status for a specified number of seconds.
Example:
// Typing for 4 seconds
<<typing 4>>
upload_photo
β
The upload_photo
command sends the "Sending photo" status for a specified number of seconds.
Example:
// Sending photo for 4 seconds
<<upload_photo 4>>
record_voice
β
The record_voice
command sends the "Recording voice message" status for a specified number of seconds.
Example:
// Recording voice message for 4 seconds
<<record_voice 4>>
record_video_note
β
The record_video_note
command sends the "Recording video" status for a specified number of seconds.
Example:
// Recording video for 4 seconds
<<record_video_note 4>>
reaction
β
The reaction
command changes the reaction to an unexpected user message until the bot's next message.
Example:
// Change the reaction to an unexpected user message
<<reaction angry>>
Flow Commandsβ
jump
β
The jump
command sends the user to the specified node.
Example:
// Jump to the node my_first_node
<<jump my_first_node>>
Monetizationβ
payment
β
The payment
command allows you to offer users the purchase of additional features, hidden branches, or to split the game into a demo and full version. The user will not be able to proceed until they make a purchase, and the "Cancel" button will return them to the previous level.
Each payment
command must contain an identifier. If a payment is completed, we will record that the user has paid for the given payment identifier and will no longer ask for payment for this identifier.
Example:
Hello, would you like to purchase additional content?
-> Yes
<<payment 100 my_first_payment>>
<jump my_paid_node>>
-> No
<<jump my_free_node>>
In this case, if the user selects "Yes," they will be prompted to make a purchase for 100 TPoints with the identifier my_first_payment
. After successful payment, the user will be redirected to the my_paid_node
. If the user selects "No," they will be redirected to the my_free_node
.
If the user wants to cancel the purchase, they can press the "Cancel" button and return to the previous level, meaning they will see the message "Hello, would you like to purchase additional content?" again.
Be careful: if you place the payment
command at the root of a node, the user will return to the beginning of the node when they press the cancel button. By placing the payment
command at the root of the node, you force the user to either make a purchase or abandon the game.
Example:
title: payment_example
---
Hello, would you like to purchase additional content?
// If the user cancels the payment here, they will return to the start of the node
<<payment 100 my_first_payment>>
<<jump my_paid_node>>
Let's assume the user has completed the payment and the identifier "my_first_payment" has been recorded as paid. Now, if the user returns to this node or encounters a payment with the same identifier elsewhere, they will not be prompted to make the payment again and will proceed further automatically.