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 - merrak

Pages: 1 2 3 ... 148
Ask a Question / Re: Finding the center of an actor
« on: November 19, 2018, 05:36:29 pm »
x + (width of self / 2), y + (height of self / 2)

Ask a Question / Re: Top Ten High Scores working in flash but not html5
« on: November 18, 2018, 06:43:29 pm »
...Am I able to publish a game like this even though it is not original and is essentially just a  re-skinned flappy birds demo? I am not selling anything so should be ok i guess. Anyway thank you again.

I'm not an expert in copyright law, so take my words with a grain of salt, but I wouldn't expect anyone to complain. For one, there are a lot of flappy bird clones out there. Second, copyright applies to an expression, not an idea. Third, the original Flappy Bird itself infringed on Nintendo's copyright (uses Mario assets).

If you're interested in legal issues surrounding Flappy Bird then see

Ask a Question / Re: Top Ten High Scores working in flash but not html5
« on: November 18, 2018, 06:14:48 pm »
That looks right. I just noticed your other comment about wanting a global high score. There may be some extensions for that. If you host on Newgrounds then you can also use their high score board.

Ask a Question / Re: Top Ten High Scores working in flash but not html5
« on: November 18, 2018, 06:08:01 pm »
That's the code with the save game block. It should go after the load game block

Ask a Question / Re: Top Ten High Scores working in flash but not html5
« on: November 18, 2018, 05:45:52 pm »
Uninitialized variables (attributes) are not handled the same across different platforms. Flash is more forgiving in this regard. It looks to me like what's happening here is Flash is seeing the uninitialized list and initializing it for you, where as HTML5 is just seeing "null" and complaining.

In that case, you can do this to fix it: After the block where you load the game attributes, insert this:

Code: [Select]
if HighscoreTopTen = null then set HighscoreTopTen to create new list

The null block is in Flow > Advanced

Ask a Question / Re: Top Ten High Scores working in flash but not html5
« on: November 18, 2018, 04:48:45 pm »
Can you show us the code for the custom event updateHighScoreTopTen? I got this error in the debug console, which points to that event.

Code: [Select]
Uncaught TypeError: h.engine.getGameAttribute(...).insert is not a function
    at Rm._customEvent_updateHighscoreTopTen (Flappy Santa V.js:2716)

Extensions / Re: Artificial Intelligence Tools Extension (Beta Release 8)
« on: November 14, 2018, 07:14:57 pm »
Sounds like you found the culprit. The x,y position of an actor is always the upper left corner. But you don't need to manually add half of the tile width. The Y of self block has "Y (center) of self" in its dropdown menu options.

The documentation is a little out of date. Adding a footnote about centering sounds like a good idea.

Extensions / Re: Artificial Intelligence Tools Extension (Beta Release 8)
« on: November 13, 2018, 07:53:47 pm »
Hi Robert,
The pathfinding AI works great, which helps my project tremendously!
Still, I found it can generate errors in my specific case.
As I understand, it has to do with my code rather than with your tool, but I'd appreciate any leads.
The bug seems to be triggered when my Avatar collides with the detection sensor and the NPC is itself collided with a tile at the same time, but I'm not entirely sure.
Here's the error message it generates (also see attached as a screenshot):

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at AStar$/bestPath()[C:\Users\Demid Tishin\AppData\Roaming\Stencyl\stencylworks\engine-extensions/ai-tools/AITools.hx:1291]
   at AITools$/findPath()[C:\Users\Demid Tishin\AppData\Roaming\Stencyl\stencylworks\engine-extensions/ai-tools/AITools.hx:196]
   at MethodInfo-6771()[Source/scripts/Design_9_9_NPChackandhug.hx:776]
   at com.stencyl.models::Actor/innerUpdate()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:1530]
   at com.stencyl::Engine/update()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2479]
   at com.stencyl::Engine/postUpdate()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2618]
   at com.stencyl::Engine/onUpdate()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2611]

