SC2Mapster Forums

Resources > Trigger Libraries & Scripts

Lootify! by BasharTeg6

  • 6 posts
    #1 Oct 26, 2012 at 23:48 UTC - 1 like

    Lootify! v0.01 : BasharTeg

    Description

    Lootify! created by BasharTeg (Miles.152)

    Lootify is an add-on for inventory systems that allows a designer to apply "enchantments" to base items, easily creating an unlimited number of combinations which can be set or randomized, depending on preference. I have purposely made this library flexible so that it can be repurposed for a wide variety of inventory systems and map types. As a result, using this library is a bit more complex than most drop-in libraries so it requires a bit of additional explanation.

    To simplify, this library allows you to create such wonderful items as:

    • Broken Cloth Boots of Mild Interest
    • Reinforced Buckler of the Beast
    • Bloody Hand-Axe of Maiming
    • Spiritual Medallion of Ancient Sages
    • Electrostatic Marine Rifle
    • Ghost Rifle of Perfect Color etc.

    Features

    • Allows designers to generate randomized or set enchantments for items
    • Enchanted items tracked by ID #
    • Enchanted items have saved values
    • Enchanted items have saved rarity ratings
    • Extremely flexible for use with most inventory systems
    • Can be customized in a large variety of ways
    • Usage guide included in the example map

    Installation

    Copy and paste the library from the example map into your own map, then follow the instructions provided (both below and in the library.) Please credit me in your map if you use this.

    Instructions

    This guide assumes you have already created base items to add enchantments to and a dialog inventory system for Lootify to hook into.

    1. Enchantments
    The first step is to define the enchantments you wish to use. These are stored in the ENCHANTMENTS record in the Variables folder. All you have to do is change the names to whatever you wish. Follow the instructions within the record for additional information. The different item types are there if you want to have different classes of items with different sets of enchantments (Armor vs Weapons for example.)

    2. Values
    Next you need to define the values of each item. Lootify uses the Level field for each base item to determine the base value. You can change this by modifying the correct parameters in the Assign Item Enchantment functions (advanced users only!) Once your base values are set, you need to set the values for each enchantment.
    This is done in the Initialize Lootify function. There are detailed instructions within the function to help you along.

    3. Assign Item Enchantment functions
    These two functions (Set and Random) form the backbone of Lootify. Be sure to define each parameter for the proper results. See each function for a list of what each parameter does.

    Lootify does not assign buffs or effects to enchantments. It only stores assigned enchantments to items based on ID. You can use this to give your items the intended effects.

    Planned Features

    • Include an example inventory in the example map
    • Tweak stuff as requested

    Preview

    Last edited Oct 27, 2012 by BasharTeg
    Name Description Size MD5
    Lootify_Example_Map.SC2Map Lootify! Example Map 68.5 KiB 7408973c28c7...

    My Projects:
    Malum Ruina: SC2Mapster
    Eternal Exile: SC2Mapster
    Spine Crawler Madness: SC2Mapster
    Xeno Crisis: SC2Mapster

    #2 Oct 27, 2012 at 04:27 UTC - 0 likes

    Looks good! I thought about making a library like this but never got around to it- I'm glad to see you did :P Looks like a solid library ^.^

    Feel free to Send me a PM if you have any questions/concerns!

    #3 Nov 05, 2012 at 23:19 UTC - 0 likes

    I've found a work-around for my project to show specific affixes within the standard inventory UI of Starcraft 2.

    I've made a small video to share the idea. The idea is about tracking the position of the mouse inside the UI by using transparent dialog items. I detect the "Mouse Enter" event to know where the mouse is located in the UI and calculate the tooltip for the selected item of the selected player. The user cannot show 2 tooltips in the same time, so edit catalog values for a specific player is not a problem.

    Btw this is awesome to see Diablo can be developed in SC2. Seriously :)

    Last edited Nov 05, 2012 by Doubotis

    Visit SC2 Galaxy.net (FR community)

    #4 Nov 07, 2012 at 17:10 UTC - 0 likes
    Quote from Doubotis: Go

    I've found a work-around for my project to show specific affixes within the standard inventory UI of Starcraft 2.

    I've made a small video to share the idea. The idea is about tracking the position of the mouse inside the UI by using transparent dialog items. I detect the "Mouse Enter" event to know where the mouse is located in the UI and calculate the tooltip for the selected item of the selected player. The user cannot show 2 tooltips in the same time, so edit catalog values for a specific player is not a problem.

    Btw this is awesome to see Diablo can be developed in SC2. Seriously :)

    Nice work. If you plan on using this library for your project, you would just need to use the combine strings function to insert the prefix/suffix name from the item's record. It should be a relatively simple ordeal... as long as SC2's catalog system lets you.

    #5 Nov 07, 2012 at 18:09 UTC - 0 likes

    @BasharTeg: Go

    could you explain more in depth of what this actually does?

    Im not that familiar with items.

    1. Do items have an Id? How are you tracking this Id?
    2. How does one implement these effects if it doesn't actually apply the effects to the items?
    3. Does it show the effects in tool tips?

    As far as I can tell you keep some kinda record of the item and then it has prefixes/mods stored somewhere.... how are they being stored?

    about all it does is randomly assign values to some identifier? Sounds like it should cover more bases?

    Last edited Nov 07, 2012 by SouLCarveRR

    Skype
    KageNinpo = SN

    My Libraries
    DialogLeaderboard & TeamSort

    My Projects
    SPACEWAR Tribute
    Infinite TD

    #6 Nov 08, 2012 at 01:42 UTC - 0 likes
    Quote from SouLCarveRR: Go

    @BasharTeg: Go

    could you explain more in depth of what this actually does?

    Im not that familiar with items. Do items have an Id? How are you tracking this Id? How does one implement these effects if it doesn't actually apply the effects to the items? Does it show the effects in tool tips?

    As far as I can tell you keep some kinda record of the item and then it has prefixes/mods stored somewhere.... how are they being stored?

    about all it does is randomly assign values to some identifier? Sounds like it should cover more bases?

    In order for Lootify to work the items must have a unique ID in whatever dialog inventory system is being used. For example, player picks up a sword, that sword gets ID # 001. Player picks up a mace, mace gets ID # 002. Player picks up another sword, ID #003, and so on. It doesn't really make sense to give an item a unique enchantment if the item itself isn't unique, although I suppose you could give the same item different enchantments at different points in time...

    When you use one of the two functions which generate enchantments, you have to include an ID # in the parameter. The records which store the data for each item exist in an array - the ID # represents the array ID number. This lets you place an enchantment on Sword of Awesome (ID #0321) and later check the record for item #0321 to see what the enchantments are.

    The primary function of this library is to generate enchantments and store them in records to be recalled later. It's very open-ended to allow for customization. I may create more of a self-contained system in the future for less advanced designers.

    So you can set whatever enchantment an item gets, then call the values stored in the item's record so apply buffs or reference in tooltips.

    Everything's documented in the example map, so that might give you some more clues as to how this will work.

  • 6 posts

You must login to post a comment. Don't have an account? Register to get one!