How to store a storyline if it represents such a tree: 
Where to begin? How to prepare the script? How to go on it? Number and save position (saved_pos + 1)? How, then, to beat the transition to one of the branches?
How to store a storyline if it represents such a tree: 
Where to begin? How to prepare the script? How to go on it? Number and save position (saved_pos + 1)? How, then, to beat the transition to one of the branches?
The entire list of states is stored in one table. id, description
For storage of arrows there are options. For example:
Transition table from_id, to_id
How to go
1. Select the starting state:
SELECT * FROM State s JOIN Transitions t on t.to_id = s.id WHERE t.from_id is null 2. Choose a list of further options:
SELECT * FROM State s JOIN Transitions t on t.to_id = s.id WHERE t.from_id = :current 3. Repeat step 2 until the option with to_id = null is selected.
The end.
Source: https://ru.stackoverflow.com/questions/630616/
All Articles