View & tools

1 item Β· Clean view

Browse items (1)

Script Idea

https://homebrewery.naturalcrit.com/share/HJIl7xHkN

load data from url

Create variable

Random number

Array access

Simple math

Loop (esp over data)

Equals


Thoughts

variables start with lower case
Functions start with upper case

Sets:

list data can overflow a line as long as it ends with a comma
List data can be un-quoted or quoted

lists

Lists are "some arrayNames are foo, bar"
list have implied keys, starting at 0

dicts

Dicts are "some arrayName are 1:foo, 2:bar"
All elements in a dict must have keys.


some races are 0: human, 1: elf
some elves are half, drow, high, sea
some gnome are forest, rock, // comma to continue list
deep

some dwarves from "example.com/dwarves.json" // data loading... :?

some subraces are elf: elves, dwarf: dwarves

the numberOfRaces is Size of races
the selection is Random from 0 to numberOfRaces - 1 // how to handle inline math
some elfSubraces are races at 1 // variable not function

if races missing selection
exit with "Couldn't find the race"

say races at selection
a choseRace is races at selection
if subraces has choseRace
the subraceSet is subraces at choseRace
say Random from subraceSet
exit