HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How does Create Unit by text work?

12-06-2004, 04:24 PM#1
Soultaker
Hi

How does it work? It got this:

Code:
Unit - Create 1 (Unit-type(RaceText) for ? player at ??? location


It seems like that this doesn't work with custom units or just a ordinary unit with modified name, it also don't work with unit that got two names, example: Blood Mage.

As you can hear i've been trying around with this but I can't make it work...

Also I need it to work with Custom Hero's..

---Soultaker
12-06-2004, 10:13 PM#2
player_72985
If you could please explain what game you are attempting this, or if you are making the triggers yourself, please show your triggers
12-06-2004, 10:23 PM#3
fugly
unit type is an integer not a string. if your looking for custom units your going to have to hit the tab that says "melee" or "campaign" and set it to custom.
12-07-2004, 02:07 AM#4
th15
Yea that's right, unit IDs look lsomething like "U0001" etc (If you press ctrl-d in the object editor, you can see each unit's ID).

What you can do is assign all the units to a unit-typee array then traverse the array and check each index if "Unit name of units[integer A] = entered chat string". It should work with any unit name if you handle the input substringing correctly.
12-07-2004, 02:04 PM#5
Soultaker
Quote:
Originally Posted by th15
Yea that's right, unit IDs look lsomething like "U0001" etc (If you press ctrl-d in the object editor, you can see each unit's ID).

What you can do is assign all the units to a unit-typee array then traverse the array and check each index if "Unit name of units[integer A] = entered chat string". It should work with any unit name if you handle the input substringing correctly.

Im making a WoW map (World of Warcraft) and there is a lot of diffrenct Race/Class compinations thats why im making this...

Well, I think that system will work else I write here :)
12-07-2004, 02:18 PM#6
th15
Its not that hard to assign units to a unit array. Most people, when faced with 200+ variables to initialize will just convert the initialzation trigger to JASS so that you can quickly edit the code (thats how wardraft handled the hundreds of variables it had, go get a copy of it from elilz.com to see what i'm talking about).