Game Development Community

Unable to find function playiPhoneMovie

by Anna Tito · in Technical Issues · 05/04/2011 (8:14 pm) · 4 replies

Hey ya!

I am just trying to get a movie to load using this tutorial: http://docs.garagegames.com/it2d/official/content/documentation/Tutorials/iOS%20Series/Media.html and it keeps throwing up an :

game/scripts/Navigation/Nav_Button.cs (36): Unable to find function playiPhoneMovie

I am using Mac, iTorque 1.4.1

Here is the code I am using to call it
.....

else if(%ButtonName $= "Nav_PlayMovie")
{
echo("playMovie");
%found = playiPhoneMovie("~/data/animations/Test_MainEngineRoom", "m4v", 0, 0);
if(%found)
{
echo("found");
}
else
{
echo("notfound");
}
echo("end play");

.....

am I missing an import step or something, I have ios Movie player & music support on.

Thanks :)

About the author

Game Design and Programming Student at RMIT.


#1
05/05/2011 (7:47 am)
@Anna - Just to verify, the checkbox "Movie Player Support" in the editor for the project is on? Which version of Xcode and the iOS SDK are you using?
#2
05/05/2011 (9:56 am)
The only reason the function would not exist is if the preprocessor definition TORQUE_ALLOW_MOVIEPLAYER is not enabled. When you click the checkbox, the T2DBuild.xcconfig file is updated to define that definition.

If the checkbox is not working, then you have discovered a bug I need to fix.
#3
05/05/2011 (3:10 pm)
Michael: Ok found it!! :D. The play movie chucks an error in TGB sim. Once I tweaked the pathing, the playiPhoneMovie doesn't seem to like the "~/" part and changed my data blocks, too many blocks loading at the same time as the movie was causing it to crash, i got it working. Thanks for the help :) Sorry for the bother.

I am using the xCode Version 4.0.1, Build 4A1006 to ios 4.3 so you now know it works on that. :)

To other n00bs to iTorque such as myself : Just an FYI many of the iTorque platform specific functions have no sim equivalent in the TGB you have to test them on a device or write pc specific code to test the functionality, the i specific functions just throw up errors when not on the device :)
#4
05/05/2011 (3:20 pm)
@Anna - Great! Glad you got it working. I'll be around the forums if you run into any other errors.