RPTools

From MapToolDoc
(Redirected from c (roll option))

count (roll option)

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

COUNT Option

Introduced: Version 1.3.b41

The COUNT option executes a statement for a specified number of times, storing the number of the current iteration in a variable called roll.count.

Usage

  1. [COUNT(num): body]
  2. [COUNT(num, separator): body]

The roll.count variable will take on values from 0 to (number of loops - 1). The optional separator (default ", ") is printed between each iteration.

Example

  1. [h:numHits=3]
  2. [COUNT(numHits): Damage = Damage + 1d12]

This will iterate the Damage = Damage + 1d12 operation 3 times, separating the result of each iteration with the default separator (a comma). An optional second argument to COUNT() allows the setting of a different separator.