• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Tower ability upgrade using upgrade level not working?

Status
Not open for further replies.
Level 2
Joined
Feb 3, 2020
Messages
8
For the tower I have, you research the upgrades from the shop. It works for the basic ones like health/armor/damage etc. Though ability levels seem to be stuck at 1 no matter how many times I click the upgrade. I double-checked to make sure everything is linked up properly and I am pretty sure it is. Does anyone know what would be causing this? I'll include the map in case you want to take a look and see what I mean. I set the gold to 5000 so you can buy any upgrades and levels for testing.

A side question as well if anyone knows an answer to. I altered phoenix fire and made it learned after an upgrade. Though it ignores that and is on the tower by default. I checked and made sure check dependencies is true as well as the proper tech upgrade. This is the only ability it is happening to.
 

Attachments

  • MTD.w3m
    146.2 KB · Views: 21
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
Alright, so I went a little overboard with fixing up your map. I noticed you were fixing some Memory Leaks but not all of them. In a lot of cases you were doing something like:
Set TempPoint1 = Some Region
Set TempPoint01 = Some Region
call RemoveLocation (udg_TempPoint1)

^You were halfway there. You just need to make sure to remove TempPoint01 as well.

Things I added/fixed:

-I deleted about 20 variables/triggers and instead used Arrays to achieve the same effect.
-I cleaned up all of the memory leaks.
-I fixed your Ability Level problem.
-I fixed your Phoenix Fire problem. It's bugged so to fix it I removed the ability from the Tower and instead add it to the Tower when you first Research it.
-I added alternate "Icon versions" to Discharge and Deep Freeze (Phoenix Fire/Slow Aura are hardcoded to not have Icons for some reason).
So these abilities now have 2 versions. One is the Icon version purely for visual purposes and the other is the Effect version that has the actual Damage/Slow stuff.
Not sure if you wanted this but feel free to make the icons hidden again. You can hide ANY ability icon by settings it's Button Position X/Y to 0,-11.
-I fixed a weird issue that Regions have. The regions will be more precise now.
-I added in your Leaderboard. I noticed you were tracking kills incorrectly. You were doing "Set PlayerKills(1) equal to PlayerKills(1 + 1)" instead of "Set PlayerKills(1) equal to PlayerKills(1) + 1
-I added a PlayerBuilder variable and PlayerTower variable so you can track the Tower/Builder at all times. For example: Move "PlayerBuilder[Player number of triggering player]" instantly to center of map.

I hope I didn't over complicate this for you.
Regardless, you can always look at my map as a reference in order to fix problems in your own version.

Edit: I made a mistake with the Research stuff. It would only work for Player 1. I fixed it in this version.
 

Attachments

  • MTD Uncle Edit 2.w3m
    140.3 KB · Views: 17
Last edited:
Level 2
Joined
Feb 3, 2020
Messages
8
Alright, so I went a little overboard with fixing up your map. I noticed you were fixing some Memory Leaks but not all of them. In a lot of cases you were doing something like:
Set TempPoint1 = Some Region
Set TempPoint01 = Some Region
call RemoveLocation (udg_TempPoint1)

^You were halfway there. You just need to make sure to remove TempPoint01 as well.

Things I added/fixed:

-I deleted about 20 variables/triggers and instead used Arrays to achieve the same effect.
-I cleaned up all of the memory leaks.
-I fixed your Ability Level problem.
-I fixed your Phoenix Fire problem.
-I added alternate "Icon versions" to Discharge and Deep Freeze (Phoenix Fire/Slow Aura are hardcoded to not have Icons for some reason).
So these abilities now have 2 versions. One is the Icon version purely for visual purposes and the other is the Effect version that has the actual Damage/Slow stuff.
Not sure if you wanted this but feel free to make the icons hidden again. You can hide ANY ability icon by settings it's Button Position X/Y to 0,-11.
-I fixed a weird issue that Regions have. The regions will be more precise now.
-I added your Leaderboard in. I noticed you were accidentally tracking kills incorrectly. You were doing "Set PlayerKills(1) equal to PlayerKills(1 + 1)" instead of "Set PlayerKills(1) equal to PlayerKills(1) + 1
-I added a PlayerBuilder variable and PlayerTower variable so you can track the Tower/Builder at all times. For example: Move "PlayerBuilder[Player number of triggering player]" instantly to center of map.

I hope I didn't over complicate this for you.
Regardless, you can always look at my map as a frame of reference in order to fix problems in your own version.

