Noob question about attributes and scenes (persistence problem)

Usernoob

  • Posts: 27
Hi, im a noob programer  testing Stencyl.

Im making  a RPG game whit a "Stats" each stat is a game attribute and you can invert points to up the stats.

The problem is when the scene switch the stats will reset. And i need conserv the value of the atributes from one scene to other scene.

┬┐Stencyl have a option to make an actor or scene "persistent"  like the game maker option?

Sorry for the inconvenience.

squeeb

  • Posts: 1554
Use the purple attributes.  They can be saved and loaded.  Then when the next scene is created you can set the purple attribute to the attribute getter.. if that makes sense

LIBERADO

  • *
  • Posts: 2660
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Usernoob

  • Posts: 27
Thanx fot the quick answers.

I'm making some wrong, because save or load dont works...

A actor have a way to survive from one scene to other scene? Or you only can create another actor of the same type and load his stats (atributes)?

YobApp

  • Posts: 57
You can save the position of the actor in a game attribute ( purple ) . and recreate it in the next scene At the saved value .  ( X and Y)
and if you want it to appear in another position you only have to say the position you want it to appear in it

LIBERADO

  • *
  • Posts: 2660
Also, you can use this block:

Found under: Scenes > Game Flow > Post-Transition
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

squeeb

  • Posts: 1554
Also, you can use this block:

Found under: Scenes > Game Flow > Post-Transition
What's the difference in using this block and just creating it in the next scene when created?

Justin

  • *
  • Posts: 4347
You don't need to save state between scenes if you use that block. It has pretty limited applicability though.

For Live Support: Join our discord server and ping me @justin.
I'm most often available between 8am and midnight Japan time. (GMT+9)

squeeb

  • Posts: 1554
Ahh .. good to know.  Thank you!  I'll keep it the way I have and save between scenes though

Usernoob

  • Posts: 27
Thanks to everyone, I finally got the attributes from one scene to another.

The only problem now is, if I have 6 fighters for example (and each with their stats? Do I have to create game atributes for each one separately so they can keep them from one scene to another?
What if the game allows endless fighters on your team?

Like a RTS strategy game.