• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Magic Jass script for Item's ID

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hello. Is there a script that can get the ID of an Item-Type (not Item) variable? I mean, do i have to do this :
  • Recipes Save Copy
    • Events
    • Conditions
    • Actions
      • Set Location = (Center of (Playable map area))
      • Item - Create ItemCreated at Location
      • Set Item = (Last created item)
      • Custom script: set udg_Integer = GetItemTypeId(udg_Item)
      • Item - Remove Item
      • Custom script: call RemoveLocation(udg_Location)
      • Hashtable - Save Integer as (Key RecipeItemCreated) of 1 in RecipeHash
Variable name / Variable type
Location - Location
ItemCreated - Item-Type
Item - Item
Integer - Integer

Or i can do something like
  • Custom script: set udg_Integer = GetItemTypeId(udg_ItemCreated)
Thanks in advance!
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Item-types are integers.
You can set the integer to the item-type without any problems (that's how I do it in my recipe system).

So that is either:
  • Custom script: set udg_Integer = udg_ItemCreated
or:

  • Custom script: call SaveInteger(udg_RecipeHash, udg_RecipeItemCreated, 1, udg_ItemCreated)
(no need for "Integer" here).
 
Last edited:
Item-Type is something that only exists in GUI. Item-Type is simply an integer variable in JASS.
So, no, the custom script you posted makes no sense, as you already have the ItemTypeId and don't need to convert it again.

udg_ItemCreated and udg_Integer will have the same value in your example and can be interchanged.
 
Status
Not open for further replies.
Top