Search Unity

Upgrade system

Discussion in 'Scripting' started by MyPix, Nov 26, 2015.

  1. MyPix

    MyPix

    Joined:
    Feb 23, 2014
    Posts:
    44
    Hello,
    I want to make a game where you could upgrade 9 things (8 unit + total profit, like in adcap) but i dont know where to start as i can have base game upgrades (low level) and the end game ones, i can have a hundred of upgrades for each unit !

    The difficult part is that a need to be able to store this data in the game save class
     
  2. MyPix

    MyPix

    Joined:
    Feb 23, 2014
    Posts:
    44
    Hello,i'm on the computer so i can post something more detailed, i'm looking for a system that would support
    -> Many upgrades categories with different values
    -> Being saved to the disk and work after i add some more upgrade when a new update is released
    -> That would display the 5 cheapest upgrades amongst all types when my user clicks on a button
     
  3. image28

    image28

    Joined:
    Jul 17, 2013
    Posts:
    457
    Look into AssetBundles and PlayerPrefs in the unity manual/api reference
     
  4. MyPix

    MyPix

    Joined:
    Feb 23, 2014
    Posts:
    44
    Can you explain a bit more..?
     
  5. tedthebug

    tedthebug

    Joined:
    May 6, 2015
    Posts:
    2,570
  6. MyPix

    MyPix

    Joined:
    Feb 23, 2014
    Posts:
    44
    It's not what i'm looking for...

    But I had an idea
    I can put every upgrade in various xml files, create a object or struct who would hold every attributes, then put that in a giant array, but how do i sort that array ? Plus, every upgrade will need an id to save then, how to save every id (save an array) ?

    But i seems a little complicated for what i'm looking, just a basic upgrade system to add multiplier to some properties of my class...anyone that has made a similar system can help me?
    The game's target is WebGL
     
  7. MyPix

    MyPix

    Joined:
    Feb 23, 2014
    Posts:
    44
    bump
     
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You need to break this down a little. Currently you are asking for a fairly amorphous blob that kind of does everything and nothing. Build some specifications in plain English. The code will flow naturally out of that.