• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom Tower TD

Status
Not open for further replies.
Level 4
Joined
Jan 2, 2021
Messages
20
Hello,

im pretty new to the World Editor and had to look up nearly everything i already have done in my new Map. I had the Idea of an "Custom Tower" Tower Defense, where you can buy items for your towers that give them diverse custom made spells.
It's already working pretty good, but not every spell seems to work like the posion arrow ability for towers and the unstuck spell from the workers.
Also units sometimes seem to be stuck, i've read that this is called "leaking" and the only solution i found, was not to spawn more then 12 units at a time, which is pretty low in a TD i think.
I also have read about spawning one unit at a time, but i have no idea how to trigger that.
If i could get at least that poison arrow and unstuck spell to work, i would be happy because this is slowing my progress in the map. I want to go on and have many ideas, but these (for you i think very little) problems cost a lot of time.
I hope someone can help me with this issue :) every helper will be named in the map, if you want that.
Happy new year everyone and best greetings

Zankh
 

Attachments

  • CustomTowerTD_Alpha.w3m
    77.9 KB · Views: 48
Level 6
Joined
Jul 21, 2020
Messages
67
One thing that can help when you have a ton of units on the map that are all owned by the same player is to basically split up the units being spawned into multiple players. This can help with the "Stepping" issue that can happen when a single player is controlling a ton of units. It isn't an issue with the amount of units on the map just about how much one player can handle at a time. To make it invisible to the other players, you can using triggers change the color of your "Shared" players to all be the same.

As far as spawning all of your units at once. 100% split that over a loop. Even if it's a trigger that runs once per every 0.1 seconds, it will get rid of the freeze that can happen when you try to spawn a ton at once. Easiest way is to have 2 triggers. The trigger that runs every 0.1 seconds but is turned off initially, then a trigger that controls the spawning trigger. Basically, sets up the round. (Unit type, spawn location, amount of times to run using variables) then turns on the spawning trigger. Which will then turn itself off after it's run the set amount of times. I hope this makes sense. I don't really have time to put together a trigger for you but that would be in my opinion the easiest way to start.
 
Level 13
Joined
Jul 12, 2018
Messages
510
i did a quick n dirty hotfix for your Unstuck. Note that i only made it work for Red player, if you want it fully working you have to create regions for the rest of the players and reference them in the unstuck trigger i started.

I fixed the leaks in it, and in doing so i created two new variables, TempLocation and TempUnitGroup, the first one is an array because i needed two points to reference. If you read the link i posted above you'll understand what i did with the variables and the custom script at the bottom.

also changed your spell from a chain lightning base to a Channel based spell, just because it's nicer when you can point it at the ground. I made it pick all units in 250 range of the point you cast at, but you can change that to any range you want.

I made the spell work on other players' lanes as well, but to make it set the correct move order i had to make a new Region to check where the targeted unit is.
If you prefer it not be castable on other players' lane units you can put it in separate triggers like you had, or you can edit the "set TempUnitGroup.." to only pick units owned by green in your own area.


the stuff i did regarding the leaks "needs" to be done in all of your spawning and movement triggers as well, but you can save a lot of time with it if you combine them all into one or a few triggers with Loops. Here's a quick tutorial on loops, it's not the one i learned from but it looks right at a quick glance and it's approved so i'm sure it's good: [How-to] Loop In GUI!
knowing loops will be very helpful in making a TD.

i also added a little graphical effect on the affected units to show that it works, obviously remove that or change the effect to your liking.
 

Attachments

  • CustomTowerTD_Alpha_unstuck.w3m
    79.6 KB · Views: 48
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
So I went a little overboard and created a Tower Defense system with your maps design in mind.

I'd fully understand if you didn't want to use it, as it's a bit intimidating to look at and is using somewhat advanced techniques. I tried to add a lot of comments explaining what's going on so that should help.

That being said, I think you'll like it a lot if you take the time to understand it. I'm using techniques that others in this post have already mentioned which will make your life A LOT easier. The thing with Tower Defense maps is that you're often doing the same thing for every Player, which opens up the door to use Arrays and Hashtables which will remove a lot of the redundancy.

