Hi Support. I have the following scenario:
I am creating a Preflight Profile and adding some actions list in the Extra section. However, I would like to restrict with variables the execution of the action list. Please see the following example:
The user must be prompted to select a format from a list:
Example: Format 1, Format 2
If the user selects Format 1, then the Action List 1 should be run.
It the user selects Format 2, then the Action List 2 should be run.
Please, could you recommend me how to set the variables set and restrictions in the profile?
Thank you very much!
Action List and Variables
Re: Action List and Variables
Hi,
It's feasible using variables. For my demo, here is my set of files:
Action lists:
blue_circle: this one draws a blue circle
red_circle: this one draws a red circle
Preflight profile
circles: dummy profile attaching 2 actions lists as changes.
Now variability:
Use a variable sets with three variables:
Format:text variable (Say values A & B)
makeBlueCircle:boolean, rules based, true if format is A, false otherwise.
makeRedCircle:boolean, rules based, true if format is B, false otherwise.
Now back to the profile, enable variables and condition action execution (boolean) to the value of makeBlueCircle for action list blueCircle and makeRedCircle for action list redCircle.
Now run, user is asked for format. If it says A, blue circle appears. If he says B, red circle appears.
![Image](https://i.ibb.co/MhLgfx3/Screenshot-2023-08-01-at-20-54-36.png)
Of course my circles demo has no point but to show how you can condition action execution with variables![Wink ;)](./images/smilies/icon_e_wink.gif)
![Image](https://i.ibb.co/Zx9qbrk/Screenshot-2023-08-01-at-20-54-28.png)
The profile:
https://fromsmash.com/SgqH7pjih3-ct
HTH
Loic Aigon
Enfocus PitStop pProduct Manager
It's feasible using variables. For my demo, here is my set of files:
Action lists:
blue_circle: this one draws a blue circle
red_circle: this one draws a red circle
Preflight profile
circles: dummy profile attaching 2 actions lists as changes.
Now variability:
Use a variable sets with three variables:
Format:text variable (Say values A & B)
makeBlueCircle:boolean, rules based, true if format is A, false otherwise.
makeRedCircle:boolean, rules based, true if format is B, false otherwise.
Now back to the profile, enable variables and condition action execution (boolean) to the value of makeBlueCircle for action list blueCircle and makeRedCircle for action list redCircle.
Now run, user is asked for format. If it says A, blue circle appears. If he says B, red circle appears.
![Image](https://i.ibb.co/MhLgfx3/Screenshot-2023-08-01-at-20-54-36.png)
Of course my circles demo has no point but to show how you can condition action execution with variables
![Wink ;)](./images/smilies/icon_e_wink.gif)
![Image](https://i.ibb.co/Zx9qbrk/Screenshot-2023-08-01-at-20-54-28.png)
The profile:
https://fromsmash.com/SgqH7pjih3-ct
HTH
Loic Aigon
Enfocus PitStop pProduct Manager
-
- Newbie
- Posts: 6
- Joined: Tue Dec 20, 2022 12:17 am
Re: Action List and Variables
Thank you very much for your reply. It was very useful. I was able to do according to your comments and is working well.
Re: Action List and Variables
Glad I could help.
-
- Newbie
- Posts: 1
- Joined: Thu Dec 21, 2023 9:59 am
Re: Action List and Variables
Thank you for sharing this great topic. I have access to a lot of useful information.
Igeometry dash lite'm new member Berta
-
- Newbie
- Posts: 2
- Joined: Tue Feb 27, 2024 8:02 am
Re: Action List and Variables
1. Define Variables:
Create a Variable Set named FormatSelection (or any suitable name).
Within this set, define two Boolean variables: Format1Selected and Format2Selected.
2. User Input:
In the "Extra" section of your Preflight Profile, add a User Input action.
Configure this action to:
Prompt: Ask the user to select a format (e.g., "Select Format:").
Options: Provide the available formats, such as "Format 1" and "Format 2".
Store in variable: Set this to the FormatSelection variable set.
3. Conditional Execution:
Add your Action Lists (Action List 1 and Action List 2) to the Preflight Profile.
Before each Action List, add a Conditional Action with the following settings:
Condition: Use a Variable condition.
Variable: Select the FormatSelection variable set.
Operator: Set this to "equals".
Value:
For Action List 1: Set the value to "Format1Selected".
For Action List 2: Set the value to "Format2Selected".
4. Setting Variable Values:
In the User Input action, when the user selects "Format 1", set the value of Format1Selected to true and Format2Selected to false.
Similarly, when the user selects "Format 2", set the value of Format1Selected to false and Format2Selected to true.
Explanation:
The Variable Set stores selections made by the user.
The User Input action captures the user's format selection and stores it in the variable set.
Conditional Actions only execute the associated Action List when the corresponding variable (Format1Selected or Format2Selected) is set to true.
Setting the variable values in the User Input action ensures that only the selected format's corresponding action list runs.
Create a Variable Set named FormatSelection (or any suitable name).
Within this set, define two Boolean variables: Format1Selected and Format2Selected.
2. User Input:
In the "Extra" section of your Preflight Profile, add a User Input action.
Configure this action to:
Prompt: Ask the user to select a format (e.g., "Select Format:").
Options: Provide the available formats, such as "Format 1" and "Format 2".
Store in variable: Set this to the FormatSelection variable set.
3. Conditional Execution:
Add your Action Lists (Action List 1 and Action List 2) to the Preflight Profile.
Before each Action List, add a Conditional Action with the following settings:
Condition: Use a Variable condition.
Variable: Select the FormatSelection variable set.
Operator: Set this to "equals".
Value:
For Action List 1: Set the value to "Format1Selected".
For Action List 2: Set the value to "Format2Selected".
4. Setting Variable Values:
In the User Input action, when the user selects "Format 1", set the value of Format1Selected to true and Format2Selected to false.
Similarly, when the user selects "Format 2", set the value of Format1Selected to false and Format2Selected to true.
Explanation:
The Variable Set stores selections made by the user.
The User Input action captures the user's format selection and stores it in the variable set.
Conditional Actions only execute the associated Action List when the corresponding variable (Format1Selected or Format2Selected) is set to true.
Setting the variable values in the User Input action ensures that only the selected format's corresponding action list runs.