Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Ok, so this is for a duel, im gonna put Floating text infront of the heroes saying "blah vs blah". But the duel is random (with random people). So how would i get the players name if i dont know whos going to be duelling?
Anyway, it's not exactly random because at some point you will know who will be dueling and that's when you should display it. For example one way would be when the particular players are chosen you would grab their names and store each in a string variable. Then play your text trigger and call on those string variables.
Unit Group - Pick every unit in Heroes and do (Floating Text - Create floating text that reads ((Name of (Owner of DualUnit[1])) + (Versus + (Name of (Owner of DualUnit[2])))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency)
Where "Heroes" is a Unit Group variable which would contain all the heroes in the map. And "DualUnit" is an array Unit Variable which you would set to the two units dueling.
:\
Create them in the Variables section(The yellow X).There is a Unit Group(Heroes), and a Unit variable(DuelUnit[X]) used in what I showed. The Unit variable should be an array.
For the Unit Group you could do:
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Unit Group - Add (Picked unit) to Heroes)
I'm not sure how you choose the two random duelists, but I'm sure there's somewhere you can set DuelUnit[1 and 2] to them.
For example one way would be when the particular players are chosen you would grab their names and store each in a string variable. Then play your text trigger and call on those string variables.
Floating Text - Create floating text that reads ((string[1] + vs. ) + string[2]) at (Center of (Playable map area)) and so on...
Something like that.
Creating and editing text is the thing that annoys me most in the GUI. All those concatenate strings and going back and forth in those windows can be frustrating when you want to add colours and such.
P.S. If you ever need someone to test the map on I'd be glad to help just shoot me a message.
Okie, thanks. Will see how it turns out
Ugh, how will i store the names in the variable? Because if there was a way to store a persons name depending if they were in a region or not, it would be easy, but im not sure how :/
Would i need an array, and loop through the picked players somehow getting their names?
Edit: sigh, ive tried everything i know of and it isnt working >.> i tried:
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
For each (Integer B) from 1 to 2, do (Actions)
Loop - Actions
Set temp_unit = (Random unit from group[(Integer A)])
Set PlayerNames[(Integer A)] = (Name of (Owner of temp_unit))
Unit - Move temp_unit instantly to battle_point[point_index], facing Default building facing degrees
Unit Group - Remove temp_unit from group[(Integer A)]
Unit Group - Add temp_unit to group[3]
Set point_index = (point_index + 1)
then
Floating Text - Create floating text that reads PlayerNames[(Integer A)] at PlayerTextPoint[1] with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 100.00%), and 0.00% transparency
to display it, but that doesnt work, ive also tried 2 other things, i thought this was the closest to it though >.<
I can't remember but the duel is 2v2 right? That would sort of explain why your using 2 loops (or maybe I wrote that part I don't remember xD). This would mean there is a conflict because you used Integer A to refer to the array of the PlayerNames variable (which I'm assuming has 4 entries for 4 players) as what is happening is you're only setting 1 and 2.
Man I can see why you were getting confused about Integer loops! I had to gaze at this for a while to understand it, and I wrote it!
If you have put the floating text action outside the loop that would stop it working due to the fact you can't refer to Integer A/B outside of their loops.
So, we need to correct that array reference. Seeing as your point_index will move from 1-4 this would be perfect to be used as the array reference for the string variable too. Remember to reset that integer befor you start using it!!
Actions
Set point_index = 1
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
For each (Integer B) from 1 to 2, do (Actions)
Loop - Actions
Set temp_unit = (Random unit from group[(Integer A)])
Set PlayerNames[point_index] = (Name of (Owner of temp_unit))
Unit - Move (Triggering unit) instantly to battle_point[point_index], facing Default building facing degrees
Unit Group - Remove (Triggering unit) from group[(Integer A)]
Unit Group - Add temp_unit to group[3]
Set point_index = (point_index + 1)
So now you have 4 names in that PlayerNames variable array. Players on team 1 will be in array 1 and 2 and team 2 will be in 3 and 4.
So then you make your floating text but no need to refer to any Integer A. You would do something similar to the action I wrote in a previous post but for 4 people:
(((PlayerNames[1] + PlayerNames[2])) + vs. ) + (PlayerNames[3] + PlayerNames[4]))
I left that basic for the reason that you will want to format it to your liking.
Yes. Very xD
Loops are so confusing, they could have made them a bit simpler, jeez.
Ill try to understand what you just said
Btw, when i place the floating text, I want it to be like this if possible... (had to make screenshot, for some reason wont let me post it like this)
Something like that. Can i place them all in 1-2 trigger with spaces between the text or am i better off doing it 5 seperate triggers? Just want a masters opinion
And i just noticed in my trigger i had
Unit - Move temp_unit instantly to battle_point[point_index], facing Default building facing degrees
and you had Move (triggering unit). Did you just mean to copy my trigger and make a mistake or would i now have to change my trigger to triggering unit? Just wondering incase i get it wrong >.>
And how would i reset the integer? I dont really get what you mean >.>
Reset as in re-set. Unless you only use it once if it's not back to default when you use it again it will not work.
Uh the triggering unit thing was a mistake on my part.
Probably the best way to do the text in that case is to have 5 different actions.
Make a new point variable array[5] and pre-set the points like you did for battle_point.
Didnt understand what you just said, but ok xD
edit: i do get it a bit now
I was just looking at the triggers, and i dont think point_index can be used. because its still used throughout the trigger. So shall i just copy the trigger and you just have a look at it again? o.0
edit 2: I just tried it, and it worked for 1 person. im gonna try it for the others, ill get back to this thread when i see if it works ;D
edit 4: IT WORKED Thanks so much all you guys. thanks alot toofless xD. always be ready to help me again in the future, haha.
Solved!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.