Any way to substitute actor types with something else? [SOLVED]

0paque0ccupant

  • Posts: 34


I'm not even halfway done with the scene. Each spike is a separate actor type and each time the scene loads there's a heavy amount of lag. ._.

I want the level to still look like this, but is there anyway I could fix the lag?

« Last Edit: July 16, 2012, 10:58:11 am by 0paque0ccupant »

rob1221

  • *
  • Posts: 9474
You can make tiles for the spikes and use regions for collision detection.

0paque0ccupant

  • Posts: 34
So I still have this problem after several weeks of trying to work around it.

How could I get the drawn regions to kill the player?

Hectate

  • *
  • Posts: 4645
You have to have a behavior (probably on the player actor) that kills it on contact with a region or collision group. Then you have to customize it to select (in that scene) the region for the spikes - or ensure that spike actors are assigned to the collision group that kills it (if you go with plan B, which I recommend).
:
:
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.

0paque0ccupant

  • Posts: 34
What if there are multiple areas with spikes in a level and I have to use more than one region?

0paque0ccupant

  • Posts: 34
Additionally, I'm fairly inexperienced with manually coding behaviors in Stencyl and I can't find a pre-shipped behavior/a behavior in the Forge to tinker around with.

Xietao

  • Posts: 725
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

0paque0ccupant

  • Posts: 34
Yes. Sorry, I'm a little confused as to how to setting up the behavior  :-\

0paque0ccupant

  • Posts: 34
Bump. Can someone please tell me how to construct the behavior?

Xietao

  • Posts: 725
You can replace the Damage Block to a kill block.
Is attached to the player
Inside the Code Block is:
Code: [Select]
ArrayUtil.empty(_SpikeRegions);

for each(var region:Region in scene.regions)
{
if(region.name.toLowerCase().indexOf(_Tag.toLowerCase()) != -1)
{
_SpikeRegions.push(region);
}
}
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

0paque0ccupant

  • Posts: 34


This is what I have.
How do I create the "set" blocks?

Xietao

  • Posts: 725
Attributes...
Tag = Text
Inside? = Boolean
Blocks at Attributes -> Setters

« Last Edit: July 16, 2012, 10:41:57 am by Xietao »
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

0paque0ccupant

  • Posts: 34
That's what I needed. Behavior works perfectly. Thanks much!