Changing parts of a line of script

  • #1, by lukasFriday, 18. March 2022, 01:25 2 years ago
    I'm looking for a way to change parts of a line of script.
    I use afrlme's definition script for controlling animations.
    A line of script looks might look like this:

    setFrames("animation42", 5)


    I would like to be able to change parts of this line by calling a value. I'm aware I can't just make it work like this:

    setFrames("<vs=which_animation>", 5)


    or this:

    setFrames("Animation<v=animation_number>", 5)


    or this:

    setFrames("Animation42", <v=which_frame>)
    

    However those examples describe pretty much exactly what I would like to do. Is this even possible?

    Newbie

    10 Posts


  • #2, by afrlmeFriday, 18. March 2022, 03:04 2 years ago
    setFrames("animation42", Values["example"].Int)

    Imperator

    7278 Posts

  • #3, by lukasFriday, 18. March 2022, 09:22 2 years ago
    Works like a charm, thank you very much, this alone will save me hundreds of lines! Is there also a way to change the animation that is triggered by this line of script? The most comfortable thing would be to be able to replace the whole name of the animation by inserting a string, but even being able to replace the number part by inserting an integer value (so that it reads "animation43" instead of "animation42", e.g.) would make things so much easier.

    Newbie

    10 Posts

  • #4, by afrlmeFriday, 18. March 2022, 11:18 2 years ago
    setFrames("animation" .. Values["animation number"].Int, Values["animation frame"].Int)

    Imperator

    7278 Posts