• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[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