For example, in this SINGLE trigger from my map you can setup every single Wave (Unit Spawn):
  • SETUP Waves
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- === Required Variables === --------
      • -------- Wave_Level = Set this to the desired Wave Level. --------
      • -------- Wave_Unit = The unit that will spawn. --------
      • -------- Wave_Count = The number of units that will spawn in total. --------
      • -------- Wave_Interval = The interval between spawning another unit. --------
      • -------- Wave_Start_Delay = After the last unit has spawned for a wave, this is how long until the next wave starts. --------
      • -------- Wave_Lives_Lost = How many lives the player will lose when the unit reaches the end. --------
      • -------- --------
      • -------- === Optional Variables === --------
      • -------- Wave_Start_Text = The text that appears when a wave starts. (Optional) --------
      • -------- Wave_End_Text = The text that appears at the end of a wave. (Optional) --------
      • -------- Wave_Start_Trigger = A trigger that will run when a wave starts. (Optional) --------
      • -------- Wave_End_Trigger = A trigger that will run when a wave ends. (Optional) --------
      • -------- --------
      • -------- Note: If you don't set Wave_Count, Wave_Interval, Wave_Lives_Lost, and/or Wave_Start_Delay then their DEFAULT values will be used. --------
      • -------- DEFAULT values are determined in the Variable Editor. Press Control + B to open it. (There's a bug when editing variables outside of the variable editor so don't do that) --------
      • -------- --------
      • -------- Wave Configuration: --------
      • Set VariableSet Wave_Level = 1
      • Set VariableSet Wave_Unit[Wave_Level] = Wave 1 - Footman
      • Set VariableSet Wave_Count[Wave_Level] = 10
      • Set VariableSet Wave_Interval[Wave_Level] = 0.25
      • Set VariableSet Wave_Start_Delay[Wave_Level] = 5.00
      • Set VariableSet Wave_Lives_Lost[Wave_Level] = 1
      • -------- --------
      • Set VariableSet Wave_Level = 2
      • Set VariableSet Wave_Unit[Wave_Level] = Wave 2 - Rifleman
      • Set VariableSet Wave_Count[Wave_Level] = 10
      • Set VariableSet Wave_Interval[Wave_Level] = 0.25
      • Set VariableSet Wave_Start_Delay[Wave_Level] = 5.00
      • Set VariableSet Wave_Lives_Lost[Wave_Level] = 1
      • -------- --------
      • Set VariableSet Wave_Level = 3
      • Set VariableSet Wave_Unit[Wave_Level] = Wave 3 - Knight
      • Set VariableSet Wave_Count[Wave_Level] = 10
      • Set VariableSet Wave_Interval[Wave_Level] = 0.25
      • Set VariableSet Wave_Start_Delay[Wave_Level] = 5.00
      • Set VariableSet Wave_Lives_Lost[Wave_Level] = 1
Simply copy and paste the Variables, adjust their values to what you desire, and that's it. The system will handle the rest for you.

The Optional variables add room for things like Text Messages as well as for running specific triggers, which is useful for doing anything that the system doesn't already provide. For example, if you wanted to add Gold to each player at the end of a Wave, you could create a new Trigger that does exactly that. Now all you have to do is reference that trigger in the SETUP Waves trigger. You would do this by setting the variable Wave_End_Trigger[Wave_Level] to be equal to your Gold trigger. Now, when that specific Wave ends, the Gold trigger will run. That being said, I'd reserve the Start/End triggers for things that aren't common. If you ALWAYS add Gold at the end of a Wave then it'd probably make more sense to create a new variable array like Wave_Gold_Reward[] and incorporate that into the system.

This type of design should be used whenever possible since it will save you hours of work in the long run and will make your map 100x more organized. It's also very efficient and will help with map performance.

If you end up wanting to use it let me know, I can help you integrate it into your map.
 

Attachments

  • Tower Defense Design 1.w3m
    43.4 KB · Views: 37
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
Wow, i'm stunned. I was expecting some useful hints but you guys really took a lot of time to help me! Thank you all! I will use all that information and i hope i am capable of making a good map so you can maybe play with me one day ;) it will take some time, because now i have much to read and learn but i will not abandon my ideas of this map :)

