playMaker

Author Topic: ArrayList or Database  (Read 3404 times)

vonpopov

  • Junior Playmaker
  • **
  • Posts: 96
    • View Profile
ArrayList or Database
« on: May 24, 2014, 02:32:57 PM »
Hi,

In one scene, i would like to store a list of objects into a list
In second scene, i would like to be able to access this list

it sounds like a database ? but in fact, i have no idea where to start.
I just need some tips about how i could handle this.

regards

« Last Edit: May 28, 2014, 04:30:25 AM by vonpopov »

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: I just don't know where to start this !
« Reply #1 on: May 24, 2014, 03:35:48 PM »
You can do this with ArrayMaker.
https://hutonggames.fogbugz.com/default.asp?W715

vonpopov

  • Junior Playmaker
  • **
  • Posts: 96
    • View Profile
Re: I just don't know where to start this !
« Reply #2 on: May 24, 2014, 04:27:38 PM »
You can do this with ArrayMaker.
https://hutonggames.fogbugz.com/default.asp?W715

Thanks,

I am looking at it , it seems this is exactly what needed :)
Now i have to learn how to use it :D , i am looking at the sample.
:D


jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: I just don't know where to start this ! [SOLVED]
« Reply #3 on: May 24, 2014, 05:13:51 PM »
Good luck!

I'd probably suggest putting the array on a gameobject that you've set to Don't Destroy on Load to it's maintained even after a scene change.

I've used Arraymaker for a couple of things now, and it was easier than I initially thought.

vonpopov

  • Junior Playmaker
  • **
  • Posts: 96
    • View Profile
Re: I just don't know where to start this ! [SOLVED]
« Reply #4 on: May 27, 2014, 02:36:41 AM »
Good luck!

I'd probably suggest putting the array on a gameobject that you've set to Don't Destroy on Load to it's maintained even after a scene change.

I've used Arraymaker for a couple of things now, and it was easier than I initially thought.

i took a look at the exemples, read some stuff about it, and i am not sure if arraylist is enought powerfull or if i need something more like a database

