A simple way to replace variable names?

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi there,

    When I code I have this tendency to have to move global variables around (for example from one event sheet to another, or to an object's instance variable), however it's a hassle to do so for me because Construct 2's consistency checker gets in the way (I can't simply delete the declaration of the variable and let the compiler show me the parts I have to change as I would in a programming language, furthermore deleting the declaration is not an option because it removes all uses of the variable). Is there a replace variable functionality implemented anywhere in Construct 2 that I could use to ease the process along?

    Thanks for your help!

  • There no simple way to do it.

    You might to try Dictionary Plugin, it may add and delete keys as variables. It could replace keys.

  • You can cut and paste event variables between event sheets. When you paste it back to the second sheet all the events that disappeared should reappear again (providing the variable's scope hasn't changed).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the suggestion Joannesalfa! Although using a dictionary to perform this task seems a little heavy handed. And I do like grouping things together in their respective objects/event sheets.

    Ashley Thanks for the tip, that works! I've never tried it before because of the warning it gives and the subsequent deletion of events. Any suggestion about the change from a global var to an object var though? Any chance that a simple way will be added in the future?

    Cheers!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)