Luyren's Quick Tips

Luyren

  • *
  • Posts: 2802
I've started making some quick Stencyl tips videos, covering some recurrent questions I've seen here on the forums and on the discord server. Whether you've been using Stencyl for a while or just started, these might be useful! And hopefully I'll keep them all under 10 minutes, so it's a pretty short watch.

Watch the first tip here: Why you should use behaviors.

I've seen a lot of people using exclusively actor and scene events, when a lot of features they are making would be better suited as behaviors. This video will hopefully show you that creating behaviors instead are a better option in most cases, with more options and versatility.

« Last Edit: April 29, 2020, 03:12:37 pm by Luyren »
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

SkyPilot

  • Posts: 34
Thanks for this! I hope this series will help a beginner like me :P

Luyren

  • *
  • Posts: 2802
Thanks for this! I hope this series will help a beginner like me :P
Glad I can help!

Second tip is up: Know the basic events.
This will explain how to use the create, drawing and update event, and how to avoid common mistakes. If you're having troubles with the "do after," "do every" or the "while" blocks, this is for you.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
Third tip: learn to use custom events.

They are super useful, make your code more organized and are the basis for AI behaviors. Even if you've been using Stencyl for a while, you might be neglecting this useful feature, so give it a watch.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
Fourth Tip: Get and Set Attributes.
This will help you share values between behaviors. Since I've been going on and on about making behaviors, this will hel you to break down your code into different behaviors, attaching only the relevant ones to what your actors need. I also briefly explain the difference between actor values and attributes.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
Fifth Tip: Beware of Friction.
Here I explain what friction is, how it affects your games, and how to avoid problems with it. If your actors are getting stuck on tiles when you move towards them, this should help.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
Sixth Stencyl tip: Know your Collisions!
I explain here the basics of collision, how to set them up, and a few tricks when working with multiple animations and setting their collision bounds. If you're having troubles with your actors moving weirdly when switching animations, this is the tip for you.

« Last Edit: July 01, 2020, 06:45:39 am by Luyren »
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
Seventh Tip: Check for non-Collisions
This will show you how to check when actors are not colliding with something. Pretty straight to the point.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
New Tip: How to use manual timers
This will give you full control over timed actions in your games. No longer will the limitations of the do after and do every blocks hinder you!
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
New Tip: Know the attribute types
Back working on these, after some road blocks. This video is a bit on the long side, but it covers all the attribute types, game attributes and dynamic values, how to use them and some tricks. Images and Lists/Maps will have their own videos later on.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

joe1234

  • Posts: 14
I've seen a lot of people using exclusively actor and scene events, when a lot of features they are making would be better suited as behaviors. This video will hopefully show you that creating behaviors instead are a better option in most cases, with more options and versatility.
First post. Stencyl is great. I watched your behaviors tip. Very good, very clear, thank you.

I did the opposite. I have a completed game, which I am now going to go back to. Assuming yours is the correct approach it might need more emphasis within Stencyl, with some examples of the workflow of converting events based code to behaviors.

If you are from a non-programming background like me, the actors/events approach looks correct but you end up with a different approach to attributes.
If I have a spaceship and want to move it, I create an input event then set the direction and force. It works. I do not set an attribute for the speed because that seems both redundant and over complicated.

Even if you have the idea of exporting your code to a behavior for reuse or best practice (I am sure I did at one stage), I could not see the way to do it from my existing events code or within an actor's tab. It looks like something you are not meant to do - probably for some good reason. Or I could have missed it.

The GUI for behaviors with the options boxes is excellent which also makes it look like something preconfigured. I did not know I could do that myself.  I did not understand how hidden attributes worked.

So, today, I went to the main dashboard and added a new one line centre-camera-on-self behaviour with a Y offset option. I did not see a way of saving this as a stand alone behavior, I had to attach it to an existing actor in my existing game. That again is a barrier. If the behaviors approach is correct, and we are all doing the opposite, it needs to be emphasized.

(Possibly) separate subject. Is the forum much reduced as a knowledgebase thanks to Discord?

Luyren

  • *
  • Posts: 2802
I wouldn't say there is a "correct" approach. That was my recommendation based on my experience. The crash course does mention behaviors right in the beginning, and the Stencylpedia has the articles on behaviors right after the introduction, so there is that bit of guidance in that direction.

If you just create a new behavior following the steps shown in the video, it's already there, no extra steps needed. You don't have to attach it to "save it", as soon as it is created, or whenever you save the project, your behavior is saved. You can see them under Resources > Behaviors in the dashboard. So in your example, if you created your behavior with that code, it's already there. You need to attach it to an actor to make use of it, but that's about it.

The problem with discord is that, as ongoing conversations pile up, you can't reliably search for stuff in there, but it is easier to ask questions and get answers (and most of the time faster). The forums and the Stencylpedia are better if you need, as you said, a knowledge base, since you can just look for stuff in them. I have links to my resources in the Shared Resources section (this one) of the forums, and there are others who post game journals or even their own resources to the community as well. All that to say both have their uses.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

joe1234

  • Posts: 14
Okay. Thanks very much for your quick reply.

Luyren

  • *
  • Posts: 2802
New Tip: A guide on the drawing blocks

This should cover everything you need to know about them, as well as some use cases and tricks for displaying values. I'm already working on a video about the Image API, and will try to have that ready for next week.

Attached is the sample game used for this video, you'll need to be logged in into the forums to see and download the attachment.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.

Luyren

  • *
  • Posts: 2802
New Tip: Directions and Angles

This video covers the basics of directions, angles and origin points, then teaches more advanced topics such as movement towards the mouse, towards other actors and radial position for rotating actors.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.