-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathREADME.Rmd
67 lines (42 loc) · 2.6 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
devtools::load_all()
set.seed(1)
```
# import5echar
Walter Kammerer's [Fifth Edition Character Sheet](https://play.google.com/store/apps/details?id=com.wgkammerer.testgui.basiccharactersheet.app&hl=en) app allows you to upload your character to google drive. This package parses that file and allows you to use character data for automation.
## Installation
```
devtools::install_github('oganm/import5echar')
```
## Basics
First thing that need to be done is to import yoour character. You can either use a regex or a google drive file id (acquirable using `googledrive` package). If a regex is used, last modified file that matches the regex is pulled which is probably your latest export. First time you run the line below, you'll have to authenticate with google drive.
```{r,eval=FALSE}
char = importCharacter('Tim_Fighter')
```
If you don't want to authenticate with google drive, a local file can be used
```{r}
characterFile <- system.file("Tim_Fighter5", package = "import5eChar")
char = import5eChar::importCharacter(file = characterFile)
```
Once a character is loaded convenience functions can be used
```{r}
init() # initiative roll
skillCheck('medicine') # medicine skill check
weaponAttack(char$weapons$Dagger) # a weapon attack with a dagger
```
All these conveninece functions require an imported character as an input. If you use the variable name `char`, providing this will not be necesarry. If you want to use a different name you can either do `options(defaultCharacter='newVariableName')` to continue using the functions as before, or specify the object.
```{r}
myBestCharacter = importCharacter('Tim_Fighter')
init(char = myBestCharacter)
```
## PDF character sheets
A rmarkdown template is available to print out pdf character sheets. To use it, create a new markdown document with `CharacterSheet` template. Replace the character import line with a character of your own. See [example.pdf](inst/skeleton.pdf) to see what it looks like. Alternatively use `prettyPDF` function to get a proper fillable character sheet.
## Shiny character sheet
To run the interactive character sheet, just use `shinySheet()`. The interactive
sheet is documented [here](interactiveSheetDocumentation.md)
## Use example
See [tim.R](tim.R) for example usage. I keep a file like that open during session and ctrl+R the relevant lines as needed. If you are a caster see if you'd be interested in the [wizaRd](https://github.com/oganm/wizaRd) package. If you turn into animals a lot see [monsteR](https://github.com/oganm/monsteR) package.