playMaker

Author Topic: Get/Set Property in Array of a Custom Class [SOLVED]  (Read 1600 times)

rondmc

  • Playmaker Newbie
  • *
  • Posts: 24
Get/Set Property in Array of a Custom Class [SOLVED]
« on: October 05, 2017, 08:11:32 PM »
Hi all, I'll try and explain my problem as best I can.

I have a Game Manager script that keeps track of my persistence data. Inside that script, I created a custom class to keep track of my variables for the game's challenges. Things like, name, best time, bronze/silver/gold awards, completed and unlocked. Right now, I figured the best way to keep those challenges organized would be to store them in an array and change those variables when needed. Then when I implement my save/load data, I can just save and load the array of variables inside one script.

Hope I'm making sense so far.

In Playmaker, I don't see how I can get/set those custom class variables while they're inside an array. Get/Set works when the custom class is outside the array, so I guess my alternative is creating an instance for each challenge and going one by one creating them in script, but I'm not sure if that's practical. Some insight or direction would be appreciated (again I hope I'm using the right terminology and I'm making sense).

Thanks!
« Last Edit: October 07, 2017, 06:20:26 AM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Get/Set Property in Array of a Custom Class
« Reply #1 on: October 05, 2017, 10:48:10 PM »
Hi,
Maybe instead of using Get/Set Actions you coud edit your script to update the variables directly from the script.

here is a link to the playmaker API and look to FsmVariables

rondmc

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Get/Set Property in Array of a Custom Class
« Reply #2 on: October 06, 2017, 05:01:55 PM »
I went with not putting them in an array since them being in an array doesn't seem at all needed but that's a good idea. I'll have to remember that, thanks!