ImpowerGames / impower

An all-in-one, community-powered indie development platform that gives creative people the tools they need to bring their ideas to life.
https://www.impower.app
2 stars 1 forks source link

Allow displaying variable values in dialogue, action, centered, and choice text #148

Closed lovelle-cardoso closed 2 years ago

lovelle-cardoso commented 2 years ago

To test interpolating number variables:

var count = 1

Sally approached the sea shore with her {count:shell|shells}.

SALLY
I have {count} sea {count:shell|shells} on sale!

> Alas, no one purchased the {count:shell|shells}... <

Try changing the count and replaying the game to see if the text is properly pluralized according to English pluralization rules.

You can pluralize according to number variables by formatting your tag like this {numberVariableName:singlular|plural}


To test interpolating boolean variables:

var success = false

SALLY
I'm so {success:upset|happy}!

Try changing the success variable and replaying the game to see if the text properly changes.

You can select text according to boolean variables by formatting your tag like this {booleanVariableName:false|true}


To test dynamic sequences:

# RootSection

Here's a test: {one|two|three|four}

^

Dynamic sequences will select a different value every time they execute during a game's lifetime. You can use special markers to determine which values should be selected. In the first param, use ~ to shuffle or ~* to randomize. In the last param, use ( to repeat cycle or ) to repeat last.

Select sequentially, then when exhausted options, cycle back to first option and repeat sequence
{Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|(}

Select sequentially, then when exhausted options, repeat last option
{I bought a cookie.|I bought another cookie.|I cannot afford any more cookies.|)}

Select sequentially, then when exhausted options, show nothing
{I bought a cookie.|I bought another cookie.|I vowed not to return.}

---

Shuffle options, then select sequentially, then when exhausted options, cycle back to first option and repeat sequence (shuffling before each cycle)
{~|Wonderful!|Excellent!|Superb!|Amazing!|(}

Shuffle options, then select sequentially, then when exhausted options, repeat last option
{~|Wonderful!|Excellent!|Superb!|Amazing!|Encore!|)}

Shuffle options, then select sequentially, then when exhausted options, show nothing
{~|Wonderful!|Excellent!|Superb!|Amazing!|I decided to keep quiet from now on...}  

Fully randomize selection (the same option may be shown multiple times in the same cycle)
{~*|rock|paper|scissors}

---

You can also use dynamic sequences in go commands
> {FirstTimeSeen|SecondTimeSeen|ThirdTimeSeen}

and choice commands
+ Let's try again... > {FirstTimeChosen|SecondTimeChosen|ThirdTimeChosen}
+ I give up! > GaveUp
Wipeless commented 2 years ago

@lovelle-cardoso I use the following script:

# RootSection

Here's a test: {~*|one|two|three|four|(}

^

I wanted to purely randomize my 4 choices (with potential repeats) and then start again.

However, I sometimes get the ( as a result: Here's a test: (

Is the ( only expected to work without the pure random marker ~*?

lovelle-cardoso commented 2 years ago

@Wipeless

Is the ( only expected to work without the pure random marker ~*?

I didn't think the end operators would be used with the pure random start operator. But I can add support for ) and simply ignore (

lovelle-cardoso commented 2 years ago

@Wipeless K should be supported in 20415533

Wipeless commented 2 years ago

Ok! I've created a lot of bugs for these features and I think it now looks all good. I can confirm that this enhancement has been reviewed on my end!

lovelle-cardoso commented 2 years ago

IMPORTANT: The functionality of dynamic sequences have been adjusted slightly.