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

Pages: 1
1
YEAH!!!

You are right, just by adding a do after .5 sec "unpause game" after the "fade out and reload" command, I am now able to get them respawning again and again every time the scene reloads. I did this on the already present Updated event directly on the scene (Screenshot 1)
I know that I could probably do it in a better way, but as you diagnosed the main problem seems to be exactly the Pause and this fix made it work. I would love to learn how to avoid the use of Updated as the much as I can!

I learned a lot with this and gained a bit of extra confidence in using Stencyl.
THANK YOU!

I am about to check your Custom Event video..starving to know more about optimizing my workflow, organizing my logic better and being able to increase the level of complexity of my sketches.

Last question I have about this is:
Why the score behavior (Screenshot 2) doesn't work when applied to a Scene Behavior, and works only when applied directly on the Scene Event page?
Is there a hierarchy that establish when it's better to write code on Scene/Actor behaviors (to attach) vs on Scene/Actor event page directly?

2
Thank you!
I just sent you a message with the link to the file

3
Yes, I watched several and then followed this in detail (twice) and for some reasons I can't find a way out.

http://blog.stencyl.com/?p=1367

In my case I end up with things working good, but only the first time the scene is loaded.
I don't want to waste your time, and before to ask for help on this forum I spent a lot of time trying and retrying…without luck

4
Ahahahah, you are completely right.

The reason why I'm programming this is pure practice.
I just want to learn and I felt that this was a type of game relatively simple to design.

Any idea on how to fix this? Things I could try?
Have you ever experienced something similar?
It seems that no matter what I do, reloading the scene I'm never able to respawn.
I start to feel that there is something wrong with my version of Stencyl? Using 3.1
Feeling frustrated right now

5
Hello Sdieters and thanks for the tip.
I watched your video and I'm fascinated by your system, makes everything way more clear and organized and I applied the advanced Spawning to another game I'm working on too. Love your channel!

About this specific issue though, I was able to setup everything correctly, attributes etc: it works the first time the scene is played and after the reload NO object shows up.

I'm wondering if this has something to do with the fact that at the launch the scene isn't able to reset the actorCount1 to 0.

To fix this I've tried to add a "set actorCount1 to 0" in When Created but nothing changes.
I've tried to switch to When Updated but there was no difference, the second time the scene is loaded no spawning happens for the selected toBeCreatedActor.

To reduce the margin of error I'm focusing on one actor at the time and trying to make it work.

I don't want to give up and feel like if I fix this I'll be the happiest person ever :)))
Attached some Screenshots.
A

6
I've tried for a couple of hours to put together that but..No luck. I've tried what you were suggesting, hoping I got it right: should it look like this?

Code: [Select]
{
    public var _Actorcount:Float;
    public function new(dummy:Int, engine:Engine)
    {
        super(engine);
        nameMap.set("Actorcount", "_Actorcount");
        _Actorcount = 0.0;
    }
    override public function init()
    {
        /* ======================== When Creating ========================= */
        _Actorcount = asNumber(0);
        propertyChanged("_Actorcount", _Actorcount);
        createRecycledActor(getActorType(13), 543, 0, Script.MIDDLE);
        createRecycledActor(getActorType(7), 543, 0, Script.MIDDLE);
        /* ======================== When Updating ========================= */
        addWhenUpdatedListener(null, function(elapsedTime:Float, list:Array<Dynamic>):Void
        {

            if (wrapper.enabled)
            {
                _Actorcount = asNumber(0);
                propertyChanged("_Actorcount", _Actorcount);

                for (actorOfType in getActorsOfType(getActorType(13)))
                {
                    if (actorOfType != null && !actorOfType.dead && !actorOfType.recycled)
                    {
                        _Actorcount += 1;
                        propertyChanged("_Actorcount", _Actorcount);
                    }
                }

                while ((_Actorcount < 2))
                {
                    runPeriodically(1000 * 3, function(timeTask:TimedTask):Void
                    {
                        createRecycledActor(getActorType(13), 543, 0, Script.MIDDLE);
                    }, null);
                }
            }
        });
    }
    override public function forwardMessage(msg:String)
{}}

This one doesn't work. it creates a black screen, never loads the game and have to force quit Flash Builder.
What am I doing wrong?
Could you show me how it should look like in blocks terms?

Also after reloading the scene, the music produces click and pops, almost looks like the buffer size  is going low..and something is slowing  down the sound. Sometimes, when the level reload, I hear the sound for a fragment of a second and then it mutes abruptly.

I want to learn so bad and avoid mistakes but I guess it will take a bit of time

7
Thx for your reply.
This behavior I was discussing it's attached to the scene.
I've tried the When Always instead and it creates a sort of visual feedback that spawns out continuously new actors and slows down dramatically the CPU and freezes the game. (Also this works on the first time I play the level, and when it reloads it stops to work.

The crazy thing about the code I attached is that the first actor after when created spawn correctly but it seems to ignore the "Do Every 3 sec" function.

8
Hello, I'm a new Stencyl users and so far I'm loving the platform.
I feel that Stencyl allows me to create things I've dreamt of for my whole life (grew up in the 80's and love 2D games).

I was working on a couple of game prototypes and I'm often encountering the same problem, related to actors and sounds.
Some of them don't reload after reloading scene, or switching to the same scene.
ie: Main Scene, after death, reloads and doesn't spawn a certain enemy actor which should appear every 3 sec (when created).

Here how the behavior looks like.

Code: [Select]
    /* ======================== When Creating ========================= */
        createRecycledActor(getActorType(13), 543, 0, Script.MIDDLE);
        createRecycledActor(getActorType(7), 543, 0, Script.MIDDLE);
        runPeriodically(1000 * 3, function(timeTask:TimedTask):Void
        {
            createRecycledActor(getActorType(13), 543, 0, Script.MIDDLE);
            createRecycledActor(getActorType(7), 543, 0, Script.MIDDLE);
        }, null);
    }

I don't know what I'm doing wrong, but this is becoming frustrating and I don't want to give up.

Any help?
I'd love to be able to chat with someone and if possible schedule a one on one lesson. Anyone in the NYC area?
I'd love to learn more.

Thanks.
A

Pages: 1