• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Item Data Extractor 1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Requirements:
- JNGP
- Object Data Extractor

Script:
JASS:
//! 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
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...

Moderator

M

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 finally have to reject it as spell submission.

Greets BPower.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
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?

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.

[18-07-27] Wietlol: edo494, my first troll resource :D http://www.hiveworkshop....-extractor-1-0-a-275360/

Yes, It's-a complete useful tool! ^^
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.
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
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.
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 :)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
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.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
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.)
 
Level 7
Joined
Aug 11, 2010
Messages
269
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.)

Ahh, gotcha. Thanks for clarifying. Seems pretty useful, I'll give it a look!
 
Top