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

Pages: 1 2 3 ... 72
Attached image, hope this helps.

You can create a behavior for your staircase actor that holds the X and Y coordinates of the point you want your actor to return to (non-hidden attributes for that). That way you can attach the same behavior to all your staircases, and customize each one with a different set of coordinates. When your actor collides with the staircase, store those X and Y coordinates into a game attribute (the purple ones). This can all be done in the same behavior.

And when it is time to return to your main scene, you create your player actor at the stored coordinates.

Ask a Question / Re: I can't delete collision shapes
« on: Yesterday at 10:19:40 am »
Select them and press delete on your keyboard.

Ask a Question / Re: I want to use the looping block?
« on: September 22, 2018, 07:18:38 pm »
Try the code in the image attached.

Ask a Question / Re: Getting control values and mapping keys
« on: September 21, 2018, 12:44:10 pm »
Thanks for the help. I found a way to do this without the extension, after checking the Stencyl API and a lot of trial and error. I'm using this code to get a key's name from a control:
Code: [Select]
com.stencyl.Key.nameOfKey(com.stencyl.Input.getControlMap().get(("" + _ControlsList[ + _InitialDisplay))]).split(",")[1])[0])Controls List is a list attribute in which each entry has several parameters separated by a comma. The second one is the name of the control, the important one. This code also runs on a "repeat" loop, and Initial Display is for properly displaying on screen. You could replace all that with just the control name.

As for setting the key, I'm using this:
Code: [Select]
com.stencyl.Input.define(("" + _ControlsList[]).split(",")[1], [event.keyCode]);Happens on the "when any key is pressed" event. I was having trouble until I figured I had to put event.keyCode in brackets.

I still have to test how this is saved, though. Probably save the new values in a list, and reset it everytime the game is loaded.

Ask a Question / Re: Getting control values and mapping keys
« on: September 20, 2018, 03:33:38 pm »
Maybe this can help you:,31251.0.html
Thanks for that, I will take a look and see if it can help. I might be able to get the code from there. One caveat I forgot to mention is that I don't want to use extensions. What I'm working on will be something that other people can create games with (hopefully), and I don't want to add dependencies.

Ask a Question / Getting control values and mapping keys
« on: September 20, 2018, 03:11:46 pm »
I'm currently working on a menu to customize controls for a game. I want to display to the user the key on the keyboard mapped for each control and, if applicable, the mapped button on a gamepad for each control. I've run into two problems:

1) I can map a button on a gamepad and it works fine, but there are no blocks for keyboard mapping.
2) There are no blocks to get the button or key mapped to a control, given its name. I think I can simulate this, but having a way to get those would make it way easier.

Question is: is there a code equivalent of these things (map control to keyboard and get mapped key/button for control)?

Ask a Question / Re: Create Actor On Scene Switch
« on: September 14, 2018, 09:14:39 am »
I forgot to mention this in my previous comment: in a horizontal transfer, the "next scene coordinates" is the position on the ground for your actor on the next scene, or the lowest most position for the bottom of your actor. In a vertical transfer, "next scene coordinates" is the leftmost position for your actor on the new scene.

Ask a Question / Re: Create Actor On Scene Switch
« on: September 13, 2018, 06:24:15 pm »
Attached is part of my Change Scene behavior for a side-scroller platformer. Look at that "Create Actor at Next Scene" if statement.
The "get item 0 from split Next Scene Coordinates with ," is how I store the coordinates to the next scene in one attribute. 0 gets the X position, 1 gets the Y position. It's a text attribute, and its format is X,Y, for example 10,15.
-If the height of the region is bigger than its width, it is a horizontal transfer (left to right). It will create the actor with its center at the X position in the next scene, and its Y position proportional to the distance between the bottom of the actor and the bottom of the region.
-If the width of the reion is bigger than its height, it is a vertical transfer (top to bottom). It will create the actor with its bottom at the Y position in the next scene, and its X position proportional to the distance of the left side of the actor and the left side of the region.

If I understood your issue correctly, this should solve it. You can recreate the image attached in Sencyl (ignoring the parts that are irrelevant to your game, such as the game attribute) if my explanation didn't make sense. Or I can draw an explanation if that is confusing, if you need it.

Ask a Question / Re: Weird pause on key input
« on: September 11, 2018, 12:00:15 pm »
Is this a bug?

For the event you were originally using, if you can reproduce your issue in a sample game, it might me worth posting on the issue tracker.

Ask a Question / Re: Weird pause on key input
« on: September 11, 2018, 01:52:44 am »
Have you tried the same code but in other key input event? Try the Input>Keyboard event, or in the When Updating event, to see if the issue is with the code or a bug in that particular event you are using.

Ask a Question / Re: Massive blank space in scene
« on: August 30, 2018, 07:25:34 pm »
I think your screen dimensions are bigger than your scene dimensions. Go to Settings > Settings > Display and configure the width and height of the game window appropriately

Why not add your boolean to another list whenever you add the image instance to your first list? That way the index of both would refer to the same instance, and you could go from there.

Ask a Question / Re: how do i import a game file into stencyl
« on: August 21, 2018, 09:41:05 am »
Open Stencyl, and in the top bar go to Tools > Workspace > View Workspace Folder. Then go to the "games" folder, and drop you game's folder in there.

It can disable actor events as well.

Pages: 1 2 3 ... 72