• Hello game master! Welcome to our growing community. Please take a moment to Register (top right button, see how: Slides).

    If you use Campaign Logger, you can use the same login details - we've linked the app to this forum for secure and easy single sign-on for you.

    And please drop by the Introductions thread and say hi.

Calling sub item in JSON file via REST API

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
Before I bang my head to the development wall in the appropriate rhythm I would ask:

Currently I have normal REST API working.

Let's say it is Monster Island Jungle Daily.json.
Via it I can call different json file and generate random entry using gen:Monster Island Standard Encounter#JungleEncounterDay

That in succession calls gen:Monster Island Standard Encounter#Lost Explorers which randomises from available lost explorer encounters.

This works very nicely indeed using the REST API via sending the "Monster Island Jungle Daily.json" as the json file.

----

I would like to call each of the gen:Monster Island Standard Encounter#encounter types (there are lot of them) directly.

They are like this:

In the Monster Island Standard Encounter I might have these blocks

{
"name": "encounter1",
"entries": [
"encounterstuff"
]
},

{
"name": "encounter2",
"entries": [
"encounterstuff"
]
},
...
....
{
"name": "encounterxxx",
"entries": [
"encounterstuff"
]
},

What is the right way to call these via REST API

...or do I have to create a json file for each of these encounters...

--h
 

JochenL

CL Byte Sprite
Staff member
Adamantium WoA
Wizard of Story
Wizard of Combat
Gamer Lifestyle
Borderland Explorer
In this PDF: https://campaign-community.com/index.php?resources/generator-guide.135/ (hit the download button) there is this paragraph:

External Subtable Calls
The external table call can also specify a subtable within the called generator. To do that, insert a hash mark (#) after the file name, and then the name of the suitable.

{lib:generatorName#subtable name}

Note that there are no spaces in front of after the # character. The subtable name can contain spaces.
 
Top