Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

How to restart a live macro

$
0
0
I'm trying to figure out how to build a simple "active battle system", with action bars.
(live: $e1_time)[
	(set: $e1_act_bar to it + (a:"█"))
	Count: $e1_count_bar;(set: $e1_count_bar to it + 1)
	Bar: (print: $e1_act_bar.slice(0,10).join(" "))
]
$e1_time is the enemy reaction time score, so if a character has good reaction, the live will be faster and his bar be plenty sooner.

$e1_act_bar is an empty array.
(set: $e1_act_bar to (a:))
$e1_count_bar is a simple counter, set to 0 outside the live.
(set: $e1_count_bar to 0)
The print will display, this way, a bar like █ █ █ █ █ █ █ █ █, sliced to the first 10 blocks.

The question is: how can I stop the macro of keep filling the array with █, since if the player didn't act, he/she will have a massive array, even if only 10 are visible? The obvious answer is (stop:), but I don't have idea how to do it and after the combat actions (when the bar reaches 10 and must be stopped), bring it back to work.

Viewing all articles
Browse latest Browse all 1844

Trending Articles