• 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.

API Summary

beerwithdragons

New member
Wizard of Combat
I'm interested in how to code for CL. I saw Sly Flourish using sublime text 3 in a video to do his session prep and thought that was a novel idea. @ELF had mentioned using Atom for a editor. I pulled over some of my notes and started using the Markdown format. I really liked the results and formatting of my session notes.

@JochenL , @Hannu , @ELF @JohnnFour What do you recommend to begin the process of learning to develop for CL. I may not be explaining this correctly but, I'd like to download the CL webapp API and learn how to code with it in a Text editor. lol I'm new at this forgive me for not knowing the proper terms just quite yet. :)

Thank you all.
 
  • Like
Reactions: ELF

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
Atom as json editor is a good one. Reading existing .json files for inspiration and then picking a topic that is close to your heart and your current campaign, research some existing game specific material and start doung a .json. that is how I do generators...
 

ELF

Generator Sage
Wizard of Story
Wizard of Combat
That’s an admirable attitude! (y)

A good way to start would be to decide on a goal: what you would want to achieve. After that, let’s see what would be the best approach and the right tools.
 

JochenL

CL Byte Sprite
Staff member
Adamantium WoA
Wizard of Story
Wizard of Combat
Gamer Lifestyle
Borderland Explorer
@JochenL , @Hannu , @ELF @JohnnFour What do you recommend to begin the process of learning to develop for CL. I may not be explaining this correctly but, I'd like to download the CL webapp API and learn how to code with it in a Text editor. lol I'm new at this forgive me for not knowing the proper terms just quite yet. :)

Aloha!
Glad to see that much interest in coding!

First of all you should get yourself a versatile text editor. IMO it should support syntax highlighting and code completion to some degree. An integrated code help system showing explanations in a popup is a great plus, too.

I much prefer Visual Studio Code. It is available for different platforms and has all that and more (even an integrated debugger). I am using Notepad++, too, but mostly for formatting, regular expressions search and replace, and file format analysis (it can show binary files with an appropriate Hex code plugin).

I looked into several other tools, and you should probably, too. Then pick the one you like most.

The next question is what exactly you want to do.

For using the Public CL API you would need a programming language and framework which supports HTTP requests. IMO JavaScript would be the most straight-forward approach to that; you can easily create a UI using HTML and add API calls in JavaScript to read/write logs and log entries to your liking. All examples are in JavaScript, too. If you are very ambitious you could even learn how to use Node JS which has a rich infrastructure for JavaScript-based development. You could start a free trial at Codeschool (https://www.pluralsight.com/codeschool) and work through the JavaScript path. I really like their interactive courses.

For creating Generators you don't need to learn any programming languages. Instead have a look at the general syntax of JSON (http://www.json.org/) / YAML (http://yaml.org/) - YAML is a superset of JSON and can be more concise and readable. After getting the general syntax follow @ELF 's excellent examples in the generator documentation.

Just ask here if you have any questions!
 

beerwithdragons

New member
Wizard of Combat
Excellent! Thank you all! I'll follow up once I have a little more info and know what I want to do. I'll check out the courses and VS Code.
 

mKlaumann

New member
Hi, I have been thrown into CL - Development this February.
The easiest thing to do, as @JochenL said, is to pick up a programming language that is easy to start with. His idea to use Javascript, HTML and CSS is pretty straightforward. Just look into how they work a little bit. Nowadays it is very easy to start with those languages as you have loads of ressources online in text or video format.
The same thing about the editor, in my eyes, Visual Studio Code is like Atom on steroids, a lot faster and for me it just feels great.
The next step would be to look at the API documentation for the Campaign Logger and just trying to get a feel for it, then continue on and on...

If you want to, you can look at these examples . There I created two really really basic examples.
If you are just starting out, if you look at the jQuery example you can at least see, how to use the api a little bit. Just know, that what I did there are in no means best practices or anything in that regard. But at least they show you how you can set up a real small project that uses the CL Api.
 

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
@JochenL Could not find after brief search the REST API for generators (generating...) Is there something available...
 

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
So I have an example now that I would like to upload to our git. Where should I put it - is there a ready made example repository where I can put it.
 
  • Like
Reactions: ELF

Hannu

Mythras Guru
Gold WoA
Wizard of Story
Wizard of Combat
can the above somehow be linked to our campaign logger resource page (open campaign logger etc visible from the git
 

JochenL

CL Byte Sprite
Staff member
Adamantium WoA
Wizard of Story
Wizard of Combat
Gamer Lifestyle
Borderland Explorer
OK, why waiting...

Be warned:
This documentation is one year old.
The API has evolved since that.
We need to update the documentation and add more examples.
No warranty.
No guarantees.
Use at your own risk.
See attached file.
 

Attachments

  • campaign-generator.pdf
    275.4 KB · Views: 9
Top