Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Justin

Pages: 1 2 3 4 5 ... 201
Ask a Question / Re: Exlosion via image api dosn't work in one scene
« on: September 02, 2022, 06:22:59 am »
The problem is that the exploded parts of the actor are being attached to the screen, which uses on-screen coordinates. Using on-screen coordinates for this, though, will make it so the images don't move on the screen even if the camera moves. What you probably want to do instead, is attach the images to a layer.

In the collision event, just make the following change:

"attach image to screen" -> "attach image to to layer"

If you want to continue with on-screen coordinates instead, you would make these changes in the "attach image to screen" and "slide image by" blocks:
"x of 1st actor" -> "x (on screen) of 1st actor"
"y of 1st actor" -> "y (on screen) of 1st actor"
"x-center of 1st actor" -> "x (on screen) of 1st actor + half-width of 1st actor"
"y-center of 1st actor" -> "y (on screen) of 1st actor + half-height of 1st actor"

Ask a Question / Re: Exlosion via image api dosn't work in one scene
« on: September 01, 2022, 09:15:15 pm »
The test game works fine for me. Does it not work for you?

I'm not sure why it works in one scene but not the other. Perhaps collisions are causing the actors to die in a different behavior in your main play scene?

One thing I noticed is that it seems you're not using the explosion behavior as intended. It shouldn't be attached to the actor that explodes. It should probably only be attached to a single (not exploding) actor in the scene, or it should be a scene behavior. I say this for a couple of reasons.

1. It has cleanup code for deleting images after they've grown small enough. To ensure that this code is run, this behavior shouldn't be attached to an actor that's going to die.

2. It has an event for [ENEMIES] and [BLOCKS] colliding, rather than [self] and [BLOCKS] colliding. Since each copy of this behavior that's currently running has the same event, you only really need one of them.

Ask a Question / Re: Lyren's Utility Pack
« on: August 23, 2022, 05:12:32 am »
Commenting on the side note here.

Yes, in Stencyl's marketing materials, Design Mode is considered as "not code," and so that's mirrored on other sites that talk about Stencyl. My personal opinion is closer to yours, though. I think that calling Stencyl a no-code engine when the blocks are in fact an almost 1:1 representation of a programming language is a bit of a stretch. If you really want to call it "no code", you'd have to constrain yourself to pre-made behaviors, which would be rather limiting.

On the other hand, that's the perspective of somebody who knows what's going on. To a beginner, the idea of "coding" a game may seem impenetrable, and the idea of "no code" can be a welcome sign. And what Stencyl offers in that regard is, as you mentioned, a higher-level language, a little bit closer to natural language, that allows the designer to think about the game logic rather than the syntax of the code.

For some subset of Stencyl's users, this faux "no code" programming language may serve as a gentle introduction to programming, even if they're not aware that that's what it is. Plenty of people have taken what they learned from Stencyl's Design Mode behaviors, and used that as a stepping stone on their way to text-based programming languages.

So while I agree that calling it "no code" is inaccurate, if it's looked at from the perspective of a potential Stencyl user, especially somebody with no prior experience programming, I think it can be a helpful label.

Haxe doesn't know anything about Rune since you haven't created any Haxe externs for it. Perhaps try wrapping "Rune" inside "js.Syntax.code" to directly access it in the generated Javascript code instead.

js.Syntax API docs

Code: [Select]
  resumeGame: myResumeGameFunction,
  pauseGame: myPauseGameFunction,
  restartGame: myRestartGameFunction,
  getScore: myGetScoreFunction

I'm not positive that that will work, just the first thing I might try.

I took a quick look at the Rune SDK (linked for myself and others), and it says you need to load some javascript before anything else:
Code: [Select]
<script src=""></script>

You may be able to get away with adding that as a dependency in Settings > Advanced > OpenFL Settings.
Code: [Select]
<section if="html5">
    <dependency name="" />

Otherwise, you may need to create an engine extension with a modified index.html template. Here's an example of an almost blank HTML5 engine extension with an index.html template set up.

You may find it helpful to browse other HTML5 engine extensions that handle integration with different javascript SDKs, so here are a couple that I wrote:
- GameDistribution
- CrazyGames

Ask a Question / Re: Extension Not Updating
« on: August 09, 2022, 12:40:57 am »
What you're doing is correct, but you've actually stumbled on a particularly tricky engine extension to modify. That engine extension is a little bit odd. The extension's blocks.xml file does not actually match the extension's Console.hx class.

First, at the top of the Console.hx file, you have the package of the class. This should match the folder structure.

Code: [Select]
package com.fermmmtools.debug;

With that package, you would expect the file to be found here:

Code: [Select]

However, the class is instead found in the root folder of the engine extension.

Code: [Select]

