Construct 3 suggestions & ideas

Suggest and vote on ideas for Construct 3! Please note this is only one aspect of planning. We do not guarantee any features here will be implemented, even if they are top-voted ideas. The aim is just to collect feedback. Remember to search for existing submissions before adding an idea, describe your ideas as comprehensively as possible, and vote for plausibleĀ ideas that are well thought out. Please seeĀ our full guidelines on suggesting features.

33 Vote

Dynamically Reference Any Variable (Local, Global, Instance Variable, Booleans)

Reference dynamically any variable (Local, Gloval, Instance Variable, Booleans) etc...without the need to be reference it first

Example:

Sprite has Variables:

-health

-Score

-Class

===============================

Right now to get the value of any of those Instance Variables we are forced to create the Action on the Editor and reference the Variables, for Example:

Print on a txt "Sprite.Health" so it cannot be changed it's locked to the var Health.

But if we had Dynamic Variables we could use it like we use the Dictionarys.Get("Key")

Example:

Note: all the Examples from now on, are assuming that we did the Pre picking of the sprite already in the conditions

I could have a Dynamic Variable Named "Value" where I could change it at any time during RunTime to any of the (health, Score, Class)

Set Var >>>>>Value = "Score" as txt

And just do set Txt To >>>"Sprite.Value" >>>>> Will print the Sprite.Score value

=====================

or

=====================

Set Var >>>>>Value = "Health" as txt

And just do set Txt To >>>>"Sprite.Value" >>>>> Will print the Sprite.Health value

=====================

The same goes for the (Global & Local Variables)

if we had

Local Var >>>>Speed

Global Var >>>> Deads

And we need to retrieve one of those values, we will do:

Set Var >>>>>Value = "Speed" as txt

And just do set Txt to >>>>>"Value" >>>>Will print the Local var "Speed" value

========================

or

========================

Set Var >>>>>Value = "Deads " as txt

And just do set Txt to >>>>> "Value" >>>>Will print the Global var "Deads" value

This will give us the option to build very Powerful strings that can be changed dynamically at Run Time, and gives a lot of freeDom

=============================

This is how its working at the moment: if you need to refference any variable you need to do a lot of Else statements to prepare everything before RunTime

  • tarek2
  • Mar 31 2020
  • No status
  • Attach files
  • tarek2 commented
    31 Mar 12:36

    Or With Dynamic calls can be used like this and avoid many Else statements

  • and 21 more