Thank you so much, this is exactly what I was looking for. This is my first map so I am still learning things. If I make more abilities do I need to add them to the triggers you made to allow them to scale properly? I figured all the variables I made were over kill and there must have been an easier way lol.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
Thank you so much, this is exactly what I was looking for. This is my first map so I am still learning things. If I make more abilities do I need to add them to the triggers you made to allow them to scale properly? I figured all the variables I made were over kill and there must have been an easier way lol.
You're welcome! I recommend re-downloading the map as I have fixed some minor things, especially if you have v.1. And yes, for most new Research abilities you can just copy and paste the "Magefire Research" trigger and adjust the variables, replacing the Magefire Ability/Research with your new Ability/Research.

Note that those Research triggers aren't all exactly the same because I had to make adjustments for the Abilities that had missing icons (Deep Freeze/Discharge) and even more adjustments for Discharge because of that annoying bug it had that made it ignore Research requirements.

So basically when adding new Abilities you'll do 1 of 3:
(In most cases #1)

1) If your new ability has an icon and works as intended then base it off of the Magefire Research trigger.

2) If your new ability is missing an Icon like Deep Freeze then create an Icon version of it and base it off of the Deep Freeze Research trigger.

3) If your new ability is missing an Icon and is bugged like Discharge then create an Icon version of it and base it off of the Discharge Research trigger.

I suppose there could be a 4th case in which the Ability is bugged but ISN'T missing an icon. But I think Deep Freeze/Discharge are rare cases and there won't be any more abilities with issues like them.

If you have any more questions feel free to ask.
 
Last edited:
Level 2
Joined
Feb 3, 2020
Messages
8
You're welcome! I recommend re-downloading the map as I have fixed some minor things, especially if you have v.1. And yes, for most new Research abilities you can just copy and paste the "Magefire Research" trigger and adjust the variables, replacing the Magefire Ability/Research with your new Ability/Research.

Note that those Research triggers aren't all exactly the same because I had to make adjustments for the Abilities that had missing icons (Deep Freeze/Discharge) and even more adjustments for Discharge because of that annoying bug it had that made it ignore Research requirements.

So basically when adding new Abilities you'll do 1 of 3:
(In most cases #1)

1) If your new ability has an icon and works as intended then base it off of the Magefire Research trigger.

2) If your new ability is missing an Icon like Deep Freeze then create an Icon version of it and base it off of the Deep Freeze Research trigger.

3) If your new ability is missing an Icon and is bugged like Discharge then create an Icon version of it and base it off of the Discharge Research trigger.

I suppose there could be a 4th case in which the Ability is bugged but ISN'T missing an icon. But I think Deep Freeze/Discharge are rare cases and there won't be any more abilities with issues like them.

If you have any more questions feel free to ask.

I have a few but I don't want to be annoying haha. For a victory trigger I tried making one so that once the final bosses are killed, 2 in this case spawn, it would trigger the victory screen. Another one that might not be as easy would be for units to continue hitting the barricade even if shot by the tower. I have them taunt and have them casting it every 0.01s but I don' think that's working. It is based off the NE giant taunt ability in the default section. Is it possible to have an ability auto-target a unit when used? For the Second Chance heal, you have to use it then click the tower which if it's almost dead you might miss or hit a barricade etc. Another thing despawning all enemies on a player's island if they are defeated/leave. I have it working for destroying their builder/tower/upgrade center as well as having no further units spawn. Though the ones that killed them remain in the middle. I'll upload the map again as I have been working on it more and changed some things. Thank you for helping, I have been using google to try and find some of these answers but with little luck at times.
 

Attachments

  • Mystical Tower Defense.w3m
    184.1 KB · Views: 16
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
Alright, I think I covered everything.

1. Adjusted Builder/Buildings to have a Art - Animation - Cast Backswing/Cast Point of 0.00.
This will make them cast abilities instantly rather than after a small animation delay.
You can right click these values and click reset if you don't want this change.

2. I'm sure you noticed that I changed "Destroy Barricade" to an ability rather than a trainable-Unit.
Was there any reason you wanted it to be a Unit? I only changed it because it's slightly better for
performance to use an Ability rather than training/removing a Unit. You can revert this back to normal if you'd like or I can do it for you.

3. In about 90% of cases you want to use "A unit starts the effect of an ability" as your Event
for casting spells. I noticed in your Second Chance trigger you used "A unit finishes casting an ability".
Starts the effect happens the exact moment the ability goes off and mana is spent/cooldown starts. It
also allows you to get all of the needed information like "Target unit of ability being cast" or
"Target point of ability being cast". Another thing, avoid using "Begins casting an ability" as this can be abused by the Player by cancelling the order (issuing a "Stop" command). The trigger will go off but the ability will not spend mana/go on cooldown. Begins casting an ability should be reserved for situations where the casting unit dies or something so it can't abuse it.

