Play video in lua

  • #1, by andy-rinaldiTuesday, 04. November 2014, 15:39 10 years ago
    Hi guys,
    I'm not able to find how can I play a video in lua... thanks.

    Forum Fan

    160 Posts


  • #2, by SimonSTuesday, 04. November 2014, 16:20 10 years ago
    Hi, why exactly do you want to do that ?
    It's not possible yet, also if you want to export your game, all videos are renamed.

    Thread Captain

    1581 Posts

  • #3, by afrlmeTuesday, 04. November 2014, 16:22 10 years ago
    I don't think we have a function for playing videos with lua.

    We have startAnimation, startSound & startAction. I believe that is all of the ones we currently have available.

    See: here for all available (exclusive) player functions.

    Sorry.

    Imperator

    7278 Posts

  • #4, by andy-rinaldiTuesday, 04. November 2014, 16:57 10 years ago
    ok, no problem. I have a script that check a variable, if this is true, play video...

    if getObject("Conditions[boat_puzzleFault?]"):getBool(VConditionValue) == true then
    getObject("Conditions[boat_puzzlePassed?]"):setValue(VConditionValue, false)
    (play video here)
    else
    ....
    end
    


    I have solved with a alternative.

    Thanks.

    Forum Fan

    160 Posts

  • #5, by afrlmeTuesday, 04. November 2014, 17:45 10 years ago
    You could create a called by other action for it inside of the editor containing the play video action.

    By the way: Simon sorted out short-hand lua script code for Visionaire Studio 4.1 plus.

    if Conditions["boat_puzzleFault"].ConditionValue then
     Conditions["boat_puzzlePassed"].ConditionValue = true
     startAction("Actions[action_name]")
    else
     -- add else actions here or just remove this line & else if not needed.
    end
    

    also... you can access data tables without using ["object_name"] too.
    Conditions.condition_name.ConditionValue = false
    

    ...although some of the table names are different when using short-hand.
    Values["value_name"].Int -- Int instead of ValueInt or VValueInt
    Values["value_name"].String instead of ValueString or VValueString
    -- etc...
    

    Imperator

    7278 Posts

  • #6, by andy-rinaldiTuesday, 04. November 2014, 22:29 10 years ago
    ok, thanks.

    Forum Fan

    160 Posts