How would I have it so if I type marine I would get a marine?
I want to do this with all units, so I cant just do"create a marine", there's got to be a way to make the unit of the name I type
sorry bad explaining. Im creating text tags on units randomly, when I type I want it to find that unit. So when I create a unit, its going to have random text tag overhead, then when I type that word over his head it finds that unit, sorry didn't want to give my map idea away but guess it don't matter not like its exactly original or best sc2 map idea ever lol
I tried catalog but that updates all units of that type, I need something that changes a units name just that unit. so 1 marine can have 50 random names or whatever
all that does is adds a tiny word below the units name
Ill try to be a little more clear, I want random text tags to appear over a units head, so lets say I have a zergling lots of them will spawn in my map, every so many seconds. Everytime they spawn I want to create a text tag above their head thats random, so when I type that text tag, it finds that unit. I thought by making the text tag their name it might be easier to do this but I guess not seems impossible. So how would I do this then?
I need to be able to find the unit when I type the word, thats why I thought I would need to change the units name
A Data Table saves information just like a array would. But an array takes a integer as index, while a Data Table takes a string. Exactly what you need.
I can't find how I would add the text above his head?
create text tag(how do I display little mister zerg) above last created unit.
Also I cant seem to find load? what is that under sorry
So you can just create units by writing "-create xxx" in the chat.
I tested this and the funny thing is that it has autocompletition.. so when I enter "Mar" it'll spawn a marauder, when I enter "Mari" it'll spawn a marine ^.^
You have to watch out though: The game searches for unit types, not for their actual game names. Most of the time they're the same, but they don't contain spaces. So it's not "Dark Templar", but "Darktemplar".
Capitalization doesn't matter, btw.
I do want to find it on the map not create lol.
and I cant use text Tag - Create a text tag with the text "Little Mister Zerg" because that isn't random
Here is exactly what I want if its function was in the editor this should be clear example of what Im trying to do and what my map is
Event- Every 5 seconds of game time
Action- create 1 zergling for badguy player
Action-Create text tag on last created unit that says Word(random # between 1 and 100)
Event- player types message
Action-Order unit to attack unit with text tag of which the player wrote
then I have a variable array thats a string called word and I set those all up so 100 different words
so a zergling spawns and it has 1 of 100 different text tags to it added on spawn
I type that word and I shoot it.
Its a simple map I thought would take a few hours max to make but wow seems more difficult then I thought. Hope its possible, and thanks for responding
Seems like you're making a typing game, typing its name will kill the unit ( just guess :) ) My suggestion is that you create a array of 100 string named TEXT. Predefine it with your text. Also a blank array of 100 unit named UNIT. Each time you want to create a zergling, use "Convert to int (random function *100)" and give it to a variable named RANDOM, give text tag TEXT[RANDOM] to that zergling and assign UNIT[RANDOM] to that zergling.
To call back the unit , use a switch case or 100 trigger for each text you typed.
I do want to find it on the map not create lol. and I cant use text Tag - Create a text tag with the text "Little Mister Zerg" because that isn't random
Here is exactly what I want if its function was in the editor this should be clear example of what Im trying to do and what my map is
Event- Every 5 seconds of game time Action- create 1 zergling for badguy player Action-Create text tag on last created unit that says Word(random # between 1 and 100)
Event- player types message Action-Order unit to attack unit with text tag of which the player wrote
then I have a variable array thats a string called word and I set those all up so 100 different words
so a zergling spawns and it has 1 of 100 different text tags to it added on spawn I type that word and I shoot it.
Its a simple map I thought would take a few hours max to make but wow seems more difficult then I thought. Hope its possible, and thanks for responding
Well, I guess I misread it twice :P
But in this case you can use the data table.
Instead of "Lil Mr. Z" you save a random number. Then you can load it like I wrote.
"Convert to int (random function *100)" and give it to a variable named RANDOM, give text tag TEXT[RANDOM] to that zergling and assign UNIT[RANDOM] to that zergling.
I created my variable array named text
I created my variable array named unit
I set variable text[1] and [2] and so on as my words
then I have trigger
every 5 seconds create zergling
Lost on what I do here????? convert him to to int random x100???????where or how do I do this?what is random variable?
attach text tag to last created unit the text Text[random #between 1 and 100] (I think I do this)
Also the killing unit part I couldn't find how to do, well I want to target and attack him, but same thing
There is a function call random number, just look for it. It will return a random real between 0 and 1, just multiply it by 100 and convert it to integer. Then you can give it to a variable, or give it directly to the array index number.
Instead of this random function you can also use (Get Random Integer between 0 and 100). It is a function that gives you a random number between 0 and 100.
So what you want to use are arrays only. That's fine though.
Just create your variable RANDOM and use the Get Random Integer function.
And then have fun making If-Then-Elses for all of your 100 words. That's a nice load of work. Of course you could also use a Data Table to get rid of that work.. just sayin'..
Forgot the random integer thing. But the formula is general in case he need any number of text. Also a loop 1 to 100 with an if-then should be much easier and more general
still don't work, but its almost right. The problem is when 2 units spawn with the same word I cant kill the first unit.
Example. zergling 1 spawns with word cat, zergling 2 now spawns also has the word cat. I type cat, and only the 2nd zergling will die, I have noway to get rid of that 1st zergling. (btw I don't want it to kill both) I just want 1 to die, then type again to kill the other
For simplicity you can make it so only 1 unit with the text can be on the field at the same time. Just use another boolean array and add some condition checking before creating. If you want to have both and always kill which come first, expand your UNIT array size, some thing like UNIT[x,y], y is now the order it created ( unit created 1st give to 1, the other to 2, when 1 was killed, give back 2 to 1 ... etc ). Make sure to have some condition checking to get it work properly.
I like this kind of idea. PM me when it's released or I can even collaborate with you on the trigger part.
How would I have it so if I type marine I would get a marine? I want to do this with all units, so I cant just do"create a marine", there's got to be a way to make the unit of the name I type
So you want to get the unit type from a string? Considered the cryptically named function UnitTypeFromString?
@caspersc: Go
sorry bad explaining. Im creating text tags on units randomly, when I type I want it to find that unit. So when I create a unit, its going to have random text tag overhead, then when I type that word over his head it finds that unit, sorry didn't want to give my map idea away but guess it don't matter not like its exactly original or best sc2 map idea ever lol
@threeleven: Go
I tried catalog but that updates all units of that type, I need something that changes a units name just that unit. so 1 marine can have 50 random names or whatever
So you're statements/questions are kinda all the place and I'm really not sure what you are after.
SetUnitInfoText will let you change display names etc on a unit by unit basis.
@caspersc: Go
all that does is adds a tiny word below the units name
Ill try to be a little more clear, I want random text tags to appear over a units head, so lets say I have a zergling lots of them will spawn in my map, every so many seconds. Everytime they spawn I want to create a text tag above their head thats random, so when I type that text tag, it finds that unit. I thought by making the text tag their name it might be easier to do this but I guess not seems impossible. So how would I do this then? I need to be able to find the unit when I type the word, thats why I thought I would need to change the units name
Easy, just use a Data Table.
A Data Table saves information just like a array would. But an array takes a integer as index, while a Data Table takes a string. Exactly what you need.
So everytime a Zergling spawns you do:
So your spawned unit would get index to "Little Mister Zerg" or whatever random name you want for it.
Then you can get it by:
And it'll return that unit.
@s3rius: Go
I can't find how I would add the text above his head? create text tag(how do I display little mister zerg) above last created unit. Also I cant seem to find load? what is that under sorry
I would be able to target this unit right?
That makes the text tag and attaches it to your unit.
About your question.. I've misinterpreted it and though you'd want to enter the unit's name and then find it's instance on the map.
To to your spawning stuff you can use:
So you can just create units by writing "-create xxx" in the chat.
I tested this and the funny thing is that it has autocompletition.. so when I enter "Mar" it'll spawn a marauder, when I enter "Mari" it'll spawn a marine ^.^
You have to watch out though: The game searches for unit types, not for their actual game names. Most of the time they're the same, but they don't contain spaces. So it's not "Dark Templar", but "Darktemplar".
Capitalization doesn't matter, btw.
@s3rius: Go
I do want to find it on the map not create lol. and I cant use text Tag - Create a text tag with the text "Little Mister Zerg" because that isn't random
Here is exactly what I want if its function was in the editor this should be clear example of what Im trying to do and what my map is
Event- Every 5 seconds of game time Action- create 1 zergling for badguy player Action-Create text tag on last created unit that says Word(random # between 1 and 100)
Event- player types message Action-Order unit to attack unit with text tag of which the player wrote
then I have a variable array thats a string called word and I set those all up so 100 different words
so a zergling spawns and it has 1 of 100 different text tags to it added on spawn I type that word and I shoot it.
Its a simple map I thought would take a few hours max to make but wow seems more difficult then I thought. Hope its possible, and thanks for responding
@threeleven: Go
stumped also?
Seems like you're making a typing game, typing its name will kill the unit ( just guess :) ) My suggestion is that you create a array of 100 string named TEXT. Predefine it with your text. Also a blank array of 100 unit named UNIT. Each time you want to create a zergling, use "Convert to int (random function *100)" and give it to a variable named RANDOM, give text tag TEXT[RANDOM] to that zergling and assign UNIT[RANDOM] to that zergling.
To call back the unit , use a switch case or 100 trigger for each text you typed.
Eg: Switch (typed chat message)
If ( TEXT[1] ) then Kill UNIT[1]
If ( TEXT[2] ) then Kill UNIT[2]
If ( TEXT[3] ) then Kill UNIT[3]
.....
Good luck, this kind of idea really need work :P
Well, I guess I misread it twice :P
But in this case you can use the data table.
Instead of "Lil Mr. Z" you save a random number. Then you can load it like I wrote.
@progammer: Go
I don't understand this part
"Convert to int (random function *100)" and give it to a variable named RANDOM, give text tag TEXT[RANDOM] to that zergling and assign UNIT[RANDOM] to that zergling.
I created my variable array named text I created my variable array named unit I set variable text[1] and [2] and so on as my words
then I have trigger every 5 seconds create zergling Lost on what I do here????? convert him to to int random x100???????where or how do I do this?what is random variable?
attach text tag to last created unit the text Text[random #between 1 and 100] (I think I do this)
Also the killing unit part I couldn't find how to do, well I want to target and attack him, but same thing
@threeleven: Go
There is a function call random number, just look for it. It will return a random real between 0 and 1, just multiply it by 100 and convert it to integer. Then you can give it to a variable, or give it directly to the array index number.
@threeleven: Go
Instead of this random function you can also use (Get Random Integer between 0 and 100). It is a function that gives you a random number between 0 and 100.
So what you want to use are arrays only. That's fine though.
Just create your variable RANDOM and use the Get Random Integer function.
So every time your unit spawns you do:
And there we go. That should be all you want, no?
And then have fun making If-Then-Elses for all of your 100 words. That's a nice load of work. Of course you could also use a Data Table to get rid of that work.. just sayin'..
@s3rius: Go
Forgot the random integer thing. But the formula is general in case he need any number of text. Also a loop 1 to 100 with an if-then should be much easier and more general
still don't work, but its almost right. The problem is when 2 units spawn with the same word I cant kill the first unit. Example. zergling 1 spawns with word cat, zergling 2 now spawns also has the word cat. I type cat, and only the 2nd zergling will die, I have noway to get rid of that 1st zergling. (btw I don't want it to kill both) I just want 1 to die, then type again to kill the other
@threeleven: Go
For simplicity you can make it so only 1 unit with the text can be on the field at the same time. Just use another boolean array and add some condition checking before creating. If you want to have both and always kill which come first, expand your UNIT array size, some thing like UNIT[x,y], y is now the order it created ( unit created 1st give to 1, the other to 2, when 1 was killed, give back 2 to 1 ... etc ). Make sure to have some condition checking to get it work properly.
I like this kind of idea. PM me when it's released or I can even collaborate with you on the trigger part.
@progammer: Go
for it to work exactly how I want, I would want it to kill the closest of the 2, since that one is the biggest threat