Ok, so that's odd.. but what's stranger is this: the blocks in blocks.xml use a Console class in a completely different package.

Code: [Select]
spec="create console"

Note that the package here is not "com.fermmmtools.debug", but instead "com.nmefermmmtools.debug".

com.nmefermmmtools.debug actually matches a haxelib that's built-in to Stencyl, and has been included since the earliest Stencyl 3.0 previews. Before Stencyl 4.1, You can find it at Stencyl/plaf/haxe/lib/debug-console/1,00. captaincomic's hud-console extension is actually using this class that's included in Stencyl by default, and not the class included in the engine extension's own sources.

I can only guess about what happened, but I think that captaincomic wanted to expose a number of extra blocks using functionality from that class that Stencyl didn't use. So he copied a slightly different version of the class into his extension, created the blocks he wanted to be available (using the built-in class by mistake), and then tested it, and everything worked fine. There are some slight differences between the two classes, but nothing particularly noticeable, so the fact that the class contained in the engine extension's sources wasn't being used was easy to miss.

Ok, so you want to make changes to the Console.hx class on your side? Here's what you need to do:

1. Fix the blocks.xml files to point to com.fermmmtools.debug.Console, and move the Console.hx file to hud-console/com/fermmmtools/debug/Console.hx.
2. The Console file actually doesn't compile as-is, so you can just replace it with the file found at Stencyl/plaf/haxe/lib/debug-console/1,00/com/nmefermmmtools/debug/Console.hx. Or you can fix the compilation errors. If you replace the whole class, remember to change the package name to com.fermmmtools.debug, and reapply any changes you might have made to the class.

Ask a Question / Re: Plane goes crazy when firing
« on: August 07, 2022, 08:23:09 am »
Maybe you need to make sure that the plane can't collide with the bullet.

Ask a Question / Re: Does Ad Mob works how to test
« on: August 01, 2022, 06:59:59 pm »
Looks like the images on the article are probably broken by the https update. Until that's fixed, you can view the article on the internet archive.

edit: removed some irrelevant information about iap.

Something like this shouldn't have to do with your workspace. If the "new" version is what you're editing in Stencyl, and you press the "test game" button, then that's the version Stencyl will try to install to your Android device.

Your logs may have more valuable information. Stencyl may be having trouble installing the game. For a quick solution, you could delete the game from your Android device before testing.

Teaching with Stencyl / Re: Teaching - Flash & HTML5
« on: July 06, 2022, 09:43:44 pm »
If you have a flash player (there's still one bundled with Stencyl, for now) flash games can be played in that.

I've been thinking about adding an export option to package html5 games in something like redbean. That would allow it to spin up a server and open the appropriate page in the user's default web browser.

Ask a Question / Re: Encountered errors while building your game....
« on: June 29, 2022, 12:35:56 am »
It looks like telemetry was toggled on or off, but not all of the C++ code was recompiled. Try disabling the hxcpp cache if it's enabled (Tools > HXCPP Compile Cache Settings), and try cleaning the cache for your project (Tools > Game > Clean Project). Then try building again.

Ask a Question / Re: Simulating a key press not quite working
« on: June 21, 2022, 05:34:51 am »
Probably due to the order that things happen.

If the updating event in your jump code happens first, it'll look like this.

Code: [Select]
- Jump Code:
  - when updating
    - if up was pressed (is false)
- On Screen Button Code:
  - when the mouse is pressed on self
    - simulate key press using up (if up was pressed would return true only if it happened after this)

This is the problem with using simulated presses. Sometimes you end up missing them because the press isn't simulated until after you've checked for the key press. You could try simulating the key press in a scene behavior or event, since those get updated before actor behaviors/events.

Ask a Question / Re: Get Pixel?
« on: June 17, 2022, 09:44:58 pm »

Ask a Question / Re: Help Installing Java - Error log attached
« on: June 17, 2022, 09:07:51 pm »
It doesn't understand the four-part Java version ( That's a bug in Stencyl, not something wrong you did.

However, for the version of Stencyl that you're using, Java 18 is too new. You'll need an older version of Java for the Android/HTML5 targets. Try Java 11.

Ask a Question / Re: O Stencyl não está abaixando!
« on: June 15, 2022, 05:53:59 pm »
Ok, sounds like things worked out for you. Good to hear!

Ask a Question / Re: Error while building game - Stencyl version 4.04
« on: June 14, 2022, 06:39:32 pm »
Perhaps you can try running Process Monitor from Sysinternals Suite to try to see if any problems jump out in the logs.

Here's a guide that walks through debugging an issue.

In your case, you would want to open Process Monitor and filter for events involving "haxelib.exe". Then open Stencyl and try testing a game. If you see any errors involving haxelib in the results, feel free to share the Process Monitor logs with me.

Pages: 1 2 3 4 5 ... 201