Edit: Now after some hours of work, the map seems to work. Even poison arrow and multishot work now :) I even added a blink that only works in your area. in singleplayer everything runs fine, BUT if i play online with other players everyone gets his spawn except player 1 (red), i looked through the triggers but cant find anything wrong.
Someone got an idea?
It's so close of running perfectly! When it's done, i can add more waves and abilities and complete the map.
 

Attachments

  • CustomTowerTD_Testphase.w3m
    104.6 KB · Views: 33
Last edited:
Level 13
Joined
Jul 12, 2018
Messages
510
I had a quick look, since you're using Uncle's system i'll leave it up to him to counsel you on it, he seems to know a lot more than me anyway. just wanted to say you dont have to put my name on the loadscreen, that's not proportional to the time i spent. i appreciate it but i'm just paying forward because i was helped many times by this forum when i was stuck on my own map. I think you'll find over time that 99% of the work is done by yourself and you can put everyone else somewhere in the quest log. Probably for Uncle it makes sense in this case since he did a whole system. Good luck with future development!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
Wow, i'm stunned. I was expecting some useful hints but you guys really took a lot of time to help me! Thank you all! I will use all that information and i hope i am capable of making a good map so you can maybe play with me one day ;) it will take some time, because now i have much to read and learn but i will not abandon my ideas of this map :)

Edit: Now after some hours of work, the map seems to work. Even poison arrow and multishot work now :) I even added a blink that only works in your area. in singleplayer everything runs fine, BUT if i play online with other players everyone gets his spawn except player 1 (red), i looked through the triggers but cant find anything wrong.
Someone got an idea?
It's so close of running perfectly! When it's done, i can add more waves and abilities and complete the map.
I'm taking a look at it now, I'll let you know when I find the problem :)

Edit:
So I went through and fixed up any issues I could find. You did a great job though, pretty much everything was imported correctly.

The two key issues that I fixed:
- You were setting the Player_Area variables to the wrong regions
- You forgot the Spawn Classification ability

Some other issues:
- I was already reducing the Lives of the players when an enemy reached the end, but I saw that you added an Action that dealt 1.00 damage to the Lives building as well. That would result in the player losing an extra life, so I changed it to deal 0.00 damage instead. This way you still get the "Our town is under attack" alert message (I assume this is what you wanted) but the Lives are being removed through my original method.

- I made it so that when a Tower loses an Item, if it's still carrying another Item of the same type then it WON'T lose it's Item Ability. Because before if a Tower had let's say 2 Damage Aura Items, and you removed 1 of them, it would lose the Damage Aura ability, even though it still had a Damage Aura Item equipped afterwards.

- I fixed some typos and other grammatical mistakes, I hope you don't mind :p

I didn't test it in multiplayer but it SHOULD work.
 

Attachments

  • CustomTowerTD_Testphase U1.w3m
    107.2 KB · Views: 25
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
And thanks again :D the 1 damage to the building was only to make visible how many lives you still have :) didn't see the base lose hp when a creep enters the end area. but that was maybe because i set the player areas wrong? :)
I wasn't even aware that a tower loses an ability when it gets 2 items of the same type ^^° and sorry for the typos and grammatical mistakes, english isn't my first language ;)
I will take a look at the changes and test the map :) see you later!

New Edit:

So i added some new Waves, Abilties and Items and tested everything in singleplayer --> Everything fine! BUT again in multiplayer Reds Spawns seem to bug out at one point. I tested 2 games, in the first my spawn ended on wave 6 and creeps stayed at move point 2. then i decided to add my old triggers from the fist version just to see what happens then. Next online game, my Waves worked well until wave 7 ^^ they stopped at movepoint 1 and no new wave spawned for me also. I deleted my old triggers, but i have no idea what to do now >.<
im sorry, but i need your help again uncle
 

Attachments

  • CustomTowerTD_Testphase U1.1.w3m
    112.6 KB · Views: 30
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
Okay, I found the bug, it was happening when a Player was defeated. I fixed it and everything should work now.

I also tried to fix some minor things again.

- Made your Flying waves have Flying Movement (this fixes their height issue)

- Added a trigger that prevents friendly fire so you can't attack allies

- Made it so that unused players don't have a base/builder (might only work in multiplayer)

- Made a single Lives building for each player instead of having 6 different versions of the same thing

