• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Item-type to string

Status
Not open for further replies.
Level 4
Joined
Aug 12, 2004
Messages
76
Is there a way to convert item-type to string?

So I want to use item-name of item
function but this doesn't allow you to convert item-type to item-name and only allows specific items to be converted.
 
You have to be grabbing the name from an item that actually does exist, not just a type of item. There is no command that gets the item name of "any item of this type" short of creating a system that does this:

1. Creates new item
2. Saves item name
3. Remove the item and the location leak (if in GUI there will be a location leak)
4. Return the item name to the place you use it

I won't make this in GUI for you, and if you're like most people here you don't know a thing about JASS so that advice wouldn't help you, either.

The best advice for you is to manually type in the name of each item...
 
Level 4
Joined
Aug 12, 2004
Messages
76
Well I know the basics of Jass fairly well but I just like using GUI better as it's less prone to errors.

Anyhow, so, if I were to try and make a bazaar system, where I am using a hashtable to store integer values of how many items were sold to a certain shop, and from that compare it with item recipes so as to retrieve an item and put it into the market, I would need to create the actual item itself every single time to compare the items?

Hmm, I guess there really is no other way.

Thanks once again.
 
Why are you comparing the item names instead of the item types? The item-type comparison is totally sufficient.

Another thing: GUI is far more prone to errors, because the debugging process is insane and often impossible. JASS syntax errors (which you refer to) are the easiest thing in the world to fix, it tells you exactly what the error is.

that is, unless you're using vJass and you see a world of weirdness in the syntax error log.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Bribe said:
Why are you comparing the item names instead of the item types? The item-type comparison is totally sufficient.

This is true. Why are you comparing the names of the items rather than their item type IDs. They are both integers, and can be compared quite easily in a boolean. It also saves the hassle of when two items have the same name. If your heart is set on the item name, keep reading.

Bribe said:
The best advice for you is to manually type in the name of each item...

I should report you.

By the way, the native is GetObjectName, Bribe. Cookie for you. And definitely do not do what Bribe said. Lmao. Pwnt.
 
Status
Not open for further replies.
Top