While building to the iOS device sometimes I get following error:
[openfl] Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.afc"), &afcFd, NULL) == 0), function handle_device, file ios-deploy.c, line 718.
I know no permanent way to solve this however if after starting building you unplug and then plug back your device, there is a high chance that build will be successfully copied over.
If you ever want to change ID of layers in the scene designer, then there is a way. Not too easy, but at the same time nothing too complicated =)
layers ID are not corresponding to layers order in scene designer
First of all, save any changes in your game and open file of your scene in text editor.
All your scenes should be in your game folder:
there look for .xml files
mine is called 5.xml
to be sure, look up scene name in the middle of the second line in the document:
1 line <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 line <scene depth="13" desc="" eventsnippetid="85" extheight="384" extwidth="1088" extx="-32" exty="-32" format="2.1" gravx="-0.0" gravy="10.0" height="320" id="5" name="Level_01" revision="" savecount="0" tiled="1" tileh="32" tilew="32" width="1024">
Now before you start editing, BACK UP THIS FILE!!!
On the third line you should see layers, just write down id's in the order you need and save this file. Pay attention to draw order at the end of the line.
3 line <layers>
<layer color="0,0,255" id="0" name="Foreground" order="1"/>
<layer color="64,64,64" id="1" name="over_fishes" order="2"/>
<layer color="255,255,255" id="2" name="FISHES" order="3"/>
Save this file.
Now start Stencyl and open your scene. Everything should be ordered as you desired =)
IDs are now in order we need
Note that placed actors in the scene are assigned by old ID numbers, so you should double check and reassign actors to proper layers!
Out of nowhere came this error.
Game still was running fine on Flash, but on Mac and iOS devices I was getting this : Error : Invalid Cast.
So, I've run game in Debug Mode and got next:
[LOG] Called from Design_91_91_FishingPOOL::new, scripts/Design_91_91_FishingPOOL.hx 58
[LOG] Called from Script::getActorType, com/stencyl/behavior/Script.hx 1640
[LOG] Error : Invalid Cast
So I've checked that behaviour:
public function new(dummy:Int, engine:Engine)
_positionY = 0.0;
line 58 _Player = getActorType(143);
this is a scene behaviour and _Player is an actor type.
And I set _Player right when scene loads, but default value was not set. After I set it, everything works again.
So the solution in my case was to set default value for the Actor Type attribute.
Hope this will help someone =)
If you have troubles running your application with previous iOS version on latest Xcode, you can try your luck decreasing Deployment Target in Summary settings.
As you can see on the picture above, there is no actual device name in the list. Only generic iOS Device appears as well as installed simulators.
Your Device Name appears in the list after lowering Deployment Target in Summary. Now everything should work =)
At first, before working deep on second part, I decided to check how it will perform on mobile devices, so I converted the latest version to mobile and tried to run it on any of devices I have.
Unfortunately, I was unable to continue working under my port in Stencyl 2.1 and 2.2 due to atlas problems. My graphics take too much space to fit on a single atlas and Stencyl doesn't support that at the moment. So I decided to give a beta of 3.0 a try.
So far it looks promising and flash version works much faster than before.
On the mobile side, iPad version looks OK (I am testing on iPad 2), but Android seems not quite smooth 30-60 fps (HTC Desire Z). But I am still not sure how to make universal kind of app, that can switch resolutions on the fly.
Unfortunately I upgraded my iPod touch 4 to iOS 6 which is not currently supported as well as xCode 4.5. So don't be in a hurry to upgrade your iOS devices if you plan on developing with haxe.
I've trashed 4.5 and installed clean 4.4.1 and managed to get iPad builds to work, but iPod is in much worse situation, hope I can downgrade it to 5.0.1 and get builds working.
I will write about some difficulties I've met with all this mobile development in future posts.
Couple of advices:
don't make animations for your actors with lots of big frames, which will exceed 1024 x 1024.
don't upgrade xCode to 4.5 yet
don't upgrade to iOS 6.0 yet
Ok, so here is promised tutorial on how to create parallax scrolling in Stencyl with just actors and behaviour.
In fact it is a very simple task =)
Long scene (longer than game resolution width)
Moving actor (your hero or something)
Camera follow player behaviour
There is a parallax scrolling behaviour featured on StencylForge, but unfortunately it doesn't work as expected (at least for me) in it's initial form.
So here is a solution: download parallax scrolling behaviour from StencylForge and modify it as shown on picture.
X_initial and X_parallaxed are just numbers.
The end result. Use arrow keys for navigation.
You can download ready behaviour and import it in your game.
|File Size: ||6 kb|
|File Type: || png|
Apply behaviour to actors you want to scroll.
The lower Parallax Scrolling value will be, the faster will be object movement.
Let me know if you have any difficulties or problems with this.
Till the next time :D
These are pics I made with displacement maps as well.
I like how they turned out, though it was just a stupid experiment at first.
As usual later I applied some multiply for darker areas and double overlay layers for highlights.
Next I think I should play with blur to add some depth. But at much later stages. So far I am satisfied.