Note that you may want to set Computer Players 12 - 17 back to None in the Scenario Properties. Giving them Computer control may cause their AI to kick in and break things.
Also, I'm spawning units for players 12 - 24. I probably don't need to separate the spawns between 12 different players but better safe than sorry.
 

Attachments

  • CustomTowerTD_Testphase U1.1 BUG 1.w3m
    112.7 KB · Views: 39
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
Heyhey :) so i used Uncles Bugfix version and tadaaa everything works out fine!!! I made some fine tuning with the movement points, so that all waves will walk straight lines instead of curvy or or diagonal :) i added more waves (there are 52 now), items and abilities, towers and a new shop :) i tried to add a loading screen (it worked somehow but it got extremely ugly but i will keep it^^) and a minimap image but that didnt work.
I tested it online with some ppl, everything great too except for classic users. they cant see some of the models. I've seen in the map "circle td trollforged" that at start you can choose what graphics you use, so that everyone can see everything, but i think thats some kind of high-end-mapping ;)
I'm thinking about one or two more tower types, with useable spells, like blizzard and rain of fire, but im not sure if people would like that. First its time to test the map balance now and play it a little :D
Again a huge THANK YOU to Uncle, i perpetuated you in the map as level 51 (Kings 'Uncle') and as additional Author, because you did so much great work :) i hope that is okay for you!
 

Attachments

  • CustomTowerTD_Testphase U2.w3m
    387.9 KB · Views: 28

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
I'm glad to hear it's working properly. I think for the sd/hd graphics issues you could use the Skin system that was introduced. I haven't really messed with it though so unfortunately it's foreign to me.

And thanks for the credit, I don't mind at all ;)
 
Level 4
Joined
Jan 2, 2021
Messages
20
So the balancing is in progress, for now it's a bit easy in lategame but that can be changed :) at the moment i'm working on some upgradable items. I had in mind, if an unit acquires a second aura-item of same level (2x speed aura lvl 1 for example) they get removed and the unit acquires a new item (speed aura lvl 2).
Edit: It works now, instad of buying the same item twice i just added some "upgrade gems" to the trigger will work now :)

  • ArmorReduceLevel2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Corruptive Gem
      • ((Triggering unit) has an item of type Armor Reduce Aura - Level 1) Equal to Wahr
    • Actions
      • Item - Remove (Item carried by (Triggering unit) of type Armor Reduce Aura - Level 1)
      • Item - Remove (Item carried by (Triggering unit) of type Corruptive Gem)
      • Hero - Create Armor Reduce Aura - Level 2 and give it to (Triggering unit)
      • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Triggering player)).) the text: Aura upgraded!

Edit: I also changed some models and icons, now it's all visible in both, Classic and Reforged :)
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
If you don't want to use the Corruptive Gem method:
  • Upgrade Item Example
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Damage Aura (Level 1)
    • Actions
      • Set VariableSet ItemCount = 0
      • Set VariableSet ItemType = (Item-type of (Item being manipulated))
      • -------- --------
      • -------- Find out how many of these Items the unit is carrying: --------
      • For each (Integer ItemLoop) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot ItemLoop)) Equal to ItemType
            • Then - Actions
              • Set VariableSet ItemCount = (ItemCount + 1)
            • Else - Actions
      • -------- --------
      • -------- Create the upgraded Item: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemCount Greater than or equal to 2
        • Then - Actions
          • Item - Remove (Item being manipulated)
          • Item - Remove (Item carried by (Triggering unit) of type ItemType)
          • Hero - Create Damage Aura (Level 2) and give it to (Triggering unit)
          • Unit - Add Damage Aura (Level 2) to (Triggering unit)
        • Else - Actions
Variables used:
ItemCount = Integer
ItemLoop = Integer
ItemType = Item-Type

You could even combine that trigger with the original Acquire Item trigger to make things a bit more efficient. So if ItemCount is less than 2 it would run the standard Actions for acquiring that Item.
 
Level 12
Joined
Feb 5, 2018
Messages
521
Hey, I was testing your map a bit and it's actually pretty good and had some fun with it. :)

