1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Fill your cup and take your pick among the maps best suited for this year's Hive Cup. The 6th Melee Mapping Contest Poll is up!
    Dismiss Notice
  3. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  4. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Item Data Extractor 1.0

Submitted by Wietlol
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.
Requirements:
- JNGP
- Object Data Extractor

Script:
Code (vJASS):
   
//! novjass
    function GetItemTypeAbilities               takes integer itemTypeId returns string
    function GetItemTypeButtonPositionX         takes integer itemTypeId returns integer
    function GetItemTypeButtonPositionY         takes integer itemTypeId returns integer
    function GetItemTypeIcon                    takes integer itemTypeId returns string
    function GetItemTypeModel                   takes integer itemTypeId returns string
    function GetItemTypeScale                   takes integer itemTypeId returns real
    function GetItemTypeSelectionSize           takes integer itemTypeId returns real
    function GetItemTypeColorRed                takes integer itemTypeId returns integer
    function GetItemTypeColorGreen              takes integer itemTypeId returns integer
    function GetItemTypeColorBlue               takes integer itemTypeId returns integer
    function GetItemTypeArmorType               takes integer itemTypeId returns string
    function GetItemTypeIsUsable                takes integer itemTypeId returns boolean
    function GetItemTypeDroppable               takes integer itemTypeId returns boolean
    function GetItemTypeIsSellable              takes integer itemTypeId returns boolean
    function GetItemTypeIsPawnable              takes integer itemTypeId returns boolean
    function GetItemTypeClass                   takes integer itemTypeId returns string
    function GetItemTypeCooldownGroup           takes integer itemTypeId returns string
    function GetItemTypeDropsOnDeath            takes integer itemTypeId returns boolean
    function GetItemTypeGoldCost                takes integer itemTypeId returns integer
    function GetItemTypeHealth                  takes integer itemTypeId returns integer
    function GetItemTypeIgnoreCooldown          takes integer itemTypeId returns boolean
    function GetItemTypeIsRandomChoice          takes integer itemTypeId returns boolean
    function GetItemTypeUnclassifiedLevel       takes integer itemTypeId returns integer
    function GetItemTypeLevel                   takes integer itemTypeId returns integer
    function GetItemTypeLumberCost              takes integer itemTypeId returns integer
    function GetItemTypeUses                    takes integer itemTypeId returns integer
    function GetItemTypeIsPerishable            takes integer itemTypeId returns boolean
    function GetItemTypePriority                takes integer itemTypeId returns integer
    function GetItemTypeMaximumStock            takes integer itemTypeId returns integer
    function GetItemTypeStockReplenishInterval  takes integer itemTypeId returns integer
    function GetItemTypeStartingStock           takes integer itemTypeId returns integer
    function GetItemTypeIsPowerup               takes integer itemTypeId returns boolean
    function GetItemTypeIsTransformable         takes integer itemTypeId returns boolean
    function GetItemTypeRequirements            takes integer itemTypeId returns string
    function GetItemTypeRequiredLevels          takes integer itemTypeId returns string
    //function GetItemTypeDescription             takes integer itemTypeId returns string
    function GetItemTypeHotkey                  takes integer itemTypeId returns string
    function GetItemTypeName                    takes integer itemTypeId returns string
    function GetItemTypeTooltip                 takes integer itemTypeId returns string
    //function GetItemTypeUbertip                 takes integer itemTypeId returns string
//! endnovjass
//! LoadItemData fields=iabi,iarm,iico,ubpx,ubpy,icla,iclb,iclg,iclr,icid,idrp,idro,ifil,igol,uhot,ihtp,iicd,ilev,ilum,imor,unam,ilvo,ipaw,iper,iprn,ipow,ipri,ureq,urqa,isca,isel,issc,isto,istr,isst,utip,iusa,iuse -defaults


I couldnt get the descriptions right :/

How to install:
Simply copy the ItemData trigger into your map and make sure you have both JNGP and ODE installed (links are in the requirements).

Keywords:
Item, Cost, Gold, Lumber, Data, Object, Editor, JASS
Contents

Just another Warcraft III map (Map)

