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

Using a Variable with the Object Editor

Status
Not open for further replies.
Level 5
Joined
Feb 24, 2009
Messages
110
Is it possible?

For example: Lets say I want a unit to be named "Level 1", so I go to editor and change his name to that, ok we all know that

But, what I want, is the Custom Unit to be called something like: "Level [var]", so whenever I change that variable var with triggers, next time I create that unit is called "Level 2", "level 3", etc

I think something like this can be done, by reading the skill "Banish" Text-Tooltip-learn-extended
Turns a non-mechanical unit ethereal and slows its movement speed by <AHbn,DataA1,%>% for a short duration. Ethereal creatures cannot attack, but they can cast spells and certain spells cast upon them will have a greater effect. |n|n|cffffcc00Level 1|r - <AHbn,Cost1> mana, lasts <AHbn,Dur1> seconds. |n|cffffcc00Level 2|r - <AHbn,Cost2> mana, lasts <AHbn,Dur2> seconds. |n|cffffcc00Level 3|r - <AHbn,Cost3> mana, lasts <AHbn,Dur3> seconds.
the non extended text-tooltip-learn also uses another variable called %d:
Learn |cffffcc00B|ranish - [|cffffcc00Level %d|r]


Conclusion:
I want the Text-Name to be something like: Level <variable value>, but I dont know exactly how to call my variable.
And does anyone know how does "%d" work?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Nope, there is a difference between the unit types you set in the object editor and the unit instances you create then ingame that are only based of the object editor relatives.

You cannot change any object editor field data ingame, they are pretty static, nor can you create new objects for it.

The method you show only accounts for using in-object-editor variables, like I just wrote, these are constant anyway. But the method also does not work properly, so nobody really uses it.

In case you have the JNGP, there is the tool ObjectMerger included which can produce objects for object editor from lua code while precompiling which again you can implement in vJass scripts (lua). That may be able to help you a bit with matching constant jass variables with the object editor data when used in combination with textmacros but has its restrictions/limited possibilities. See a tutorial here. The ObjectMerger can also save you work by automating the object creation process.
 
Level 5
Joined
Feb 24, 2009
Messages
110
Wow, that seems to hard and complicated for me at the moment, but thanks anyways. I'm still really newbie at GUI, and I'm afraid of any other trigger/code system.

I guess I will either create each custom unit with the different names, or just forget about this feature.
 
Status
Not open for further replies.
Top