Some ideas and other notes:
-Make wave timers and game start timer (I made them for myself while testing your map to keep track of wave times) :p
-Poison arrows don't work with multishot (this would be epic if they stacked)
-The unused player slots should have their builder and villages removed just to prevent confusion
-Maybe later you could add multiboard, which shows units killed, lives remaining and stuff like that
-For later another idea, add team mode and other modes, like chaos mode (random events, unit spawns)

Anyways, pretty damn good job! The map runs super smooth and didn't run into any issues while playing.
 
Level 4
Joined
Jan 2, 2021
Messages
20
Hey hey!
Thanks again Uncle :D i still don't know how to add variables properly, like you did in the Variables folder. that's why i have to use so many triggers ^^° but after some testruns, i think the idea with gems is better, because otherwise you could grade up the auras for a very low price, what could them make very very strong in early game. the price of gems is adjustable :D

@DoomBlade
I'm very happy to hear that you liked the map :D but you have to thank Uncle too, because he did very much for the smooth running ;) my first versions were horrible, with stuck units and other problems.
Your ideas are great but they need a lot of knowledge in the WorldEditor. Maybe at least you can write your trigger here for the wave timer? :) i can add them to map, or you can do that by yourself if you want.
I see my map as "OpenSource" so anybody can change/add something or give ideas and help :) anyone will be named ingame in the map! :D

Here my latest version with some balancings and new items, spells and other stuff :)
 

Attachments

  • CustomTowerTD_Testphase U2.2.w3m
    403 KB · Views: 28
Level 12
Joined
Feb 5, 2018
Messages
521
  • SETUP Game
    • Events
      • Time - Elapsed game time is 1.00 seconds
      • -------- Here we can start our first wave. After this the system will handle spawning units for the rest of the game: --------
      • -------- I added timer here to see when the game actually starts --------
      • Countdown Timer - Start Start_Timer as a One-shot timer that will expire in 20.00 seconds
      • Countdown Timer - Create a timer window for Start_Timer with title Game Starts in:
      • Set VariableSet Start_TimerWindow = (Last created timer window)
      • Wait 20.00 seconds
      • -------- Here the game starts and the timerwindow must be destroyed --------
      • Countdown Timer - Pause Start_Timer
      • Custom script: call DestroyTimer (udg_Start_Timer)
      • Countdown Timer - Hide Start_TimerWindow
      • Countdown Timer - Destroy Start_TimerWindow
      • Trigger - Run Start Next Wave <gen> (ignoring conditions)

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Wave_Count[(Wave_Level + 1)] Not equal to 0
    • Then - Actions
      • -------- Begin the next wave after a delay: --------
      • Countdown Timer - Start SpawnStart_Timer as a One-shot timer that will expire in Wave_Start_Delay[Wave_Level] seconds
      • -------- Added Timer Window here --------
      • Countdown Timer - Create a timer window for SpawnStart_Timer with title Next Wave in:
      • Set VariableSet Wave_TimerWindow = (Last created timer window)
      • -------- --------
      • -------- If you have set Wave_EndText for this Level then a message will be displayed: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_End_Text[Wave_Level] Not equal to (null)
        • Then - Actions
          • Game - Display to (All players) for Wave_Text_Duration seconds the text: Wave_End_Text[Wave_Level]
        • Else - Actions
      • -------- --------
      • -------- If you have set Wave_EndTrigger for this Level then that trigger will run: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_End_Trigger[Wave_Level] Not equal to Wave_End_Trigger[0]
        • Then - Actions
          • Trigger - Run Wave_End_Trigger[Wave_Level] (ignoring conditions)
        • Else - Actions
    • Else - Actions
      • -------- There are no more waves, from here you could begin preparing the players for the end of the game --------
      • -------- But this doesn't mean that all of the Waves are dead, this just means that the final wave has finished spawning. --------
      • Game - Display to (All players) for 30.00 seconds the text: |cffff0000ALERT |r-...

  • Start Next Wave
    • Events
      • Time - SpawnStart_Timer expires
    • Conditions
    • Actions
      • -------- Destroy Timer Window Here --------
      • Countdown Timer - Destroy Wave_TimerWindow
      • -------- This is a new wave so we want to reset the counter which keeps track of how many units we have spawned so far: --------
      • Set VariableSet Spawn_Count = 0
      • -------- --------
      • -------- Then we want to increase the Wave Level, which will change the values of our other Wave Variables: --------
      • Set VariableSet Wave_Level = (Wave_Level + 1)
      • -------- --------
      • -------- If you have set Wave_StartText for this Level then a message will be displayed: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Start_Text[Wave_Level] Not equal to (null)
        • Then - Actions
          • Game - Display to (All players) for Wave_Text_Duration seconds the text: Wave_Start_Text[Wave_Level]
        • Else - Actions
      • -------- --------
      • -------- If you have set Wave_StartTrigger for this Level then that trigger will run: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Start_Trigger[Wave_Level] Not equal to Wave_Start_Trigger[0]
        • Then - Actions
          • Trigger - Run Wave_Start_Trigger[Wave_Level] (ignoring conditions)
        • Else - Actions
      • -------- --------
      • -------- Then start a repeating timer which will spawn units every X seconds: --------
      • Countdown Timer - Start Spawn_Timer as a Repeating timer that will expire in Wave_Interval[Wave_Level] seconds

