retrieving viariabe with same name as current animation?

This forum is currently in read-only mode.
  • I everyone,

    I'm trying to work out a slow motion effect for Specific on screen enemies at specific times.

    I wish there was a way to retrieve "the default speed of any given animation" but since that doesnt seem to be possible, I'vew created private variables with names exactly matching the names of the animations which are being used to store the original or default speed of those animations.

    My problem is the syntax for a single line of code(event) that will set the animation speed to the value of the private variable which shares the same name of the current animation playing.

    So far, nothing works.

    I'd imagine it would be something like this:

    enemy_0_skin.Value('enemy_0_skin.AnimName')

    but that of course tries to create a new singe variable called "'enemy_0_skin.AnimName"

    any suggestions?

    thanks

  • Have you gone over the Ghost Shooter tut?

    SpriteSet animation speed to Sprite 0 .Value('variable name')

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i dont think you can do that, but if you can, it's without the quotes

    enemy(animname), not enemy('animname')

    if that doesnt work, you can use a hashtable

    they are accessed with regular strings i believe

    work out a system where you can use only one hashtable for everything if possible, because picking a hashtable without groups is nearly impossible if i remember correctly

  • unfortunately it does not work even if the quotes are removed.

    would this technically be considdererd a bug that it doesnt work, or more of a feature request for it to work?

    another solution would be if I there was an expression to retriev the default speed of a given animation. The data is there, it would sure be handy If i could just retrieve it instead of jumping through hoops.

  • a feature request

    most languages dont't let directly access variables by name using a string like that, though this isn't a language exactly

    you should try a hastable though, its not really jumping thru hoops. just as easy as using private vars really

    its made for this kinda thing

  • thanks much for your patience and siggestions, Lucid.

    I'll give hashtable a shot as soo as I get the chance.

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