a billion+ questions (and some few copied tips)

anmy

  • Posts: 18
Q=question
T=tips to avoid mistakes i made

maybe i m getting old, or stupid, or both,
but after so long struggling, stencyl is still a mess in my mind,
events, attributes, triggers, scene behaviors, scene behaviors acting on actors, when, always, if and otherwise if, animations,
they r all spinning around my mind, and some few basic steps, are still missing.

Q-how long does it get to learn this stencyl?
i mean, i saw this english_kind_hearted_looking guy in youtube (Lense OnLife),
he created a folder called "extras" at stencyl's game's folder, places some things there, and they went directly in the game!
that was way a backdoor move, and you dont get to learn that just by trying events and behaviors...
this stencyl is way too deep and so full of rules..

sure i managed to create some very simple games in just a few days,
they work all right, but i went through so many wrong paths,
i need to fix them right, make the game as light and without errors as possible,
place all the "correct programming"
and for this i am asking your help.
some examples of the billion mistakes:
-creating so many actors, when all it s needed is to change their animation=appearance
-placing the moon from left to right, out going the screen, trying to make it start as loop again,
never worked, made 3 copies for it, i saw someone more clever than me, just recreating the actor,
solution? "make him ALWAYS active"
T=if actors are going out the screen, decide what to do with those, either kill them on the spot,
or if you will possibly need them again, make sure the y r always active.

sorry for this long intro,
but i really really would like to LEARN properly this stencyl.

now i made a simple grammar first grade game,
due to my mind's blindness,
i created 30 scenes, 60 actors, 30 correctly spelled and 30 wrong,
and all of them placed on the same (left or right) spot, every time the game starts,
terrible-horrible programming and mistakes.

i asked and was answered (thx Luyren) how to randomly place actor "corr1" either left or right,
i ve even managed to change his appearance to "corr2", when clicked.
but no matter what i tried, placing the 2nd actor "wrng1" where needed and change his appearance, does not work...

so what is needed, where and how do i achieve these:
-if actor corr1 is at x1 create, wrng at x2 otherwise if corr1 is at x2, create wrng1 at x1
-if actor corr1 is clicked, reposition randomly both actors, at those 2 spots,
and switch both actors to their next frame of their sprite.

thank you all in advance.





corbanwolf

  • Posts: 223
Attributes are simply variables, they can be different types. Creating a game is like writing code in any programming language. Most things are the same, just different names. Game attributes are global variables. Finish crash course and read all this http://www.stencyl.com/blocks/ and maybe it will help. Programming is not for everyone.
♪♪♪♪♪♪

anmy

  • Posts: 18
corbanwolf, thx for the info.
due to my line of work, i ve learned photoshop, after effects, premiere, 3ds max and c4d,
though some have some scripts, i never dived in to them,
never used before a "create code/game app",
but i am stubborn and patient, so i think (with some help), i will get to ...get it in the end.

corbanwolf

  • Posts: 223
It's good to start from really basics. Learn a bit of C++, just learn till basic functions, and that will be enough. All code whether it's C++ or the blocks like in Stencyl, they all base about true, false, 0, 1, if, etc. Just learn basic statements and you will be just fine dude :)
♪♪♪♪♪♪

SadiQ

  • Posts: 1795
Q-how long does it get to learn this stencyl?

Whenever they add a new thing in stencyl you have to learn about it, so you'll always be learning new things. Happens with every other program out there (photoshop, blender, etc). :)

sure i managed to create some very simple games in just a few days,
they work all right, but i went through so many wrong paths,

That's the way everyone does it. You first try a really hard problem, make a ton of mistakes, then you try again, and again, and then you try some more, and then one day, without any reason, it finally works. And, after all of that, you'll get to find out it was extremely simple to do it "the proper way".  :o

That's how you actually learn, and that's how you end up with the next really hard problem that you must make a ton of errors to get it working.
But the feeling you get when you solve that problem cannot be expressed by words.  :)

 Learn to break your problem into smaller problems and start fixing those small problems until the big problem is solved.

P.S. Don't be too stubborn. Learn from that crash course as it will help you a lot. I've spent almost 3 weeks trying a million different things just to get an actor to move on a grid in 3 random directions   :'(
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

