0 users browsing Suggestion Box. | 1 guest  
Main » Suggestion Box » Scene tokens in list elements » New reply
Alert
You are about to bump an old thread. This is usually a very bad idea. Please think about what you are about to do before you press the Post button.
New reply
Post help

Presentation

[b]…[/b] — bold type
[i]…[/i] — italic
[u]…[/u] — underlined
[s]…[/s] — strikethrough
[code]…[/code] — code block
[spoiler]…[/spoiler] — spoiler block
[spoiler=…]…[/spoiler]
[source]…[/source] — colorcoded block, assuming C#
[source=…]…[/source] — colorcoded block, specific language[which?]

Links

[img]http://…[/img] — insert image
[url]http://…[/url]
[url=http://…]…[/url]
>>… — link to post by ID
[user=##] — link to user's profile by ID

Quotations

[quote]…[/quote] — untitled quote
[quote=…]…[/quote] — "Posted by …"
[quote="…" id="…"]…[/quote] — ""Post by …" with link by post ID

Embeds


Most plain HTML also allowed.
Thread review
PillowShout Nice, it all seems to be working pretty well. This should make writing dialog choices much easier. :)
Kawa That's exactly what I was planning, actually.

But it turns out it's not a good solution, actually, because it'll try to find an item named "Ask her out to dinner" which doesn't exist!

Plan B: use the ! separator used for listas when there's a token in the string:
• "Engage in trade negotiations" → "Engage in trade negotiations", finds scene with that name. Usual state.
• "Actual name"/"Listed as something else" → "Actual name!Listed as something else", finds scene "Actual name". Listas, as implemented.
• "Ask [b:him] out for dinner" → "Ask [b:him] out for dinner!Ask her out for dinner", finds scene "Ask [b:him] out for dinner". Used when there's a [ in the name or listas.

Update: turns out I misremembered -- the name is used to link scenes to actions, and the list is the one that gets shown on-screen. Still rewrote that routine for readability and put it up.
PillowShout Yeah, that's what I meant. I actually found a pretty simple solution that seems to work.

Just replace the following lines in SceneSystem.ExtractActions ...

ret.Add(s.GetAttribute("name") + '!' + ret.Count.ToString(), action.GetAttribute("listas"));

ret.Add(s.GetAttribute("name"), s.GetAttribute("list"));


... with these.

ret.Add(s.GetAttribute("name") + '!' + ret.Count.ToString(), ApplyTokens(action.GetAttribute("listas")));

ret.Add(s.GetAttribute("name"), ApplyTokens(s.GetAttribute("list")));


I didn't test it that much, so I'm not sure if this is that robust of a solution, but it seems to work pretty well for the most part.
Kawa So you mean having something like "Ask [b:him] out to dinner"?

I suppose this could be done.
PillowShout Pretty minor suggestion, but I was wondering if you'd be able to add scene tokens to list and listas elements so that these tokens work in dialog choices.
Main » Suggestion Box » Scene tokens in list elements » New reply