I added comments so you can see where I added the timers. It was pretty simple to include them into Uncles system. :)

New Variables
Start_Timer (Timer)
Start_TimerWindow (Timer Window)
Wave_TimerWindow (Timer Window)
 
Level 4
Joined
Jan 2, 2021
Messages
20
Hey good morning, wow thank you :) I implemented that into the Maps System! I slowly understand how that variables work and how to create and work with them :) It's looking great, now i will take a look if i can create a Multiboard which shows actual Wave and player kills + lives. Help would be appreciated, since this is a bit more complicated.
I also added camera commands from ap0calypse's system! :D you can zoom in and out now
 

Attachments

  • CustomTowerTD_Testphase U2.3.w3m
    405.3 KB · Views: 26
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
Edit: Added a new beatiful Loading Screen!

So i got the Multiboard to work but as soon as i kill an enemy unit, my name is replaced by killcount ^^

  • SETUP Game
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Player_Colors[1] = |cffff0000
      • Set VariableSet Player_Colors[2] = |cff0000ff
      • Set VariableSet Player_Colors[3] = |cff00ffff
      • Set VariableSet Player_Colors[4] = |cff6f2583
      • Set VariableSet Player_Colors[5] = |cffffff00
      • Set VariableSet Player_Colors[6] = |cffd45e19
  • Create Multiboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Player_Count = (Number of players in (All players controlled by a User player))
      • Multiboard - Create a multiboard with 3 columns and (Player_Count + 1) rows, titled Custom Tower TD.
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Player
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Kills
      • For each (Integer A) from 1 to (Player_Count + 1), do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 2.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 8.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 2.00% of the total screen width
      • Set VariableSet List = 2
      • Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)).) and do (Actions)
        • Loop - Actions
          • Set VariableSet Multiboard_Spots[(Player number of (Picked player))] = List
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row List to (Player_Colors[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row List to 0
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNVillagerMan1.blp
          • Set VariableSet List = (List + 1)
      • Multiboard - Show (Last created multiboard)
And
  • Kills Update
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Killing unit)) controller) Equal to User
    • Actions
      • Set VariableSet Kill_Count[(Player number of (Owner of (Killing unit)))] = (Kill_Count[(Player number of (Owner of (Killing unit)))] + 1)
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Kill_Count[(Player number of (Owner of (Killing unit)))]))
Added Variables:
Player_Colors - String Array - Size: 1
Kill_Count - Integer Array - Size: 1
List - Integer
Multiboard_Spots - Integer Array - Size: 1

Those are the triggers, can anyone see a mistake?
Made with this Tutorial
 

Attachments

  • CustomTowerTD_Testphase U3.2.w3m
    1 MB · Views: 25
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
Heyhey
@Uncle i think i would like to use your item-trigger in the map too :) i thought of some reciepes, for example if you buy the Immolation item + the phoenix item, both get removed (including spells) and instead you get a better item with a more powerful ability =) in this case maybe an infernal or something like that :D

Another idea was to make a different map design, where all lines come together on one city instead of everyone has his own little village. and every player defends a different part of the city and if a player loses all his lifes, his part of the city starts to burn and the message appears (for example if the south player lost) "The southern district is plundered and set on fire!" or something similar :)
But that only for some future-thoughts ^^ atm i still need to fix the balancing and the multiboard issue.