Reviews
Moderator
21:02, 8th Feb 2016 BPower: The Object Data Extractor is a powerful tool, which probably doesn't get the attention it deserves. However this submission is just a link to the system plus demo map. We discusses already in the thread that I...
  1. 21:02, 8th Feb 2016
    BPower:

    The Object Data Extractor is a powerful tool, which probably doesn't get
    the attention it deserves. However this submission is just a link to the system plus demo map.

    We discusses already in the thread that I finally have to reject it as spell submission.

    Greets BPower.
     
  2. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,638
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Reserved.
     
  3. I hope this gets Director's Supah Mega Reject.
     
  4. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,709
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    You mentioned the extractor in our chat. It's ( maybe ) truly powerful.

    I didn't find the time yet to check how it's working.
    I guess players don't need third party tools to play maps using
    the object data extractor. Is that correct?
     
  5. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,638
    Resources:
    3
    Spells:
    3
    Resources:
    3
    Object Data Extractor simply reads in the data in w3* and places a shitload of data in a hashtable with imho too many underscores as prefix :D
    So yes, it is simple plain JASS load from hashtable and save in hashtable.
    Kind of the same as the other resources uploaded here about item costs.

    First of all, I have to give you credit for actual exact copy of the chat message.
    But next to that, it is kind of a troll resource because of how it got here.

    As BPower mentioned earlier, we had a little conversation about MareBre's GetItemCost and why I thought that it would be pretty useless when you use ODE for efficiency reasons and accuracy reasons.

    Then, BPower seemed to have uploaded another item cost resouce on which I couldnt resist to do the same with ODE implementation.
    That resulted in a visitor message to BPower about it which only he could have understood because we were practically the only ones that were talking about the ODE topic the day before yesterday.

    So, the resource is kind of troll because it essentially is just a marketing trick for the ODE, but on the other hand still many times better than all other resources made for the same reason.
    Not to put those resources down, it is kind of hard to actually do such a thing but you still have to realise that all you try to do is simply read Object Editor data... which can be done directly if that data is saved in runtime of the map in something like a hashtable for example.

    So in short:
    This resources is literally one line of code, so it is not really a resource in that perspective, but it is still better than all other resources made for the same reason.
    Idc if it gets rejected really... I do think that the ODE is not widely enough known and does deserve some attention.
     
  6. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,709
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    That's good.

    This is just a link to an existing resource, so I guess in the end we will not approve it here.
    However I would like to keep the thread running a bit in contrast to the two
    GetItemCost / ItemResourceCost system submissions.

    The OED, here presented as item data extractor is definitly useful.
    There are no bug reports afaik, so I guess it's quite safe to use for map makers.

    function GetItemTypeAbilities takes integer itemTypeId returns string

    ^
    I'm curious about the returned string for an ability list of x abilities.
    I have to test it :)
     
  7. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,638
    Resources:
    3
    Spells:
    3
    Resources:
    3
    It is indeed safe for map makers to use it, but there is a reason why I outcommented the two lines on the script.

    The descriptions and ubertips sometimes give in a doublequote randomly...
    So instead of
    call SaveStr(ExportedItemData___info,'gomn',10,"Reveals the entire map.")

    it does
    call SaveStr(ExportedItemData___info,'gomn',10,""Reveals the entire map."")

    Which gives an error obviously.
    However, the odd thing is that it is actually not having those double quotes in the description.

    I still put them in there so all the fields of the object editor are actually in the script.

    If you enter [ctrl]+[d] then you can see all the data in raw data format... with the exception of byte data (channel mess) or booleans (they are 0(false) or 1(true)).
    So abilities on an item will result in "A000,A001,A002" for example.
    If you split the string on the comma, you then have all the rawcodes which can be converted to integers via an ASCII converter.
    Both already exist in JASS resources.
     
  8. Shaeam

    Shaeam

    Joined:
    Aug 11, 2010
    Messages:
    267
    Resources:
    1
    Maps:
    1
    Resources:
    1
    What does this do exactly? The description doesn't help me understand the function this serves.
     
  9. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,638
    Resources:
    3
    Spells:
    3
    Resources:
    3
    I think it is better to explain what the Object Data Extractor (ODE) does.
    The ODE creates a new compiler script like shown at the very bottom of the script.
    //! LoadItemData fields=iabi,iarm,iico,ubpx,ubpy...

    The JASSHelper (iirc) then creates a hashtable and puts tons of values in there based on the fields that you chose.

    If you have JNGP, then you can see in the Object Editor that all Object Fields have a 4 character unicode. That code is the same as in these fields.
    But anyway, what JASSHelper does is simply look at all data in the object editor and puts it in a hashtable.
    Then you can read that exact data from the hashtable in-game.
    The -defaults at the end simply says that it should also store the data of standard objects.
    If you dont put it there, it would only take custom made item/unit types.

    So what this "resource" does is simply loading in almost all data from the object editor.
    So if you want to know the class of an item type, then all you have to do is this:
    local string class = GetItemTypeClass(GetItemTypeId(myItem))

    Ofcourse, that can be done for EVERY value from the object editor. (There seems to be a bug with descriptions and ubertips so Ive disabled those in this script.)
     
  10. Shaeam

    Shaeam

    Joined:
    Aug 11, 2010
    Messages:
    267
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Ahh, gotcha. Thanks for clarifying. Seems pretty useful, I'll give it a look!