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

Problem (more or less) with variations

Status
Not open for further replies.
Level 11
Joined
Sep 30, 2009
Messages
697
Could someone tell me how to enable variations for doodads and destructibles with custom models without having to write a textmacro for it? I have 10 trees named tree0 - tree9, but when i want to type "Models\\Doodads\\Tree\\Tree"
into the field it just adds .mdl afterwards. Is there a way around this? If not I wrote that little thingy here that made it work, but it sucks to have to reopen the map afterwards :/

JASS:
//! textmacro EnableVariations takes id type model
//! externalblock extension=lua ObjectMerger $FILENAME$
//! i setobjecttype("$type$")
//! i modifyobject("$id$")
//! i makechange(current, "dfil", "$model$")
//! endexternalblock
//! endtextmacro

//! runtextmacro EnableVariations("D003", "Doodads", "Models\\Doodads\\Tree\\Tree")
 
Level 11
Joined
Sep 30, 2009
Messages
697
Why don't you create a local that picks a random number between 0 and 9 and add it next to model argument?
JASS:
//! local num = math.random(0, 9)
//! makechange (current, "dfil", "$model$".."num")

Not sure if it works.

Actually I don't think you understand what I meant :/ The script I wrote works perfectly, I just wanted to know if there is an Object Editor only way to do this.
 
Level 6
Joined
Jun 18, 2011
Messages
147
I'm sorry, I'm new to JASS and custom scripts. I have variations of doodads also. I would like to learn how to use this macro. Is this a custom text trigger? Does this make all of the models of the specified type a random variation on map initialization?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You could overwrite the DoodadMetaData.slk, which stores the data types for each field the Editor expects. Choose any other string/path variant. It worked in my test but do not be too sure that it may not cause conflicts elsewhere. This file is not loaded individually for every map, so you would have to change the basic mpq or set up the path in wc3 directory (Warcraft III\Doodads\DoodadMetaData.slk). Do not ask me if Blizzard detects the change in BNet but I have a customized MiscData for maxSlope (via the directory method) for aeons as it is game irrelevant stuff/local fashion.
 
Status
Not open for further replies.
Top