I tried running the game in the debug mode, but it constantly requests Visual Studio, which I already have (up-to-date version) so I have no clue how to debug it.
Here's the game project file if you'd like to take a quick look:
And here's a recorded video (the error message does not show on video since it's generated over the active Adobe Flash window)

Thank you very much!


This is line 1291, the one that your game is complaining about

Code: [Select]
graph.nodeAt( startRow, startCol ).g = 0;
where startRow and startCol are the tile coordinates you specify in the "find path" block. If the graph doesn't exist then you would get an error in line 1287, so the only remaining possibility is that there is no node at the coordinates you specify.

I don't provide much error checking with the AI tools, so what you can do to catch this condition is use the "node exists at R, C" block to make sure you're running path finding on a valid position. If a node doesn't exist at R,C, maybe have it print a warning so you'll know the problem is with your graph.

I suspect that's the issue. At the moment I'm not able to verify it myself by downloading your project. My Stencyl has a modified engine, so I'd have to revert back to "vanilla Stencyl" to test it.

You can also modify the AITools.hx file to make that function more robust. Add this to line 1291, right after the line "openSet.push( graph.nodeAt( startRow, startCol ) );":

Code: [Select]
if ( graph.nodeAt( startRow, startCol ) == null )
trace( "Warning: There is no node at (" + startRow + "," + startCol + "). Returning empty array." );
return new Array<Dynamic>( );

This will give you a safer mode of failure: the game shouldn't crash, and you'll get an error in your log viewer.

Ask a Question / Re: Can't Test games
« on: November 12, 2018, 11:06:44 pm »
It looks like you have the issue described here:,57126.msg301707.html#msg301707

Ask a Question / Re: Focusing camera on player isn't working
« on: November 11, 2018, 10:11:08 am »
So put the camera block bellow? Thanks

That's the only problem I can see. If that doesn't fix it then the problem likely lies in something you haven't shown us.

Ask a Question / Re: 1 light ok, 4 light = game crash
« on: November 11, 2018, 09:57:18 am »
Whoops. Somehow I missed the link.

That is a huge size for a Flash game. It doesn't even fit in my browser window. I think the first problem you're having is in targeting Flash. Flash will be slower than the other targets.

An RTS of the magnitude you're describing should be doable. A good example would be Dincicode's NC Tactics--although he doesn't have light. You'll want to take advantage of shaders. You would definitely benefit from the improved shaders support Stencyl 3.5 (which uses OpenFL 8+) offers. I forgot what OpenFL version Stencyl 3.4 is built on top of, but it is several generations old. You can do all the light operations in software only, like I did in my game, but optimization is the key.

Maybe if "Drawing" a rectangle in screen and clearing holes (not image API, just "Drawing". But, its posible create holes in a draw figure ??

I don't think you can do that--but even if you could, you don't want to. You're still not solving the optimization problem: redrawing pixels that you don't need to. The problem lies in doing unnecessary work, not in how you do the unnecessary work.

Ask a Question / Re: Focusing camera on player isn't working
« on: November 11, 2018, 09:32:47 am »
You're moving the camera first, then moving Puffy Man. So you have your camera centered on his original position.

Ask a Question / Re: 1 light ok, 4 light = game crash
« on: November 10, 2018, 09:49:08 pm »
I've done this kind of thing plenty of times before and haven't had any issues. There definitely is a tight upper limit to how many drawing operations you can perform per frame, but 4 seems like such a low number. I'd expect better performance than that. There's probably an important variable in this scenario I'm not able to see... such as image size or screen size.

Do you have a playable demo uploaded somewhere, like on Stencyl Arcade?

Ask a Question / Re: Games don't work after installing extensions
« on: November 10, 2018, 09:45:57 pm »
Was the extension you added the dialog extension? It'd really help to see the generated logs, not just the error dialog that pops up.

Ask a Question / Re: Fullscreen Troubles
« on: November 10, 2018, 09:44:22 pm »
You could not possibly fathom how dumb I feel right now.

I think all of us, myself included, have had plenty of those kinds of moments :P Glad to hear you got it working!

Pages: 1 2 3 ... 148