anmy

  • Posts: 18
that was encouraging,
thank you SadiQ,
and very true to your observations.



« Last Edit: May 13, 2020, 10:56:38 am by anmy »

anmy

  • Posts: 18
so this works for 1st step, placing 2 actors randomly at 2 positions
and to their 1st frame animation
pos" border="0

but WHERE do i set this,
to randomly reposition their position
since this below is not working?
Screenshot-2020-05-14-at-15-53-45" border="0

SadiQ

  • Posts: 1795
I think you're trying to position your 2 actors if you press on the [correct] actor, but I don't see where you set the value for that [correct] attribute in your code. Without storing something in your attribute, Stencyl will have no idea on what actor you want to use that mouse press event, and it will simply ignore your code.
 After you create your Correct_Actor you can put a Set [correct] to [last created Actor] block. That way Stencyl will know what you stored in that 'correct' attribute, and it will know which actor needs to respond to a mouse press.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

anmy

  • Posts: 18
I think you're trying to position your 2 actors if you press on the [correct] actor, but I don't see where you set the value for that [correct] attribute in your code.

exactly that, and had thought of that,
that is why i had made 2 attributes to set the 2 actors names,
Actor-Events-0" border="0

and if i set to "last created actor", "correct" is not the last one..

SadiQ

  • Posts: 1795
It also depends where you put your code. It looks like you placed the code inside an actor behavior or an actor event, and that's not going to work.
The way I would do it is as follows:
I would use a Scene behavior or a scene event, and I would create my 2 actors from there. (the first image you posted in your previous message has the code).
 It's in that created event that you must place the block that I mentioned in my reply.
 In the same behavior I would check if I pressed on the 'correct' actor and randomly swap their position (the second image you posted) .
So basically the entire code you posted in the 2 images above would need to go inside a scene behavior, and you would only need to add that Set [correct] to [Last created actor] block in there.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

anmy

  • Posts: 18
i m very grateful for your guidance SadiQ
what you described, was exactly my very first approach,
but..

at logic/scene behaviors is where my 2 actors are getting created-
at first i thought, since i m telling the app to create named actor,
it should know who is who, but even if not, i would/did create the corresponding attributes,
but when i went to attach the scene behavior to the scene,
it asked me which of the placed actors was who and who,
..when no actual players are even at the scene,
..since i m asking the app to create them
and i started every possibly wrong road to bypass it...

so where is my mistake in this attached below?



Q: when placing font and creating text, that text can be used as actor ?
if so, next step for me would be to replace the 2 actors, with text
and learn about bitmap fonts

Q: when deleting a set background, or some times even by changing the appearance,
things go weird and actors are no longer placed properly, is it a bug?

SadiQ

  • Posts: 1795
at logic/scene behaviors is where my 2 actors are getting created-
at first i thought, since i m telling the app to create named actor,
it should know who is who,

The app will create the actors, but it's your job to keep track of them. You can set attributes for them, kill them, hide them...it's all on you. The app's job is to do what you tell it to, and nothing more (unless there's a bug :) ).


but when i went to attach the scene behavior to the scene,
it asked me which of the placed actors was who and who,
..when no actual players are even at the scene,
You can add actors in a scene with code or directly in the scene editor, and that's why it's asking you which actor is who and who. There's also the option to use an actor attribute for actors that you create with code (as you have)

so where is my mistake in this attached below?

I remember when I first made that mistake :)
The created event that you have there will only run once when the scene or actor get created and that takes less than a frame. So all your code starts and finishes in less than a frame. You create your actors and then you check if the mouse is pressed on your correct actor. Now what are the chances that you press the mouse exactly in the frame that the scene gets created?
 Remember that the code in your Created event runs only once then it stops, so if you want to always check if you pressed the mouse on your actor you can use the Always event or you can use the When the mouse is pressed event listener (there are multiple ways of achieving the same result)

Q: when placing font and creating text, that text can be used as actor ?
I don't think so, but don't quote me on that.

Q: when deleting a set background, or some times even by changing the appearance,
things go weird and actors are no longer placed properly, is it a bug?

I don't remember ever deleting a background, so I can't tell. Since there are multiple ways of achieving the same result, you'll eventually find a different way :)
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.