Legends of Learning Plugin
Legends of Learning API Integration
Last updated
Legends of Learning API Integration
Last updated
This plugin features integration with Legends of Learning API integration for Construct 3, a popular educational platform with hundreds of educational games. The plugin supports C3 runtime only, worker mode, and the advanced minification. C2 Runtime and Construct 2 is not supported and due to Construct 2 will soon be retired, there's no intention on developing a plugin for it.
The plugin not only provides you with API integration, but also with a couple of useful features like multilang text manager using the Get Text expression, automatic highlight using Set Highlight action, an action for injecting your language file to speed up your development using Set Lang From String action, Mute/Unmute LoL voice api, and automatic management of the game progress submission.
Please notice that this plugin is distributed as Freeware, This means the author retains all its copyrights rights, licensing, distribution, and modifications or derivated work from this plugin is prohibited. If you want to know more about the license, please visit the End User License Agreement for it. The EULA is also distributed and embedded within the plugin .c3addon file.
Legends of Learning javascript API
Property
Description
Debug Mode
Enable Plugin console log for debugging
Submit Auto-Progress
Submits the game progress to LOL framework and handles the progress step increment automatically. If Max Progress is reached, then no submission will be executed. Max Progress is defaulted to 8 steps. Use SetMaxProgress to modify it.
Complete Game
Reports to LOL framework that player has finished the game
Game Is Ready
Reports to LoL GameFrame that game is ready to receive data
Submit Game Progress
Submits the indicated progress step to LOL framework. Max Progress is defaulted to 8 steps. Use SetMaxProgress to modify it.
Parameter
Description
Progress
Progress value to submit. Max Progress is defaulted to 8 steps. Use SetMaxProgress to modify it.
Load State
Request to LoL API the state saved for the game. If it's successfully retrieved, then On Load State condition is triggered. After On Load state is triggered, the values for Progress and Max Progress are updated automatically to reflect the latest step where the player saved.
Report Loading Progress
- DEPRECATED
Reports game loading progress to LOL framework
Parameter
Description
Progress
Progress percentage value to submit expressed using decimals. 0.7=70%
Mute LoL voice
Prevents LoL API from speaking text, it doesn't stop audio playing
Reset Progress
Resets LoL game progress to zero. Beware that this action should be called with care, only reset the progress when the player starts your game all over.
Save State
Post and saves to LoL API the game state data
Parameter
Description
Data
String containing the state; this can also be a strigified JSON.
Set Highlight Color
Sets the color for highlighted words. To make the highlight work, you must add an key called 'highlight' on your language file, and it should contain a stringified array of strings. GetText expressions will look for every string and add a color code. A string can also be a regular expression string.
Parameter
Description
Color
Color in hex format #999999 as a string
Set Lang From String
Sets the content of the language file from a string (use for testing only). Useful for testing without the LoL Test harness.
Parameter
Description
Language
Language code. Eg. en, es, fr
Data
JSON lang file as a String
Set Max Progress
Sets LoL Maximum game progress step.
Parameter
Description
Max Progress
Max Progress value to submit (number)
Set Score
- DEPRECATED
Sets the score to be submitted on the next 'Progress' LoL message. Use SubmitGameProgress or AutoProgress to send the score.
Parameter
Description
Score
Game Score
Show Question
Displays an overlay with a random LoL question
Speak Question
- DEPRECATED
Speaks a question using LOL framework
Parameter
Description
Question Id
Question Id (numeric)
Speak Text
Speaks a text string using LOL framework
Parameter
Description
Text Id
This id corresponds to the language file id assigned to the text.
Suspend Runtime
Suspends the execution of the Construct runtime, therefore no further events will be processed until On Resume condition is triggered by LoL Game Framework.
Unmute LoL voice
Enables LoL API to speak text
On Start
Triggered when GameFrame reports to the game that it must start. You must call a GameIsReady action to report to the LoL GameFrame that your game is ready to be initialized.
For Each Alternative
- DEPRECATED
Loops every alternative available for the indicated QuestionIndex and updates the AlternativeIndex index-value. Use QuestionIndex in conjunction with AlternativeIndex expression to read specific fields of the alternative.
Parameter
Description
Question Index
Question zero-based Index
For Each Question
- DEPRECATED
Loops every question available and updates the QuestionIndex index-value. Use QuestionIndex expression to read specific questions
Is Alternative Correct
- DEPRECATED
Tests wheter the indicated Alternative for the given Question is correct
Parameter
Description
Question Index
Question zero-based Index
Alternative Index
Alternative zero-based Index
Is Game Ready
Returns true if the LoL API has been initialized after calling GameIsReady action.
Language
- DEPRECATED
Language payload received (callback event)
On Correct Answer
After calling ShowQuestion action, this condition is triggered when the player answers a LoL API question CORRECTLY.
On Error
An error occurred during API calls. Use expression GetError for more details.
On Incorrect Answer
After calling ShowQuestion action, this condition is triggered when the player answers a LoL API question INCORRECTLY.
On Load State
Triggered as callback from LoL API after the action Load State is called. Here you can parse the payload returned and update your game state accordingly. After On Load state is triggered, the values for Progress and Max Progress are updated automatically to reflect the latest step where the player saved.
On Save Completed
Triggered as callback from LoL API after the action Save State action is called. If saving fails, then condition On Error will be triggered.
On Pause
LoL API requested to Pause the game. Runtime is NOT automatically suspended, after the On Pause event is triggered, you must call the action Suspend Runtime.
On Questions Ready
- DEPRECATED
Triggered after LoL GameFrame sends the questions back to your game.
On Resume
LoL API requested to Resume the game. Runtime is automatically resumed.
AlternativeIndex
- DEPRECATED
While looping using For Each Alternative, returns the Alternative zero-based index for the question at QuestionIndex.
GetAlternativeChoiceNum
- DEPRECATED
Returns the alternative (answer) choice number for the question at QuestionIndex. This is the sequenced number LoL API assigns, it is NOT the zero-based index.
Parameter
Description
Index
Alternative Index
GetAlternativeId
- DEPRECATED
Returns the alternative (answer) unique ID for the question at QuestionIndex.
Parameter
Description
Index
Alternative Index
GetAlternativeText
- DEPRECATED
Returns the alternative (answer) text for the question at QuestionIndex
Parameter
Description
Index
Alternative Index
GetLastError
Returns the last error registered by the plugin
GetLang
Returns the language code received in the lang.json file
GetMaxProgress
Returns the maximum progress value expected for the game.
GetPayload
Returns the payload received from the LoL API as a string
GetPlayTime
Returns duration in milliseconds after the On Start condition has been triggered. This expression is helpful to measure the time the player has spent, and meet the minimum 5 minutes gameplay that LoL Gameframe requires. If no On Start has been triggered, the time returned will be the total time since the game started.
GetProgress
Current game progress
GetQuestionCorrectAltId
- DEPRECATED
Returns the unique Id of the correct alternative for the given question
Parameter
Description
Question Index
Question zero-based Index
GetQuestionCount
- DEPRECATED
Returns the number of questions retrieved from LoL API
GetQuestionId
- DEPRECATED
Returns the question unique Id
Parameter
Description
Question Index
Question zero-based Index
GetQuestionImageURL
- DEPRECATED
Returns a string containing the Image URL for the question. May return an empty string when there's no URL available.
Parameter
Description
Question Index
Question zero-based Index
GetQuestionStem
- DEPRECATED
Returns the question text
Parameter
Description
Question Index
Question zero-based Index
GetRawText
Reads a string from the JSON language file
Parameter
Description
Text ID
This id corresponds to the language file id assigned to the text.
GetStateData
Returns the state data retrieved from LoL API
GetText
Reads a string from the JSON language file and applies the highlight
Parameter
Description
Text ID
This id corresponds to the language file id assigned to the text.
QuestionIndex
- DEPRECATED
While looping using For Each Question, returns the QuestionIndex
(c) Pixel Perfect Studio 2025