Search Unity

Scripting Item System where its stats are linked to its name?

Discussion in 'Scripting' started by Deadlyapples, Apr 7, 2018.

  1. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    Just wondering if this makes sense to use or whether it would just be for flavor having the names represented like this.

    So imagine all items names directly relate to the stats the weapon has :

    Flaming Short Sword. It is a short sword and deals basic fire damage.
    Epic Flaming Short Sword. it is a short sword that deals high fire damage.

    But have the system where by the stats of an item are worked out based on its name.

    So instead of having an item class that has its name, weapon type, bonus damage, elemental damage type, weight, base damage, slot type, all the information the game needs is in its name like using a prefix and suffix system.

    So I craft a halberd with ice and I get Icy Halberd of Deadlyapples.

    It is a Halberd that deals basic ice damage and was crafted by Deadlyapples.
    So from the name alone the game knows to draw a Halberd with an icy particle effect and its stats are all derived from what the game understands.

    Its stats and variables are derived from its name instead of its name being generated from its stats / variables.


    Not sure why you would do this but I just wanted peoples thoughts on it. :/





    My thoughts are that this would make populating a database of items easier because instead of writing a huge list of items and all their various variables and stats and details you would instead be writing a simple list of the weapons type as its name along with prefix and suffix that related to the attributes you want the base weapon to have.

    Eg

    Lighting Dagger
    Icy Dagger
    Fiery Halberd
    Poisoned Short-sword
    War-hammer
    Bleeding War-hammer


    These items stats would be auto populated based on their names which could be set based in Scriptable Objects. So Scriptable object for lightening damage stats, scriptable object for daggers. The above items would, based on their names, get their stats from the scriptable objects.


    Scriptable Object Dagger:

    Name : Dagger
    Damage : 20
    Asset : Dagger_01
    Stamina Cost : 10
    Base Value : 115G

    Scriptable Object Poison:

    Name : Poison
    Damage : 5
    Particle : Poison


    I am thinking of this more from the perspective of populating an item database more easily by laying a foundation of scriptable objects with stats and then when creating new items you just write the items descriptive name.
     
    Last edited: Apr 7, 2018