Have a nice evening!

Edit: Hey i just found my mistake in the multiboard trigger... oh god, in the kills update trigger i set column 2 instead of 3, that was all xD silly me
 
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
So, the reciepes are now in the map :)

But, new idea - new problem:
I wanted to add a "Wave:" row to the multiboard, which shows the actual wave. I tried to add the wave_level value to the row as a string. I don't know if that is the correct way. Can show string the value of an integer variable?
Here is the trigger:
  • Create Multiboard
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Player_Count = (Number of players in (All players controlled by a User player))
      • Multiboard - Create a multiboard with 3 columns and (Player_Count + 2) rows, titled Custom Tower TD.
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Player
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Kills
      • For each (Integer A) from 1 to (Player_Count + 1), do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Show icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 2.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 8.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 2.00% of the total screen width
      • Set VariableSet List = 2
      • Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)).) and do (Actions)
        • Loop - Actions
          • Set VariableSet Multiboard_Spots[(Player number of (Picked player))] = List
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNVillagerMan1.blp
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row List to (Player_Colors[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row List to 0
          • Set VariableSet List = (List + 1)
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row (List + 1) to Wave:
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row (List + 1) to 0
      • Multiboard - Show (Last created multiboard)
And here is the wave update Trigger. I am sure that this one is completely wrong ^^

  • Wave Update
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row (List + 1) to (String(Wave_Level))
Can someone please help?

I created a new Post in "Triggers & Scripts". Edited the Question to the Spoiler.
 

Attachments

  • CustomTowerTD_Testphase U4.w3m
    1 MB · Views: 23
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
You did it correctly, since Strings can only be text you have to use the Convert To function in order to get them to work -> convert integer to string, convert real to string, etc.

Your Wave Update trigger doesn't make sense, I believe it's because you're confusing your Events.

Elapsed game time is 1.00 seconds <--- This Event happens once 1.00 second of overall game time has passed, and that's it. This doesn't run every 1.00 second, you'd want to use a PERIODIC Event for that.

But forget all that, having a periodic timer that constantly updates the Multiboard is inefficient and unnecessary. All you need to do is update the Multiboard right after the Wave_Level variable is increased. This is done inside of the Start Next Wave trigger.

I attached an updated version of the map. I went through all of your triggers and fixed any issues I could find.
 

Attachments

  • CustomTowerTD_Testphase U5.w3m
    1 MB · Views: 26
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
Thank you very much Uncle :) i made a quick testrun, the multiboard is so beautiful! last hope works but doesn't disappear and the mana urn doesn't explode, but thats not a real problem :D i think i can fix that by myself :) but not today anymore, it's late already and i need to go to bed ^^ but i will have a closer look.
I also have a newer version with more reciepes and the reciepe shop got a workover too :) you will hear from me, and thank you again! you do a great job!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
I forgot to change the Ability on the Lives building in the Object Edtior. It should be using Last Hope (Lives) not Last Hope (Dummy). I updated my map file above with the fix.

I also had to modify the Last Hope trigger slightly, you want to remove the ability as one of the last things you do.
 
Last edited:
Level 4
Joined
Jan 2, 2021
Messages
20
Hey again! Thank you so much Uncle :) if i could, i would give you 100 reputation points for your help :D i added my new stuff to your latest version and everything works super fine!
I think the map is finished now and ready to play :D I will put my idea with a new map design on ice for now and if the map is liked and played by others, some day I will create a version 2.0 with the city in the center :)
For now, it's time to play!

Here the latest version
 

Attachments

  • CustomTowerTD_1.0.w3m
    1 MB · Views: 28

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
I just wanted to comment that there was a minor oversight in the system.

In the Player Defeat trigger you may want to delete this Action:
  • Hashtable - Clear all child hashtables of child PN in Spawn_Hashtable.
Things will break if you clear the Hashtable while there's still spawned units active in that player's base, or really anything that interacts with the Hashtable for that player.

All the Action does is free up some memory by clearing the "unused" data in the Hashtable. Problem is, that data may still be used for a little while after the player leaves so you don't want to clear it right away. It's okay to never clear it either, I doubt it would even make a noticeable performance difference.
 
Status
Not open for further replies.
Top