| 02-03-2003, 04:04 AM | #1 |
Guest | I posted this in the Jass forum late last night, but that section doesn't get as many views... ::This post is about custom text:: I'm trying to create (or find) a function that will let me look up (or create) a unique integer for a specific unit. For example, in the WE, units placed in the map have an ID like "Paladin 0001". I want the "0001" part. If could just find something UNIQUE in string format, then I could rig up my own parse function using the substringBJ function. That blasted UnitID and Unit-Name thing only references Unit-Type (i.e. footman), so it's useless for my purposes. What I'm trying to do is create a variable array that uses this unique unit integer as it's index. That way, I can look up that variable for that unit in any trigger. Ugh. Been wracking my peabrain on this for hours and hours... Finally decided that this is basic enough that someone else must have come up with a way... Thanks in advance... |
| 02-03-2003, 04:14 AM | #2 |
Maybe Im dense or missreading what u want but..... Just assign any unit u want to the array by hand... then u have access to them.... If it is a WE map made unit u do it by hand in an init. otherwise do it when u create it. if the user trains it then assign it then... please give me more specifics if this doenst help!! |
| 02-03-2003, 04:35 AM | #3 |
Guest | Rod: It's for the array index, not a variable value. That's why it needs to be an integer so I can use it as the index in a variable array. The Jass Syntax won't let me put a Unit value where an integer value is supposed to go. Unfortunately, there is no Convert Specific Unit to Integer. Keep in mind that I want an integer that represents a "Specific Unit" not "Unit-Type" or "Unit-Name". As I said above, if I could also use this value as a string, where I could parse it into what I want. What would really really be ideal is that "0001" thing I mentioned. |
| 02-03-2003, 06:18 PM | #4 |
Guest | Thanks to AIAndy, I got this one worked out. I posted a solution in the trigger depository. http://www.wc3campaigns.com/forums/s...threadid=11158 |
| 02-03-2003, 09:36 PM | #5 |
That's how I use to do it but there are easier ways: -If the unit has no spells, set its mana regen to 0 and set its mana to the index of the array. -If the unit is a ground unit, store the integer in its flying height (has no effect on ground units) -If the unit is a building, store the integer in its movement speed -For any type of unit, use the prop window angle, but it can only use values up to 360. |
| 02-03-2003, 10:32 PM | #6 |
Edited because: Hi . |
