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
→
Scenes Resetting
Pages:
1
Scenes Resetting
SkyPilot
Posts: 34
April 27, 2020, 03:34:31 am
Hi,
My player can walk around a scene and when he collides with an enemy, they switch to a Battle Scene (think pokemon). When the battle finishes, we return to the walk around scene, but the enemy we just killed is there again and my player is at the starting point, not where he engaged in battle. How do I change this?
Luyren
Posts: 2810
April 27, 2020, 04:58:57 am
Store the player's coordinates in a game attribute, and set its position to those coordinates when you return from the battle scene.
My Stencyl resources are available here:
https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
NerdinaNutshell
Posts: 251
April 27, 2020, 08:48:20 am
Be sure to use a game attribute, not a scene or an actor one.
*Puff*
SkyPilot
Posts: 34
April 28, 2020, 09:42:39 am
Thanks so much for this, after many failed attempts, it works!
One more question though: For my enemy to be killed when I'm back at the scene, I created a game attribute. Simple enough.
My question is, will I have to create a game attribute for every single enemy in the game for them to die? Is there a way to use behaviours for this?
Thanks
Luyren
Posts: 2810
April 28, 2020, 10:02:32 am
Use one game attribute of type list, and add the actor and the current scene as a single string to that list. Then, on a created event in a behavior you attach to your enemies, check if the list contains that actor and that scene. If it does, kill the actor.
My Stencyl resources are available here:
https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
SkyPilot
Posts: 34
April 29, 2020, 02:10:18 am
Thanks for the suggestion. Could you link me to any tutorials on those? I only know a tiny bit about behaviours and nothing about lists.
Luyren
Posts: 2810
April 29, 2020, 05:03:52 am
Lists:
http://www.stencyl.com/help/view/lists/
And just read the Stencylpedia in general, that has a lot of information.
My Stencyl resources are available here:
https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Pages:
1