• 🏆 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!

[LUA] Reading the value of a given object

Status
Not open for further replies.
Level 16
Joined
Aug 7, 2009
Messages
1,403
Hello!

Since the map I'm working on is at my terrainer, I decided to write some textmacros to generate object editor data, so I can CnP two triggers and implement tons of WC3 objects. Everything is working as it should, however I'm stuck at something: I don't know how to read a given value of an object!

So the question is, what's the function in LUA that does this? I'd like to read the gold cost and the extended tooltip of an item.

Thanks in advance for the answers!
 
Level 16
Joined
Aug 7, 2009
Messages
1,403
Why would you want that? It doesn't support in-game creation of objects anyway.

Since the map I'm working on is at my terrainer, I decided to write some textmacros to generate object editor data, so I can CnP two triggers and implement tons of WC3 objects.

Of course I know that it's impossible to create objects in-game.
My shop is based on abilities. The tooltip contains ~4 different colors, and has 1-4 levels. It's a huge pain in the a** to create them via object editor, and CnP them as I get my terrained map back, so I decided to create a lua textmacro. I wanted to simply pass the recipe component item ID's, to avoid endless textmacro calls, but I can't really find any proper tutorial/thread/resource where it's explained.

EDIT: okay, I think I got a solution: I'm creating an external file for each item and store its cost, tooltip and icon (cuz items are created via a LUA textmacro too). I simply read the required data from that file when the ability textmacro is called.
I'm ready for easier suggestions tho'.

EDIT2: cool, it's working now.
 
Last edited:
Level 16
Joined
Aug 7, 2009
Messages
1,403
The items we're talking about are created by another textmacro. I've learnt how to write things into external files, so I can store the required informations in txt files. And that's the way it works now.

Took me a while to get this work as I've never used LUA before, but it is working now :)
 
Status
Not open for further replies.
Top