It looks like you're new here. If you want to get involved, click one of these buttons!

- 1.7K All Categories
- 176 Site Announcements
- 58 News and Announcements
- 118 General Discussion
- 657 Fractal Mapper
- 174 Fractal Mapper General
- 483 Maps and Symbols
- 28 Skwyre Virtual Table Top
- 25 Skwyre General Discussion
- 3 Skwyre How-To
- 303 AstroSynthesis
- 229 AstroSynthesis General
- 74 AstroSynthesis Plug-ins and Scripts
- 95 The Keep
- 95 The Keep General
- 59 ScreenMonkey General
- 18 ScreenMonkey Setup and Configuration
- 216 Inspiration Pad Pro
- 216 Inspiration Pad Pro General
- 120 NBOS Character Sheet Designer
- 120 Character Sheet Designer General

I get error messages when doing this:

```
Prompt: Population {} {5000}
MaxReps: 1
Set: pop={$Prompt1}
Set: density={1d6+4}
Set: num={round({{$pop}/{$density}})}
Set: nc={round({{$num}/2})} // Number of crofts
Set: nh={round({{$num}/11})} // Number of cottages
Set: t1={{$num}-{$nc}} // Subtract crofts
Set: nb={{$t1}-{$nh}} // Subtract cottages for # of remaining buildings
Table: main
Village (pop. {$pop})\nBuildings: {$num}\nCottages: {$nh}\nCrofts: {$nc}\nShops: {$nb}
```

**pop** isn't being set which causes a cascading set of errors.

```
Village (pop. )
Buildings: (Invalid expression: round((Invalid expression: /10)))
Cottages: (Invalid expression: round((Invalid expression: (Invalid expression: round((Invalid expression: /10)))/11)))
...
```

From looking at other examples of Prompt, that seems fine though the other examples have all been text input and not numeric. What am I missing. Thanks!

## Comments

Try

for calculations that are constant and don't have the randomness of a die roll. This code works (at least with no errors, and a hand check of the results looks good):Define:Now then, since

$densityis a die roll that, once rolled, must maintain the same value for the duration of the Rep, it must use thedefinition, or else every following variable will reroll a new 1d6+4 to determine its value. The result of usingSet:forDefine:{$density}would be the total number of buildings would not add up and the ratio of crofts to cottages, etc would not be calculated using a consistent density value.I find

andSet:to be a bit confusing and usually have to try variations of each with hand checking the results before I'm confident in the way I'm using them.Define:Note: I usually don't place the

{5000}in brackets, but it doesn't seem to cause any problems here.Thanks! That is pretty weird. I had only just added the Prompt input to what had been a working table with a random pop value.

Thanks for pointing me at the define option.