Set

The Set addon extends the features of Construct 3 to implement the JS Set API.

The Set addon lets you store unique data efficiently, while the Array object is efficiently made to handle mixes of non-unique data. 


It allows both an instantaneous declaration of set and also a gradual creation of set by defining the elements and the set.

 

The best benefit for this plugin is that it is a sole Construct 3 Editor and c3runtime implementation, dedicated for optimization and performance with the c3runtime with ES6 API features.

The addon implements the JS Set API, which is a very useful tool for game development.

Intstructions

1. The first step is to add the Set addon into the project.

Actions, Conditions & Expressions

Actions

Actions.png

General :

  • Create - Creates a predefined set, which can be used later on by specification.

    • Set - The name of the new set to create.

  • Plan Element - Plan an element to add for the next "Create" action, to construct a set.

    • Element - A value, either a string or number, to be added to the next set "Create" action.

  • Clear Plans - Clears all the plans made using the "Plan Element" action.

  • Remove Plan - Remove a plan made using the "Plan Element" action.

    • Element - A value, either a string or number, to be removed from the plans list for the next set "Create" action.

  • Clear - Clear the specified predefined set.

    • Set - The set to clear.

Manual :

  • Add - Adds a new element to the specified set. Creates the set if non-existing.

    • Element - A value, either a string or number, to be added to the specified set.

    • Set - The set, to add the element into.

  • Delete - Deletes an element to the specified set. Only applicable if the set is existing.

    • Element - A value, either a string or number, to be added to the specified set.

    • Set - The set, to remove the element from.

Conditions

General :

  • For Each - Loops through a specified predefined set of elements.

    • Set - The name of the set to loop through.

  • Has Element - Checks if an element exists on the specified predefined set.

    • Target - The target element to check if it exists in the set.

    • Set - The name of the set to check elements.

Conditions.png
  • Has Set - Checks if a set exists.

    • Set - The name of the set to check if existing.

Instantaneous :

  • Has Element (String) - Checks if an element exists on the instantaneously defined set.

    • Target - The target element to check if it exists in the set.

    • Set - Input the set, example "Item1,Item2,Item3".

    • Separator - Separator for the set of string-type elements.

  • For Each (String) - Loops through an instantaneously defined set of string-type elements.

    • Set - Input the set, example "Item1,Item2,Item3".

    • Separator - Separator for the set of string-type elements.
       

Expressions

General :

  • Size - Returns the set size; the number of elements in the specified predefined set.

    • "Set" - The set to check the size.

  • HasElement - Returns 1 if it exists, 0 if not. Syntax: "HasElement(Target, Set)". 'Target' is the element to look up and 'Set' is the name of the set. 

    • "Target" - The target element to check if it exists in the set.

    • "Set" - The name of the set to check elements.

Instantaneous :

  • SetSize - Returns the set size; the number of elements in the specified instantaneous set. Syntax: SetSize("Item1,Item2,Item3", Separator).

    • "Item1,Item2,Item3" - Input the set, example "Item1,Item2,Item3".

    • "," - The separator for the set of string-type elements.

  • HasSetElement - Returns 1 if it exists, 0 if not. Syntax: "HasSetElement(Target, "Item1,Item2,Item3", Separator)". 'Target' is the element to look up and 'Separator' is the string to split the set items. 

    • "Target" - The target element to check if it exists in the set.

    • "Item1,Item2,Item3" - Input the set, example "Item1,Item2,Item3".

    • "," - The separator for the set of string-type elements.

For Each :

  • CurElement - Returns the current value from the 'For Each' or 'For Each (String)' loop conditions.

Features

The Set is an addon that allows the implementation of the JS Set API with both an instantaneous declaration and creation-based set by defining the elements and the set. It allows you to store unique data different from the Array plugin which stores data regardless of duplication. 
This is a very useful game development tool that can efficiently loop and manage list of data values, for processing.

Features :

  • JS Set API implementation.

  • Instantaneous Set declaration.

  • Creation-based defining of set, by declaring the elements and the set.

  • Easy to use and no programming required.

  • Well-supported and fully tested.

  • Stores unique data in an array-like structure.

  • Loops through set conveniently and efficiently.

  • Retrieve the elements or values and the count.

  • Check the elements and set.

  • Creation-based planning tools.

  • Construct 3 editor support.

  • Construct 3 runtime.

  • Dedicated c3runtime design.

  • Runtime maintenance support.

Feature Showcase

The Set is an addon that allows the implementation of the JS Set API with both an instantaneous declaration and creation-based set by defining the elements and the set.

Instantaneous Implementation

Defined Implementation

 
 
 
 
 
 

User Guide

The Set is an addon that allows the implementation of the JS Set API with both an instantaneous declaration and creation-based set by defining the elements and the set. It allows you to store unique data different compared with the built-in Array plugin which stores data regardless of its duplication. 

Even though the Set and the Array have different ways to store data, it still has some similarities
Mainly, they both loop through their elements.
The Set addon has that same functionality although it only stores unique values, and duplicate ones are ignored. 

The Set also has two (2) different ways of declaring its elements or values.
One (1st) is the instantaneous declaration where you can declare the list of elements on the same line, both from conditions and expressions, which the built-in Construct can't efficiently do without this feature.

Another (2nd) is the creation-based declaration of elements and set name. This one works similar with the built-in Array addon, only that it stores unique values and is well-equipped and more efficient for one-dimension (1D) lists.

 

The Set addon is a very useful tool for game development, where it efficiently processes and manages list values, which is commonly done in all sorts of applications.
 

Instantaneous Implementation

Defined Implementation

Instantaneous Implementation

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Defined Implementation

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

The Set addon is inspired from TobyR's Set addon from Construct 2. It started the great idea of implementing the Set feature into Construct projects. Even though it doesn't have the Set API, Instantaneous and Defined implementation, it's still though a great way to implement the features at that time.

TobyR's Set

Construct 3 : Array

The Array addon is the built-in feature of Construct 2 and Construct 3.

It specializes in 3 dimensional arrays and tolerant to duplication of elements, which is comparable to the Set addon which specializes in 1 dimensional lists with unique elements and instantaneous implementation. 

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information: