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

Pages: 1 2 3 4 5 ... 12
31
Ask a Question / Re: Actor on tile detection?
« on: October 18, 2016, 08:25:46 am »
I've read everything you've said and I really don't understand why you wouldn't just use actors. In terms of performance, you don't need to worry about the size of your map and how many actors will exist on it. All that matters for performance is how many actors *are currently on screen*. You can have tons of actors offscreen and it will not affect your performance too much, because Stencyl isn't drawing/updating/testing them until they are on screen. Just use actors with sensor collision shapes. You may have to make many of them, but what's the problem with that?  You were going to make many tiles, too, only now they would be actors and they would mostly be offscreen at any given time, so performance shouldn't be a problem. Also, if they are actors, you can scale/tint them for more variety, thus reducing how many you need to make. I have an overworld map with just such requirements, and I have used actors to accomplish exactly what you want. It works great and performance isn't a problem because the vast majority of them are offscreen. Stencyl is at it's easiest when you use actors whenever possible.

Also -- if it were possible to have a tile with all the capabilities you are looking for, it would essentially become an actor, because tiles are basically stripped-down, barebones actors by another name. To add polygonal sensors to tiles would be to essentially turn them into normal-physics actors that can't be moved ... so just use normal-physics actors that can't be moved. It's virtually the same thing. :)   (If you want to scale them, make sure you set the physics to "cannot be pushed", instead of "cannot move".)

Also also -- be sure that your actors do not have the "always simulate" behavior, or they will continue to affect performance when offscreen.

32
Ask a Question / Re: How to make text appear above an actor?
« on: October 16, 2016, 09:45:52 am »
I have been having a similar issue and I have submitted a bug report to the Stencyl team just now.

Having said that, I am pretty certain your math is not correct in the actor behavior drawing (when drawing from an actor behavior, the default is actor space, so [camera X] - [X of Self] would produce strange results. Imagine your Camera X is 1000 and your X of Self = 300 (in screen coordinates, since this is a HUD actor). The result would be that the text is drawn 700 pixels away from the 0,0 of your actor.)  Have you tried using the "switch to actor space" block (to be certain of your origin) and using 0, 0 as the coordinates for drawing? (This would result (in theory) in the text being draw in the upper left corner of your actor's image).

As I said, I've submitted a bug report, because I also have been wrestling with this lately and have found no way to get drawing text from an actor behavior to work properly, and as you said - it works from a scene behavior (but it draws behind any HUD actor.)

EDIT: Just to be clear, this only seems to be a problem for HUD actors.

33
I cropped the top portion out because it's irrelevant to what you're asking about. (I have different code for different types of one-way platforms, such as the difference between one-way platforms and "steps" in a staircase.)  It's basically:

If [group of self = Step Group]
         Step group code goes here
-------------------------------------------------------
otherwise
          All other one-way platform code goes here **This is the code you are seeing in the image**
--------------------------------------------------------

The step code is still being tweaked and doesn't work perfectly yet, so I didn't include it in the image in order to avoid confusion. If you simply use the code you see in the image in the "updating" event of your platform actor it should work well, but remember that you may need to adjust the "1" number, based on your player actor's maximum X speed. This is a hard-coded value that works specifically for my player actor.

34
Colburt - it looks to me like the OP is already using that forge behavior. I tried it too, and it didn't work out-of-box for  me, either. But ...

...  I fixed it. The solution is to test for the difference of the player's feet position and a value just *below* the top of the collision box for the platform. (I called this attribute the "Y Offset For Feet Position Test"). It is set to the value of the Y coordinate of the top of the platform's collision box + 3 pixels. You will also need to test to see if the edge of the player's collision box is "inside" the X-range of the platform's collision box (to prevent unwanted sideways collisions).  I don't know why this 3 pixel vertical buffer is needed, but it is.  (A 1 pixel horizontal buffer was also needed. These numbers would likely vary based on your player actor's x and y speeds.) In other words:



(Note: scroll this post to the right to see the full code image)

I recommend not relying on the "if top/bottom/left/right of actor was hit" blocks for certain elements of platform games. They are probably fine for other types of games, (and in some instances work fine for platform games) but the margin of error with these blocks is too large for certain elements of platform games, where physics must be pixel-perfect.  I think this is one of those times.  Someone please correct me if I am wrong about this, but that has been my experience.

35
Ask a Question / Re: Best way to backup your projects?
« on: September 30, 2016, 05:44:41 pm »
In addition to backups I also find it useful to use the "Save game  as" to save numbered versions regularly, and especially before making major changes.  This makes it easy to roll back, and is also a safety net if a version gets corruptrd on disk. You have to delete the oldest versions to keep disk space usage reasonable.

I do this a lot, too. Fortunately, Stencyl has been very stable (!) for a long while now and I don't find it as necessary, but it doesn't hurt because you never know. Also, as you said - it's a great bit of security for when you're going to make a big change and want to easily roll back if the change doesn't go so well.

36
Ask a Question / Re: Best way to backup your projects?
« on: September 30, 2016, 07:24:31 am »
I go to the Stencylworks/Games/Game Name folder, I right click on the folder for the current version of my game and choose "Send to ... compressed (Zipped) folder". When that's done, I right-click on the newly created zipped folder and select "send to ... Dropbox". I then also copy the zipped folder to an external SSD. I do this just about every night.

37
Ask a Question / Re: Tileset Help Needed
« on: September 28, 2016, 08:58:34 am »
Are you selecting the masking color yourself (when you import the image into a tileset) or are you allowing Stencyl to determine the transparency on its own? (Whatever way you are doing it, make sure you've tried it the other way, too). You can select the masking (transparent) color on the left of the window that pops up after you've selected the image you want to import into the tileset editor.

(FWIW, I have never needed to select the masking color myself and have always allowed Stencyl to do it on its own and never had any problems.)

Also - are you totally certain your tileset's transparent pixels are actually 100% totally transparent? Is it possible that they are very, very slightly not transparent? You could check by using your gfx software's eyedropper tool to grab the "color" of the transparent pixels and see what comes up in the color selector pane of your gfx software.

38
Ask a Question / Re: Two platforms. Two problems.
« on: September 17, 2016, 07:51:35 am »
Regarding the sliding issue, does you player need to be able to move around while the block is sliding? If not, one solution is to find the value of (X Of Platform) - (X Of Player), store it in an attribute called "Platform Player X Offset" (or whatever you like) and then directly set the position of the player while the block is sliding (as in: Set X of Player = X Of Platform + Platform Player X Offset). This should work without any sliding at all. This would work with either physics (as in your first attempt) or the slide tween you tried after that.

As for the pushing issue -- if you grab the X,Y coordinate of the block when it's created and then set the X,Y of the block to this location in the "updating" event of the block, you can ensure the block will not ever move its position until it slides. You would need to use a control Boolean to determine whether or not this block is currently able to slide. For example:

(In "WHEN CREATING")
----------------------------------------
Set [Fixed X Location] = X of Self
Set [Fixed Y Location] = Y of Self

(In "WHEN UPDATING")
----------------------------------------
If not [Can Slide]
        set X of Self = [Fixed X Location]
        set Y of Self = [Fixed Y Location]

The [Fixed X/Y Location] blocks would be user-made actor attributes. Then, of course, after it slides, you will need to grab the new "Fixed X Location" and "Fixed Y Location" coordinate.

Basically, anytime you need to temporarily get around Box 2D physics, try setting the position of things directly. Box 2D is a double-edged sword for platformer games. It offers terrific features that would otherwise be a lot of programming work that most of us wouldn't know how to do anyway, but it can also be a bit messy if you rely only on Box 2D physics because they can often be a little "too realistic" for a traditional platformer.

39
Ask a Question / Re: Animation frames not slicing correctly
« on: September 17, 2016, 07:26:36 am »
Are you certain you were exporting from Illustrator at the correct resolution? I've been using AI for months (in combination with Paint.Net) with no problems once I learned how to select the correct resolution for the export. You want to be sure to select Screen (72 ppi) when you export from AI. This choice is available in a window called "PNG Options" that automatically pops up after you hit "Export" and choose your save path. This may not be your issue, since an incorrect resolution would probably result in more obvious size problems ... but if your image is small enough, it might only make a small difference, so I thought it was worth a mention, just in case.

40
Ask a Question / Re: Scaling an Actor in Scene Designer
« on: September 17, 2016, 07:18:05 am »
Yes, I have also experienced this bug. I thought it was only happening when an actor was scaled an enormous amount, so I forgot about it, as it wasn't particularly necessary for me to scale that large. I guess it happens with smaller amounts of scaling, too.

41
I've been using the run and jump behavior for a long time (this is the kit with the animation manager, correct?) and it still works fine for me. Granted, I have *heavily* edited it (to add more platforming abilities) but I haven't fundamentally changed the physics of either the running or the jumping part of it.

42
Ask a Question / Re: what is z ordering for?
« on: September 09, 2016, 08:02:23 am »
If you want to limit the collision damage by same layer, then you need to use something like:

If [Layer ID of Actor 1] = [Layer ID of Actor 2]

Do a search for "Layer ID of" in the palette search bar and the block will come up.


43
Ask a Question / Re: Make maps list in order
« on: September 06, 2016, 07:04:05 am »
I think you're going to have to use a list if you want ordering, as I believe that is the essential difference between a list and a map.

44
Ask a Question / Re: Collisions aren't being detected?
« on: September 03, 2016, 11:18:27 am »
Sure thing - glad it worked. I think I experienced the same frustration a while ago when I made my blue slime. I think it comes down to the fact that "top wasn't hit" and "the other sides were hit" are not mutually inclusive. The left side can be hit AND the top can be hit at the same time. One doesn't necessarily qualify/disqualify the other.

45
Ask a Question / Re: Collisions aren't being detected?
« on: September 03, 2016, 10:57:39 am »
Interestingly enough, I realized that I have done in my game precisely what you are trying to do, right down to the blue slime enemy:



So, it definitely can work. :)

(And yes, the Blue Slime in my game moves.)

Pages: 1 2 3 4 5 ... 12