Changing parts of a line of script

  • #1, z lukasFriday, 18. March 2022, 01:25 hodinky 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?

    Bažant

    10 Posts


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

    Imperátor

    7285 Posts

  • #3, z lukasFriday, 18. March 2022, 09:22 hodinky 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.

    Bažant

    10 Posts

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

    Imperátor

    7285 Posts