Is there an easy and low afford way to display the current Waves Name?

Status
Not open for further replies.
Level 4
Joined
Dec 23, 2023
Messages
47
Hallo,
I'm am currently on doing the finishing touches of my TD Map. Now I search for a fast way to show the current Wave as Text with the Trigger:
  • Game - Display to (All players) for 5.00 seconds the text: BOSS 1
For the Boss Waves I have just written it. But for the Waves itself, it would require a ton of monotone work. Is it maybe possible to display the current Name of the Wave Unit? They are named Welle 1, Welle 2 and so on. (Welle, german for wave). I use a system with a variable that saves the Wave Units as Array.

I found a way to show the Current Wave Number, but then it really just shows the Number, without the "Welle" text.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Have you looked at all of the functions when editing your text message? In there you can find "Name of unit" and I think even the Unit-Type.

But what most TD maps do is use Array variables to define everything at the start of the game:
  • Events
    • Map initialization
  • Conditions
  • Actions
    • -------- Setup the 1st unit --------
    • Set Variable Wave_Unit_Type[1] = Footman
    • Set Variable Wave_Unit_Count[1] = 5
    • Set Variable Wave_Description[1] = "Wave 1: Footman"
    • -------- Setup the 2nd unit --------
    • Set Variable Wave_Unit_Type[2] = Knight
    • Set Variable Wave_Unit_Count[2] = 4
    • Set Variable Wave_Description[2] = "Wave 2: Knight"
    • ...
Then you can easily access this data at any time using your Current Wave variable:
  • Actions
    • Set Variable Wave_Number = (Wave_Number + 1)
    • Game - Display to (All players) for 5.00 seconds the text: Wave_Description[Wave_Number]
    • Unit - Create Wave_Unit_Count[Wave_Number] Wave_Unit_Type[Wave_Number] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
ok so there is no fast way... Dammit.
Did you read my post? First line my friend:
Have you looked at all of the functions when editing your text message? In there you can find "Name of unit" and I think even the Unit-Type.

But again, I recommend the Arrays, it'll make everything better in the long run, probably save you time in the end.
 
Level 4
Joined
Dec 23, 2023
Messages
47
I only see Conversion - Convert Unit-Type to String, there I can choose my variable with the current Unit type, but it shows the ID of the Unit, not the Name.

Oh god there is a Unit name itself... I search for something in Conversion because from current knowledge I thought it must be something like this, to use a Variable as Text. (something like convert unit to text).

EDIT: Oh no, i can't choose my Variable there.

Edit 2, because I am not allowed to post another answer:
But again, I recommend the Arrays, it'll make everything better in the long run, probably save you time in the end.
I only see a ton of work and no other use for it, where it could save me time.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
"afford" is likely the wrong word. Did you mean "effort"? Since the approach shown by Uncle is both performant and maintainable.

Usually you want to structure your wave system as a data fed system where the same code handles all waves and the waves are fed into the system as data typically in arrays. This lets you make changes to wave logic in a single location, and alter all waves for balancing also in a single location. This might need some effort to setup initially, but in the long run it can save you a lot of effort over multiple separate triggers repeating similar logic, especially when it comes to balancing and bug fixing.
 
Level 4
Joined
Dec 23, 2023
Messages
47
"afford" is likely the wrong word. Did you mean "effort"?
Oh yes... Sorry, English is a second language to me, and my Browser Add-on that helps me a lot with spelling is not perfect. My original writing was "eford" s yeah xD
Usually you want to structure your wave system as a data fed system...
Yes of course, I understand this. But it is my first TD Map and my second Map overall. So it is OK to not being perfect, to do things not the best way. God damm before this Map I NEVER used variables. I already learned so much stuff, I will do better in the next Map.

I understand, know how I can use variables for basically any number that is used in the Trigger Editor. Now I understand the advantage of writing anything that is planned down before starting with anything else then the terrain.

My original hope was that I can make it with a few triggers, that I don't have to make a manual message for 50 waves + 5 Bosses.
I will check out what Pyrogasm said:
In english the function you want to use to put multiple strings together (one that says welle and one that says the number) is called Concatenate Strings.
Maybe this is what I am searching for.

@Pyrogasm Dammit, it was close but I can't choose the Variable that has the current wave number, because it is an integer. Is there a way to make it possible?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
@Pyrogasm Dammit, it was close but I can't choose the Variable that has the current wave number, because it is an integer. Is there a way to make it possible?
If you want to include it as part of the string you are concatenating, you will need to convert it from integer to string. There is a conversion function to do this.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
And where do i find it... I tried with search for text in Actions with Conv but there is nothing.
It is a string function. So anywhere that accepts a string expression can use it.

In English it is called "Conversion - Convert Integer to String" and takes an integer value in, returning a string value.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
And where do i find it... I tried with search for text in Actions with Conv but there is nothing.
All of the Conditions and Actions have these options to choose from:

Functions.png

FunctionsMore.png


If you're thinking, "How can I do this?" and can't find an Action for it, then there's probably a Function that does what you want. To find the function, you just need to think about the type of thing you're working with. If we're trying to -> Convert an Integer to a String, then we can determine that we're working with Strings and can start there. Next best guess would be to check out the Integer section.

Integer, Real, String, and Boolean are the four main variable types that you'll see used everywhere. Then of course there's Warcraft 3 types like Unit, Unit-Type, Item, Item-Type, Point, Region, and so on.

You can also see there's the Preset option which gives you variables that Blizzard has created for you. These are here to help you with math formulas and constant values that the game relies on. For example, all buildings are created facing 270 degrees, which is stored in a Preset called Default building facing.

There's also tips written in grey text at the bottom of the Event/Condition/Action windows. Always remember to read these first!

1707080815711.png
 
Last edited:
Level 4
Joined
Dec 23, 2023
Messages
47
Oh god sometimes you just don't think about the easiest things.
In English it is called "Conversion - Convert Integer to String" and takes an integer value in, returning a string value.
This is something I always found, but it only replays the number.
Then someone here gave me this
In english the function you want to use to put multiple strings together (one that says welle and one that says the number) is called Concatenate Strings.
and I thought I am so close, but there I can't choose the Variable with the number. I completely forgot that IU can choose the first thing there for the 2nd string.

I really still have to go a long way to make wonderful maps.

But thank you all, I finally managed to do it, with the help of all your messages. Sorry that it took me so long, to understand I can use both methods at once.
 
Status
Not open for further replies.
Top