Different Branches in "Story"
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Different Branches in "Story"
I was woundering, is it possible to make branching storylines within the "story" tag?
For example, I have tried doing something like this:
Although this doesen't work period, I think it convays what I am trying to achieve. Any suggestions?
For example, I have tried doing something like this:
Code: Select all
[story]
[part]
story= _ "Text"
[/part]
[if]
[variable]
name=branch1
numerical_equals=1
[/variable]
[then]
[part]
story= _ "Branch 1 Text"
[/part]
[/then]
[/if]
[if]
[variable]
name=branch2
numerical_equals=1
[/variable]
[then]
[part]
story= _ "Branch 2 Text"
[/part]
[/then]
[/if]
[/story]
Creater of the campaign, "Northern Rebirth"
Compleater of the campaign, "Son of the Black Eye"
Compleater of the campaign, "Son of the Black Eye"
-
- Posts: 381
- Joined: December 2nd, 2006, 4:10 am
- Location: Thar an scáthán
Refer to Heir to the Throne - in Bay of Pearls, there are two potential 'next scenarios'. In that particular case, both of them lead to the same scenario afterwards - but there's no reason why they have to, in theory they could branch in totally different directions.
Jetryl wrote:Normal people are like candy ravers. You look away for a moment and next thing you know they're spreading vaseline on your nipples and cooing like a pigeon.
Someone once told me that there's an undocumented (most likely still undocumented because I actually never confirmed it myself) feature that indeed allows one to use an [if] inside [story] somehow. Of course, having not tried it, I can't be completely sure that's correct.
Maybe you should try something simpler, like having the [if] first and having only one of them and seeing if it works then. Maybe the [if] handling is done in some obsolete way in the story screens, since it's existence has probably mostly been forgotten.
Maybe you should try something simpler, like having the [if] first and having only one of them and seeing if it works then. Maybe the [if] handling is done in some obsolete way in the story screens, since it's existence has probably mostly been forgotten.
Just like to say that, if this is not possible, it would be greatly desired. I don't want to have to have two different identical scenarios just because I need one line different in the [story] tag...
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
That is what I have now, two - or actually - three identical scenarios with slightly different [story] tags. It makes it hell to maintain, and it's pretty sloppy so I was hoping to change it.turin wrote:Just like to say that, if this is not possible, it would be greatly desired. I don't want to have to have two different identical scenarios just because I need one line different in the [story] tag...
Creater of the campaign, "Northern Rebirth"
Compleater of the campaign, "Son of the Black Eye"
Compleater of the campaign, "Son of the Black Eye"
Ok, I have been fiddling around with the above code for a copule hours now and here are my findings: The first "if" works, the second one doesn't. When you run it through the game using "branch1" variable, everything goes as expected. If you run it thorugh with "branch2" variable, the story stops at the first part and skips right away into the [start] event.
Creater of the campaign, "Northern Rebirth"
Compleater of the campaign, "Son of the Black Eye"
Compleater of the campaign, "Son of the Black Eye"
For only 2 different branches you can use
Code: Select all
[story]
[part]
story= _ "Text"
[/part]
[if]
[variable]
name=hhpotion
numerical_equals=1
[/variable]
[then]
[part]
story= _ "Branch 1 Text"
[/part]
[/then]
[else]
[part]
story= _ "Branch 2 Text"
[/part]
[/else]
[/if]
[/story]
Sorry for doppelpost. =(
Here a code which use short fake scenarios for 1,2,3...n different storys.
Here a code which use short fake scenarios for 1,2,3...n different storys.
Code: Select all
[scenario]
id="branch1"
name=_"branch1"
next_scenario="really-next-scenario"
[story]
[part]
story= _ "branch1"
[/part]
[/story]
[event]
name=prestart
[endlevel]
result=continue_no_save
[/endlevel]
[/event]
[/scenario]
[scenario]
id="branch2"
.
.
.
[event]
name=prestart
[endlevel]
result=continue_no_save
[/endlevel]
[/event]
[/scenario]
[scenario]
id="branch3"
.
.
.
[/scenario]
[scenario]
id="really-next-scenario"
.
.
.
[/scenario]
I haven't had a chance to work on this for a while but I finally got it. Thanks again for all the help everyone.
To make three different branches in the story, I built onto Kaldred's first post a bit, and it works fine as of Version 1.2
For future reference, in case anyone else has the same question, here is the code I used:
To make three different branches in the story, I built onto Kaldred's first post a bit, and it works fine as of Version 1.2
For future reference, in case anyone else has the same question, here is the code I used:
Code: Select all
[story]
[part]
story= _ "Intro Text."
[/part]
[if]
[variable]
name=branch1
numerical_equals=1
[/variable]
[then]
[part]
story= _ "Branch 1 Text"
[/part]
[/then]
[else]
[if]
[variable]
name=branch2
numerical_equals=1
[/variable]
[then]
[part]
story= _ "Branch 2 Text"
[/part]
[/then]
[else]
[part]
story= _ "Branch 3 Text"
[/part]
[/else]
[/if]
[/else]
[/if]
[/story]
Creater of the campaign, "Northern Rebirth"
Compleater of the campaign, "Son of the Black Eye"
Compleater of the campaign, "Son of the Black Eye"