(ex : https://www.assetstore.unity3d.com/en/#!/content/4334 )


My purpose is to create a menu that allow to buy unit (checking value etc). And SAVE them in Decks/Unit list that i could use anytime.

So basically, what i did i a copy array list from another GameObject to Another throught ButtonGui. This is working but because i'll had to handle a lot of units, into a lot of ArrayList ...  (+ I will need to use units filters "like animals, waterlife,..." + I will need to see stats (var) from that units into my menu so ...)

Before going deeper into this, i would like to be sure this is the correct way to handle that. Or if am wrong and i should use Database instead

regards

nb : if database sounds better, is SQLiteKit a good choice ?
nb2 : Found MonoSQlite was discontinued, is it still a good idea to buy it ?
MonoSQlite : https://www.youtube.com/channel/UCG4BgUsbpmfuCrM3uo-p9gA/videos

 


« Last Edit: May 27, 2014, 11:59:01 AM by vonpopov »

vonpopov

  • Junior Playmaker
  • **
  • Posts: 96
    • View Profile
Re: I just don't know where to start this !
« Reply #5 on: May 28, 2014, 04:30:05 AM »
I cannot wait more for answers, so ... today i pick MonoSQlite.
- They are discontinued, but it seems their latest release was stable, great, and well documented.
- On the other part, SQlite Kit seems great ... but i don't feel confortable with the tutorial the author made, external googlesheets to use as database is a good idea but. And it "seems" it lakes important playmaker action in comparaison to MonoSQLite (drop table, create table,etc)


+I am now sure, database is the better choice. Arraylist is great, but not made to handle that much and i will have to handle a lot (with filter etc).

What i learnt from Arraylist is .... : i will redone my Rts Selector a day ! Because, it simplify the state machine a looooot !!!! my technic (trigger based) is working well, but array make it a lot better.

So, stay tunned. I'll give news as soon as i get results ! ;)

Nb : MonoSQlite is not on the asset store, but still available for purchase if you assume you don't get any support from them.
« Last Edit: May 28, 2014, 04:34:16 AM by vonpopov »

IceMaker

  • Playmaker Newbie
  • *
  • Posts: 14
    • View Profile
Re: ArrayList or Database
« Reply #6 on: May 28, 2014, 12:50:37 PM »
Looks like I was too late for a response but if you become disatisfied with the plugins already purchased, I've been using the SimpleSQL, comes with playaker actions, easy to set up, author actively develops it and so on.

As somebody who prefers rpg/strategy/etc the discovery of databases along with playmaker was a great spark to my interests as a Dev.

vonpopov

  • Junior Playmaker
  • **
  • Posts: 96
    • View Profile
Re: ArrayList or Database
« Reply #7 on: May 28, 2014, 02:16:35 PM »
Looks like I was too late for a response but if you become disatisfied with the plugins already purchased, I've been using the SimpleSQL, comes with playaker actions, easy to set up, author actively develops it and so on.

As somebody who prefers rpg/strategy/etc the discovery of databases along with playmaker was a great spark to my interests as a Dev.

I get quickly desatified by MonoSQL besauce the playmaker actions embedded don't allow to handle more than ONE result a time.
 
I am very glad you answered me IceMaker, because i was interested by SimpleSQL. I Emailed this afternoon the support in order to be sure this asset was able to match my purpose.

But maybe you could answer me (the support still havent), and tell me if there are playmaker action embedded that allow to get more than one result a time when reading database.

Basically i mean, if i get multiples rows matching a string in one column, it has to answer me all the matching results. (i assume it has to loop the database again and again)

thanks you for your interest, it helps a lot.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15082
  • Official Playmaker Support
    • View Profile
Re: ArrayList or Database
« Reply #8 on: May 28, 2014, 09:37:07 PM »
Hi,

 Depending on the answer, I think one good way would be to create actions like "getNextResult" and similar loop routines.

there is no looping inside the database query, the query returns a variable that contains all the data organized likely into a specific class allowing to loop yourself trhough the results or get to a particular one.

 Bye,

Jean

IceMaker

  • Playmaker Newbie
  • *
  • Posts: 14
    • View Profile
Re: ArrayList or Database
« Reply #9 on: May 29, 2014, 11:24:37 AM »
The SimpleSQL has a script that copies your database to a game object and stores them.

First action copies then the data can be looped through.
 
Right hand screen is the copied database stored on a game object which can be interacted with using the other commands.


All the _Get Result actions are in reference to the data from _Query Multiple.

Something else you can do too that saves the trouble of having it copied at all...

In SQLite there are "Views" that takes a database and runs a command, then creates a new database with the results.

I wanted to sort based on the enemies "speed" stat to figure out who takes their next turn, so I created a VIEW with the command, "SELECT * FROM ActiveBattle ORDER BY ABS(Speed) DESC"

Now it's already sorted and can be plugged directly into the graphical GUI.
« Last Edit: May 29, 2014, 11:47:43 AM by IceMaker »

vonpopov

  • Junior Playmaker
  • **
  • Posts: 96
    • View Profile
Re: ArrayList or Database
« Reply #10 on: May 30, 2014, 03:54:03 AM »
I am using it (i bought it yesterday), and i already see all the possibilities, this is real great ! :)

But i am still asking to my self how to do something.
I need the multiples results to be put into "button" , which would (when click) use some state machine (that will add the row put into button, into another table).

But i don't see how to set up the button, the same time i create it from reading the database.

i'll have to figure out.
Tips welcome :)


Thanks you again icemaker
+ But i don't get what is your "view" folder, is that a table ? how this is working ?
« Last Edit: May 30, 2014, 03:56:04 AM by vonpopov »

IceMaker

  • Playmaker Newbie
  • *
  • Posts: 14
    • View Profile
Re: ArrayList or Database
« Reply #11 on: May 31, 2014, 08:39:38 PM »
Okay so from the table to the button, then info goes from button to the FSM you want it at?

The SQL_Query_Multiple_Row will copy the information from the database (Either the whole table or just the rows you tell it to.) and stores it to the game object (see on the right hand screen.)

From there you can use the Get_Result commands to call that information to the FSMs