Stencyl 3.4.0 is now out. Get it now!

External Data Extension [2.0.0]

thiagojabur

  • Posts: 48
Good to hear, thiagojabur! I'll update the extension using this code. I currently can't test on a mobile device, so would it be alright if PM you when it's ready for testing?

Just for clarification, the files from /stencylworks/games/your_game /extras are stored in the compiled game in the folder /assets/data, at least on Flash/Desktop. Is this the case on Android as well?

Also, would you be able to figure it out for iOS? :)

Sure, you can PM me! :)

The problem with Android is that your apk is like a compressed directory, so, you don't have (direct) access to the directories structure. I'm not even sure that there will be a /assets/data inside your apk, since it is like a blackbox.

However, you can build up that file structure (/assets/data) by using the methods SystemPath.applicationStorageDirectory and SystemPath.userDirectory. Those folders will be created outside of your apk and you can read/write stuff there. The good thing about those two methods is that they actually work on Windows and iOS! Since they give you a relative path to a place where you can read/write stuff, you can build up your extension around those two methods.

Lets take Android for example. Lets assume that our app ID is com.potato.potatogame. Using SystemPath.userDirectory will give you access to the folder /Android/data/com.potato.potatogame. There you can then create /assets/data and store content there.

« Last Edit: March 25, 2015, 07:01:02 am by thiagojabur »

manicmario

  • Posts: 7
Ok, now I just need to find a way to play the mp4 files somehow... Full screen cutscenes would be great :-) Any ideas? SWF video is not enough if it's not a vector animation. I don't want to rasterize all the frames.

« Last Edit: March 27, 2015, 05:07:41 pm by manicmario »

ETHproductions

  • *
  • Posts: 415
@thiagojabur: Thanks for the information! I'll see if I can update the extension tomorrow.

@manicmario: I believe playing .mp4's is possible, but I have no idea how to do it. I'll ask if there's a way to do this, on StackOverflow.com. If anyone here knows how, your help will be greatly appreciated!

@Tebbo: Thanks! I try to contribute the best I can to this awesome community.... :)
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

manicmario

  • Posts: 7
There is a video player extension already, but it  can only stream files online  :(

spoogob

  • Posts: 1106
Saw this extension and thought I'd give it a go!

Ive been exporting some swf's (intro animation type stuff), and then using the play swf block (In the past ive used robs swf player behavior too). One thing I've noticed is my swf plays fine in flash, standalone flash player etc. But while they work in Stencyl, they play too quick!

Edit:

Ok, I found a line of code that I can manually alter the fps while the swf is playing then switch it back to normal afterward.

Maybe that option could be included in a future update?  (to set fps of the swf being used)

« Last Edit: March 29, 2015, 05:03:39 am by spoogob »

ETHproductions

  • *
  • Posts: 415
@spoogob: Thanks for trying it out! I'm glad you got it working. Would you mind sharing the code you used?

@manicmario: Thanks, I'll take a look into that. I've seen that it's only for iOS, but I may be able to get it to work on other platforms.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

captaincomic

  • *
  • Posts: 6109
If you want to look inside an .apk, you can rename it .zip and unzip it. It's just a zip file in disguise ;) (with a specific content structure).

spoogob

  • Posts: 1106
Hi,

Yeah the code was :

nme.Lib.current.stage.frameRate=24;

my swf i created in flash/aftereffects was created at 24fps. so i set up that line of code to 24, then before the scene changed to the next, I set it back up to 60 again. plays fine now and not really fast! (which im guessing it was just playing it at 60fps?) works anyhow.


manicmario

  • Posts: 7
@ETHproductions I've used it in a demo exported to flash and it works without any problems. Here it is http://gamejolt.com/games/adventure/sociopath/33079/ It's old, early concept but the video player is working... streaming from my dropbox

ETHproductions

  • *
  • Posts: 415
Sorry for not replying sooner. I'm currently working on adding in thiagojabur's solution for saving data on a mobile device.

@spoogob: Thanks! I'll see if I can add that into the SWF blocks. I'm not sure what Stencyl's default Flash frame rate is; I think it might be 100, but it may very well be 60, or even something in between.

@manicmario: Wow, I didn't know that worked! I'll look into it when I get a chance.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

manicmario

  • Posts: 7

@manicmario: Wow, I didn't know that worked! I'll look into it when I get a chance.

Title screen and mirror cutscene are mp4 files streaming from dropbox

ETHproductions

  • *
  • Posts: 415
I believe that version 1.4 works on mobile! If you experience any problems, please tell me.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

UnrealCanine

  • Posts: 243
Would it be possible to import animations as a swf and play them over an actor to avoid massive filesizes?

ETHproductions

  • *
  • Posts: 415
I believe so. I've never worked with SWFs before, but here's what I would suggest doing:

1. Try using your SWF with the "play swf at ( x: _ y: _ )" block.
2. If it doesn't play in the correct position, adjust the settings on the SWF and try it again.

When you get it working, I'll explain in detail how to make it follow an actor, and change the framerate if necessary.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

UnrealCanine

  • Posts: 243
From the looks of things, if I want a character to be on a 800x600 screen, I have to make  the swf 800x600? cause no matter what I put for x and y he sticks to the same spot