TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Prevent actors from entering regions
Pages:
1
Prevent actors from entering regions
Derek
Posts: 163
March 25, 2015, 01:00:26 pm
I was wondering if there was a way of preventing actors from entering regions. I've tried setting things up with tile collisions, and made sure that the test sprite for my project was set to collide with them, but said sprite just walked through them.
Don't be a critic on the internet while eating and drinking at your computer.
UnrealCanine
Posts: 244
March 25, 2015, 01:21:13 pm
have you tried setting that if character in inside a region to increase/decrease their _y value until they're out?
Derek
Posts: 163
March 25, 2015, 03:00:53 pm
I tried that, but the behavior I attempted to do that with prevented the game from running.
Don't be a critic on the internet while eating and drinking at your computer.
Natrium
Posts: 111
March 25, 2015, 03:47:10 pm
Couldn't you use terrain instead? (I don't know, it's not the right solution if other actors have to go inside the areas you don't want this specific actor to enter.)
Derek
Posts: 163
March 26, 2015, 11:26:15 am
The thing is, in this little test scene, the actor isn't supposed to enter the black(ish) part of the scene. Also, I tried finding behavior blocks for terrain, but couldn't find any that could help me replicate the behavior I tried in the first place.
Sidenote: Still can't believe that tile collisions don't work properly in top-down/isometric games.
Don't be a critic on the internet while eating and drinking at your computer.
Natrium
Posts: 111
March 26, 2015, 11:53:05 am
Terrain is considered as tiles. You don't need a behavior. The actor will collide with it as if it was some tiles.
As I said, the only problem is if some other actors have to be able to enter it, then it would be more complicated.
t4u
Posts: 418
March 26, 2015, 11:59:09 am
I would describe the "sandy" isometric tiles by 4 lines.
x,y -where I will be in next frame based on my speed x,y speed (custom attribute, not stencyl block)
If (x,y inside the sandy region):
move actor to x,y
else:
do nothing/stop
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.
Tutorials + downloads:
http://t4upl.blogspot.com/
spoogob
Posts: 1106
March 26, 2015, 12:06:34 pm
Can't you use terrain (as mentioned) and then assign groups to your terrain to determine which actors (players/etc) collide or don't collide with the terrain?
yoplalala
Posts: 1632
March 26, 2015, 12:27:22 pm
use something like T4u method If you use collision, this means the character head, for example, won't be able to touch the sky.
Hectate
Posts: 4643
March 26, 2015, 02:09:11 pm
I would recommend against having concave terrain shapes, btw. Might be true for regions also.
:
:
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.
Derek
Posts: 163
March 26, 2015, 06:01:05 pm
@t4u: Thanks for the help. BTW, is that a scene behavior or an actor behavior?
Don't be a critic on the internet while eating and drinking at your computer.
t4u
Posts: 418
March 26, 2015, 07:19:19 pm
Actor behavior
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.
Tutorials + downloads:
http://t4upl.blogspot.com/
Derek
Posts: 163
April 06, 2015, 06:15:33 pm
Just started to establish the base of that behavior t4u suggested. What's really killing me is finding blocks for things like the following:
for the moving half:
if <x_position+vx, y_position+vy inside the sand square>
x_positon+=vx
y_position+=vy
for the region creating half:
pretty much the whole apex thing, since there doesn't seem to be a block that covers that sort of thing. And the Stencylpedia, from what I've checked, doesn't have any info on it either.
Don't be a critic on the internet while eating and drinking at your computer.
Pages:
1