4. You can't use Waits in a "Pick every unit" Action. So in your Leaver trigger I deleted the Wait.
Also, you were removing the PlayerBuilder and PlayerShop inside the "Pick every unit" when those
would've already been removed seeing as how they're considered a "Unit owned by triggering player".
If you want the Wait for a visual effect (units disappearing 1 by 1) I could come up with a little
system for you to do it effectively.

5. I removed the color codes from the Ability Names but not the Tooltips. The name is only visible
in the Editor so this makes it easier to read. (I wish I had done this before, lol)

6. I believe I fixed the issue where the Computer would ignore Barricades and attack the Tower. I gave the Barricades an Attack that deals 0-0 damage. This will provoke the enemies to attack them.

7. Added in the Owlkin Victory stuff.

Notes:
Check your Computer Unit's Armor Types. I think I may have accidentally changed one or two while trying to find a solution to #6.

Also, I didn't add an attack to Ice Chunk Barrier as it looked like you wanted that one to have a special attack. Were you having trouble getting that to work?

Some ideas I can add:
I can make Second Chance work without Mana. It might open up the possibility to use Mana for other things on your Builder.

I can make the Enemy Waves split up more so some run up the left ramp and some the right ramp.
 

Attachments

  • Mystical Tower Defense U1.w3m
    185.2 KB · Views: 16
Last edited:
Level 2
Joined
Feb 3, 2020
Messages
8
Thank you again for your help, I appreciate it and it helps me learn some stuff from what you did. I had it as a unit because I was following a tutorial for a basic tower defense and in the tutorial, the guy used a unit to do the destroy, so I ended up doing that too. Yeah haha well that was me trying to do what you did but it wasn't working so I just scrapped it and disabled the attack. I was thinking about having more abilities for the builder but I stumped myself because I had the heal going off mana. So that might be a good change as well. Splitting the units would also be a good idea so like 1 doesn't go left and the rest right etc. Yeah, the color codes were delaying me a lot until I saw you can add an editors note with the ability name which made it easier searching for them. I noticed when someone leaves or is defeated the default messages pop up like Name has been defeated, seems to make making a custom message not necessary. Is there a way to remove the default one or should I just remove the ones I made?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
I'm not entirely sure how it works but I see there's two messages in the Defeat trigger. Maybe make the Defeat message blank and keep the Display Text Message the same.
  • Game - Defeat (Owner of (Triggering unit)) with the message: |cffff00ffY|r|cfff5...
  • Game - Display to (All players) for 5.00 seconds the text: ((Name of (Triggering player)) + |cff00ffffhas been defeated!|r)
What did you want the Ice Chunk Barrier to do? I can add it in real quick.
 
Level 2
Joined
Feb 3, 2020
Messages
8
Those messages are two different ones, one for everyone to see and the other is for what shows when you click quit campaign or w/e. I was trying to make it do what you did to the others, 0-0 damage with bounce so it aggroed units to hit it first.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
Another question. I noticed your Wave Units like the Acolyte deal 2-1 damage. Any reason why it's not set to 2-2? Or did you want it to be 1-2?

Edit:
Uploaded a new version. Added the splitting up and second chance stuff. I was a bit lazy with the splitting up effect, it's just random at the moment. Each unit that spawns will either go left or right.
 

Attachments

  • Mystical Tower Defense U2.w3m
    186.7 KB · Views: 12
Last edited:
Level 2
Joined
Feb 3, 2020
Messages
8
That's fine, you've already helped me so much haha. Well, I was trying to get them to do say 1-1 and removed the dice roll and put 1 dice side. It came out as 2-1 for some reason I didn't figure out how to get them to do only a certain amount.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
Set the Number of Dice and Sides per Die to 1. Then Set the Base damage to be 1 less than what you want. So for the acolyte if you wanted it to deal 1-1:

Base Damage = 0
Sides per Die: 1
Number of Dice: 1

If you wanted a unit to deal 10-10 dmg:
Base Dmg = 9
Sides per Die: 1
Number of Dice: 1

You'll notice that I made the Barricades deal 0-0 dmg. This is done by setting the Base Dmg to -1.

Shift-click a field in the editor to apply negative values, but make sure that this setting is enabled first under File/Preferences/General -> Allow negative real values.
 
Last edited:
Level 2
Joined
Feb 3, 2020
Messages
8
Ahh ok so that's how you do it then, going to change all of them now. Thanks for pointing that out to me, I thought 1 is 1 not 0 is 1 lol.
 
Status
Not open for further replies.
Top