Is it possible to create an actor off screen?

lazyboygames

  • Posts: 485
same as the title. I just don't want people to see the actor being created.

Xietao

  • Posts: 725
I don't know, do you tried?
test all of this:
create code....
make always active
print <Actor is on Screen>
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

Hectate

  • *
  • Posts: 4643
This is very common. Anytime a game has things come in from offscreen - shmups, bejewelled-clones, top-view racing games, etc - they have to be created first offscreen.

You just give coordinates that are offscreen for the creation of the actor. Done. Be sure to keep it always simulating or else it won't do anything unless the camera moves so it's onscreen.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

lazyboygames

  • Posts: 485
Alright, so would I need to create a larger scene or would I be fine to just give x, and y coordinates larger then what the scene is?

balore

  • Posts: 11
I tend to use the Adjust offscreen bounds then create the actors inside of that zone, its a tricky block to get a hang of as the values are how much extra space you want for each side. (Increase top boundary by X, Increase Left boundary by Z...)

Seems to work for me when creating things off screen to move onto the screen.
Games Designer / 3D Modeler - Visit my Blog/Portfolio: www.badennett.co.uk

jffilion83

  • Posts: 131
You can create actors out of the screen using "creating an actor block" at an X or Y position being negative to the screen height or width or exceeding it.

But if you have a screen recycler behavior you will need to adjust it consequently so it is not removing actor in a "margin" around the scene. Otherwise you can use a timed despawn to save on logic.

Also watch out for actor that would eat ressources but not being shown but still being active in the unseen space.

lazyboygames

  • Posts: 485
Alright so I tried to create an actor off screen, and got a bunch of errors. Here is the code:

coleislazy

  • *
  • Posts: 2607
You have two problems that I see immediately: you're using the "create actor in next scene" block, but trying to set properties of it immediately. This doesn't work since the actor isn't created until the scene changes. But the worst problem is that you placed a "do every" block under "always". You're going to be getting hundreds of actors in a few seconds this way.

lazyboygames

  • Posts: 485
Oh jeez...I guess I should put it in when created then.

FuriousRage

  • Posts: 57
It works very well to create an off screen actor.
I do it alot in my tests.

In the actor i attach the "Always simulate" behaviour and then just create the actor of screen,
then either set it to move in screen, or the screen scrolls towards there and its alive and all.