Im building an android game for a school project, can anyone think of a way to skip an intro video, or any video, with a left click? Because touchscreen has no ESC key
thanks
You can create events with Lua script, which means it's possible to simulate pressing the escape key.
function mouseEvt(typ, pos)
if typ == eEvtMouseLeftButtonUp and Conditions["cutscene"].ConditionValue then
createEvent('eEvtKeyDown',{x=0,y=0},eKeyEscape,0) -- simulate escape key pressed
Conditions["cutscene"].ConditionValue = false -- set cutscene condition back to false
end
end
registerEventHandler("mouseEvent", "mouseEvt")
For this to work you will need to create a condition somewhere in the editor. Call it cutscene & set the default value to false. Now what you will need to do is create a set condition action part linking to that condition just before the play video action part to set the condition to true. You could also use this for wrapping around any begin/end cutscene action parts you create too as any action parts you insert between begin & end cutscene action parts can be skipped with ESC too.
Not sure if this will work as it's written off the top of my head, but worth a try I guess.
P.S: add the script to the script section & make sure the script type is set as definition in the properties section.
P.P.S: tried to add the script inside of a code block but the forum is messing up the code block for some reason & is inserting html tags into it. Strange.