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

- 1.7K All Categories
- 181 Site Announcements
- 61 News and Announcements
- 120 General Discussion
- 673 Fractal Mapper
- 177 Fractal Mapper General
- 496 Maps and Symbols
- 29 Skwyre Virtual Table Top
- 26 Skwyre General Discussion
- 3 Skwyre How-To
- 304 AstroSynthesis
- 230 AstroSynthesis General
- 74 AstroSynthesis Plug-ins and Scripts
- 96 The Keep
- 96 The Keep General
- 59 ScreenMonkey General
- 18 ScreenMonkey Setup and Configuration
- 223 Inspiration Pad Pro
- 223 Inspiration Pad Pro General
- 122 NBOS Character Sheet Designer
- 122 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.