Notice: If the game stops working after an update, it might be a savegame incompatibility. Remove your savegame folder and try again before posting about it.
Registration has an extra hurdle now: There have been advertisement bots, so I added a security keyword to registration. Deal with it.
  0 users browsing Suggestion Box. | 1 bot  
Main » Suggestion Box » Scene tokens in list elements
Pages: 1
Posted on 01-21-13, 03:36 pm

 

Posts: 46/105
Since: 12-06-12

Last post: 4000 days
Last view: 3982 days
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.

Lead writer on Noxico (and sometimes programmer or designer) <br>
Posted on 01-21-13, 04:13 pm
<i>Prophet of Celestia</i><br>Baka on the streets, senpai in the sheets

Posts: 142/344
Since: 06-08-12

Last post: 1670 days
Last view: 1210 days
So you mean having something like "Ask [b:him] out to dinner"?

I suppose this could be done.

I don't just program Noxico...
Posted on 01-21-13, 09:32 pm

 

Posts: 47/105
Since: 12-06-12

Last post: 4000 days
Last view: 3982 days
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.

Lead writer on Noxico (and sometimes programmer or designer) <br>
Posted on 01-23-13, 03:17 pm (revision 2)
<i>Prophet of Celestia</i><br>Baka on the streets, senpai in the sheets

Posts: 143/344
Since: 06-08-12

Last post: 1670 days
Last view: 1210 days
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.

I don't just program Noxico...
Posted on 01-23-13, 07:50 pm

 

Posts: 48/105
Since: 12-06-12

Last post: 4000 days
Last view: 3982 days
Nice, it all seems to be working pretty well. This should make writing dialog choices much easier. :)

Lead writer on Noxico (and sometimes programmer or designer) <br>
Pages: 1
Main » Suggestion Box » Scene tokens in list elements