| 07-20-2007, 12:50 AM | #1 |
The convert Unit Type to String converts the editor unit-type, so you end up with something like custom_no19. What I want is a way to display the name of a unit, without having that unit in the game. Displaying the name of its unit-type would work. How is this possible? |
| 07-20-2007, 02:42 AM | #2 |
I think the easiest way to do this is to pick some obscure area of the map, create a unit of that type, get the unit's name, and remove the unit. You can try to find something better in the JASS manual, but I tried to find a function to do this before and came up empty: http://jass.sourceforge.net/doc/api/...unittype.shtml http://jass.sourceforge.net/doc/api/...-integer.shtml |
| 07-20-2007, 03:22 AM | #3 |
Please elaborate on the situation of this problem and how you want to use it. If you want a wave system, then you could just as easily store strings to array variables for each wave. i.e. wavename[1] = treants, wavename[2] = ogres, etc. Other than that I am not sure what system would need to obtain names of units not in the map. I am assuming the unit type will change and will either spawn after the string is used, or not at all. In either case I don't see what you're getting at. |
| 07-20-2007, 05:55 AM | #4 |
I appreciate the help guys, but I am quite apt with triggers. I am looking for a dynamic way to display the unit type of the current level via string. Creep levels can be randomized, so a predefined array won't cut it. Currently, I create a unit of the current level, remove it, and record the name of last created unit. That works, but I am looking for a more efficient way. If I have a unit type variable, is there someway to convert it into a string? Say the unit type is Mountain Giant, can I somehow display "Mountain Giant," with only a unit type variable? |
| 07-20-2007, 06:23 AM | #5 |
I believe yes, since it isn't a custom unit. Custom units, I think not. |
| 07-20-2007, 07:00 AM | #6 |
Figured out the solution to this, had to use a bit of JASS though. |
| 07-20-2007, 09:59 AM | #7 |
You should share it for anyone searching the thread in the future. Also I want to know. |
| 07-20-2007, 09:52 PM | #8 |
set udg_myString = GetObjectName(udg_Spawns[udg_Level - 1]) Where Spawns[index] is a unit type variable. |
