Making units into Buildings (Tower Defense Project)

DMTucker

New Member
Reaction score
0
A friend and me are working on making a classic WC3 styled Tower Defense game, and we've run into troubles since most of the towers we planned on using were based on units, and we can't find out how to make them into static structures. I'm asking here since we've had absolutely no luck with any tutorial videos or the Blizzard FAQ forums. A Speedy answer is rpefered as we're on a bit of a timeline. Thanks for any advice you can give me.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Welcome to Thehelper!

In Starcraft 2, structures are units.

As long as they don't have the move ability they should be static. You might also want to make sure to set the "Movement: Pathing Footprint" to something like "Footprint 3x3" to make sure it gets placed correctly when you build it. That should be all required to turn it into a real building(although I might've forgot something)

You could also take a default building(the photon cannon for example) and duplicate it(Ctrl + U) and make sure to check the actor with the same name as the building as well. Now you'll have a 2x2 building that you can use for your tower defense.
 

Dave312

Censored for your safe viewing
Reaction score
269
You might also want to check Structure under the Unit: Attributes + property on the unit. It isn't critical but will most likely solve a couple of issue that will arise down the track.
 

DMTucker

New Member
Reaction score
0
I appologize for the delay with updating, but I'd like to thank you both for helping with the issue. We've got units training as buildings now but so far there have been a couple noted effects we are still looking into fixing.
-Queen, Spore, and Spine towers will not build unless they're on creep. My coder tried deleting the property requiring them to be built on creep, but it still doesn't work, and these units do not appear in the building menu.
-Despite setting a new range value for Zealots, they are still melee only, and will only engage units that bump directly into their model, even when the range on their weapon has a number increment instead of the Melee title.

I feel bad just coming here practically begging for help, but we're behind on a strict deadline on this project and we're both still rather new to the system. Any assistance on these and future questions will be greatly appreciated.
 

DMTucker

New Member
Reaction score
0
The -other- major thing we need to look into is custom status effects. Some towers will have poison, some stun, some acid that deals armor reduction. If anyone knows a map we can look at to get an idea for the coding inside of them or an actual understanding of how to impliment such features, I'd be greatly indebted to you.
 

Dave312

Censored for your safe viewing
Reaction score
269
-Queen, Spore, and Spine towers will not build unless they're on creep. My coder tried deleting the property requiring them to be built on creep, but it still doesn't work,
To make a building able to be built not on creep, you need to edit the Behaviour: Behaviours property on the unit and delete On Creep and Zerg - Building not on Creep. Then go to the Movement: Pathing Footprint and Movement: Pathing Footprint - Placement and them to their "Non Creep" versions (e.g. Footprint 3x3 (Creep + Contour) becomes Footprint 3x3 (Contour) and Footprint 3x3 (Creep) becomes Footprint 3x3)

... and these units do not appear in the building menu.
Quite possibly because they haven't been add to the builders command card (Ability: Command Card + property on the unit).

-Despite setting a new range value for Zealots, they are still melee only, and will only engage units that bump directly into their model, even when the range on their weapon has a number increment instead of the Melee title.
I can change the range by modifying the Stats: Range property on the Weapon object (Zealot - Psi Blades in this case) and this works fine for me...

The -other- major thing we need to look into is custom status effects. Some towers will have poison, some stun, some acid that deals armor reduction. If anyone knows a map we can look at to get an idea for the coding inside of them or an actual understanding of how to impliment such features, I'd be greatly indebted to you.

I would be using Behaviours to apply the desired effect in the same way that the Marauder applies a slow effect when he attacks. You could also give the tower an aura to apply the desired effect (still uses behaviours. We have a tutorial on auras here.
 

DMTucker

New Member
Reaction score
0
Hate Necroing a thread but I figure since it's mine it's fine. We've gotten most of the facotrs working (though he only figured out how to implement slow, how kind of gave up after that). I have some other questions for finishing our project:
-How do we make unit models that are bigger than 1x1 fit into 1x1 areas? We have medium and large units that wont fit through the maze if the player only leaves 1 tile between his towers in each row.
-How can we set a research button that, when researched, will unlock a higher tier of towers? How do we lock certain towers to certain 'Tier' researches?
-Much as hes given up, I still want to implement a poison, acid and stun tower (Acid reduces armor). What values will he have to edit to make those kinds of abilities?

We've got a couple more weeks to complete this project. I don't expect it to be amazing but anything is something at this point.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I'll do a kind of brief explanation that you can try out for yourself. If it isn't enough, I'll provide more information.

1. Should be the Movement: Radius field of the unit. Lower it and see if it helps.

2. Go to the upgrade tab in the data editor, create a new upgrade for your tier and a button for the upgrade as well. Create a new ability of the "Research" type and set it up so it can research your upgrade(modify the Ability: Info field and make sure the default button and upgrade is set correctly in there). Go to the unit that is supposed to research the upgrade, add the research ability you made. Go into the command card and add a new button for your upgrade and make it of the ability command type and set it to your research ability.

Now what you've done is to create a way for a player to receive your upgrade. Now you just have to restrict some towers until the player researches the upgrade. Go to the requirement tab. Create a new requirement(Call it "Tier 2" or something). Enter the : Requirement + field. Basically, there's two categories. Show and Use. If the ability with this requirement doesn't fulfill the requirement you enter in Use, it'll be grayed out. If it doesn't fulfill the requirements you enter in Show, it wont show up at all. Add a requirement node at use(right click use and select "Add requirement node"). Set the type to "Count Upgrade", set the alias to your upgrade that you created earlier, set the state to completed. You might also want to set the tooltip to something like: "Research tier 2 to unlock this tower". This is the text that will be displayed in red when you hover over the disabled button.

Finally, go to the ability that you're using to build towers. It should be in the ability tab and it should be of the "Build" type. Go into the Ability: Info + field and open the tower you want to restrict to a certain tier. See the list with big green icons? It should be under "Info - Button - Requirements". Each icon is a requirement. Search for your requirement and select it. That should be it.

If you have several tiers, you could go into your research ability and add the requirement for tier 2 to the tier 3 research so you can't research tier 3 before tier 2.

3. Basically, towers have weapons, weapons use effects that deal damage. Effects can do other things as well, such as giving units buffs. Here's what you do for poison, acid and stun. Basically, all of those are negative debuffs(buffs are a kind of behavior, so make sure you open that tab). Create a behavior called "Stun"(You could probably use one of the existing stun behaviors, but I'll explain how to do one, just in case the other ones doesn't work). Open the Behavior: Modification + field, go to the behavior tab, scroll down to "Modify flags". Check "Disable abilities", "suppress movement" and "suppress turning". Press okay. Set the duration to the stun duration.

For acid, do another behavior and in the Behavior: Modification + field go to the Unit tab. Scroll down to Life armor bonus and set it to something like "-5" to reduce armor by 5.

For poison, I assume you want it to work like: Deals X damage every Y seconds for a total duration of Z seconds. Create a new effect called something like "Poison tower DOT". Make sure it's of the damage type. Set the Combat: Amount to X(the damage dealt each tick). Change Target: Impact Location + to Caster Unit. Go back to the Behavior tab and create a new behavior. Set the Stats: Period to Y(how often it should deal damage) and Stats: Duration to Z(the total duration). Set the Effect: Effect - Periodic to the effect you just created.

Now we want the towers to add these behaviors to the target. Instead of having the towers damage to use an effect to damage the target, we want them to use an effect to damage the unit and apply a behavior. You'll have to do the following once for each of the towers.

Create an "Apply Behavior" effect. Set the Behavior: Behavior to the behavior you want to add.

Create a new Set Effect. It's basically an effect that runs a bunch of effects. In the Effect: Effects + field, add the newly created "Apply behavior" effect as well as your weapon's damage effect(if you don't know which one this is, go to the tower's weapon and see which effect it's using in its Effect: Effect field.)

In the tower's weapon, change the Effect: Effect field to the set effect you created. Do this for all of the weapons and behaviors and you're done.
 

Kyuft

Member
Reaction score
11
If you are still having trouble with the zealot melee attacking, go the the Psi Blade weapons in the Data Editor, and under Stats: Flags uncheck Melee.

-Kyuft:shades:
 

DMTucker

New Member
Reaction score
0
I'll do a kind of brief explanation that you can try out for yourself. If it isn't enough, I'll provide more information.

1. Should be the Movement: Radius field of the unit. Lower it and see if it helps.
Done and worked perfectly. Thanks.

2. Go to the upgrade tab in the data editor, create a new upgrade for your tier and a button for the upgrade as well. Create a new ability of the "Research" type...
Don't know if my programmer did this exactly or not but we got tiers working well enough.

3. Basically, towers have weapons, weapons use effects that deal damage. Effects can do other things as well, such as giving units buffs. Here's what you do for poison, acid and stun. Basically, all of those are negative debuffs(buffs are a kind of behavior, so make sure you open that tab). Create a behavior called "Stun".... Set the duration to the stun duration.
Only issue I had with stun is I have no idea where the Set Duration is for Stun. Another question, is there a way to set % chance of stun? Because it sounds like stun will just hit over and over locking a unit in place.

For acid, do another behavior and in the Behavior: Modification + field go to the Unit tab. Scroll down to Life armor bonus and set it to something like "-5" to reduce armor by 5.
Pretty sure I got acid working, still looking into testing it currently though.

For poison, I assume you want it to work like: Deals X damage every Y seconds for a total duration of Z seconds. Create a new effect called something like "Poison tower DOT". Make sure it's of the damage type. Set the Combat: Amount to X(the damage dealt each tick). Change Target: Impact Location + to Caster Unit. Go back to the Behavior tab and create a new behavior. Set the Stats: Period to Y(how often it should deal damage) and Stats: Duration to Z(the total duration). Set the Effect: Effect - Periodic to the effect you just created.
You lost me at this point. I don't see a Damage Type in its creation. I don't know where Combat: Amount is located and I haven't tried after that point. Perhaps some Screenshots could detail it well enough.

Now we want the towers to add these behaviors to the target. Instead of having the towers damage to use an effect to damage the target, we want them to use an effect to damage the unit and apply a behavior. You'll have to do the following once for each of the towers.

Create an "Apply Behavior" effect. Set the Behavior: Behavior to the behavior you want to add.

Create a new Set Effect. It's basically an effect that runs a bunch of effects. In the Effect: Effects + field, add the newly created "Apply behavior" effect as well as your weapon's damage effect(if you don't know which one this is, go to the tower's weapon and see which effect it's using in its Effect: Effect field.)

In the tower's weapon, change the Effect: Effect field to the set effect you created. Do this for all of the weapons and behaviors and you're done.
While I don't understand any of this, my programmer got Slow to work, so I'm presuming he can get that done without any issues.
Besides these, there haven't been any new issues yet. Hopefully with a little extra insight we should have this ready by next week.
 

Kyuft

Member
Reaction score
11
Only issue I had with stun is I have no idea where the Set Duration is for Stun. Another question, is there a way to set % chance of stun? Because it sounds like stun will just hit over and over locking a unit in place.

Make sure the Stun is a behavior with Behavior Type: Buff. Just set the buff duration for as long as you want the stun to last.

You lost me at this point. I don't see a Damage Type in its creation. I don't know where Combat: Amount is located and I haven't tried after that point. Perhaps some Screenshots could detail it well enough.

Make an effect, in the window where you name the effect, there should be an Effect Type field. Set that to damage.

-Kyuft:shades:
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Only issue I had with stun is I have no idea where the Set Duration is for Stun. Another question, is there a way to set % chance of stun? Because it sounds like stun will just hit over and over locking a unit in place.
For the duration, go into the stun behavior and set Stats: Duration to the duration of the stun.

For the % chance, go to the effect that applies your stun behavior. Set the field Effect: Chance to your percentage. Set it to 0.1 for 10% for example.

You lost me at this point. I don't see a Damage Type in its creation. I don't know where Combat: Amount is located and I haven't tried after that point. Perhaps some Screenshots could detail it well enough.

You want the tower to poison the target. I assume the poison is a DoT(Damage over time) which will deal periodic damage as long as the target is poisoned. First of all you need an effect, so go to the effects tab in the data editor.

When you create the effect(which you could name something like "Poison tower DOT"), make sure you set the Effect type to "Damage"(This is done in the Effect Properties window that appears when you create a new effect)

In this new effect, you'll have a field called Combat: Amount. Set this to the amount you want the poison to deal each time it deals damage(So if the poison should deal 10 damage each second, set it to 10). Next up, find the field called Target: Impact Location + and set it to Caster Unit. You now have a damage effect that will deal the damage for you. The next step is to create the behavior that will use this effect to deal the damage periodically. Go to the behavior tab.

In the behavior tab, create a new behavior. Make sure you set the behavior type(again, in the behavior properties window that appears when you create a new behavior) to Buff(Always set all your behaviors to buff if you don't know what you're doing). Find the field Stats: Period and set it to the time between each damage tick(Again with an example: If you want it to deal 5 damage every 2 seconds, set the Stats: Period to 2).

Now set the Effect: Effect - Periodic to the effect you created earlier(named something like "Poison tower DOT"). This means that each time period, it'll deal this effect.

Finally, set the Stats: Duration field to the total duration of poison. After this period of time, the poison debuff will be removed and the target will stop taking poison damage.

Hopefully with a little extra insight we should have this ready by next week.

Great to hear :)
 

DMTucker

New Member
Reaction score
0
Everythings working as it should. Except for Acid. It does lower Armor by 5, which is what I set it to -but- it's lowering armor by 5 EVERY Attack. How do we set it so it doesn't stack.
Edit: Weird post got screwed up.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
That is weird. By the default, the behavior shouldn't stack. Find the acid behavior that you created and make sure the Stats: Maximum Stack Count is set to 1.
 

DMTucker

New Member
Reaction score
0
I'm finding an odd issue with one of the units. I've scaled all of the enemy units Movement: Radius down to the point where most of them will move through a 1x1 square in the maze, except for the Stone Zealots, and I presume any unit of the Large category. What is causing specifically that unit to still become 'blocked' and start attacking towers despite the fact that it is actually following the path?
 

Dave312

Censored for your safe viewing
Reaction score
269
Have you tried changing the unit's Movement: Inner Radius?
 

MissKerrigan

Active Member
Reaction score
23
If you making a maze for a tower defence, you better can set the radius of the 'creeps' to 0
Cause if you use any slow effect in your game, the creeps won't be able to pass others when using radius for units

If your maze contains a size of a 1x1 path you can set the radius of the creeps to 0.5 still I don't trust the game will run smoothly this way
The way I did it set the radius of creeps to '0.0' and create a region at every corner of the maze and program them to move to the next corner

MissKerrigan
 

DMTucker

New Member
Reaction score
0
If you making a maze for a tower defence, you better can set the radius of the 'creeps' to 0
Cause if you use any slow effect in your game, the creeps won't be able to pass others when using radius for units

If your maze contains a size of a 1x1 path you can set the radius of the creeps to 0.5 still I don't trust the game will run smoothly this way
The way I did it set the radius of creeps to '0.0' and create a region at every corner of the maze and program them to move to the next corner

MissKerrigan

My only issue with this is that units will just stack ontop of each other at this point and make things look incredibly weird. I'm contemplating just leaving a note in the opening that says not to leave 1x1 spaces lol.

Edit: We're also looking to edit our economy system. Currently its 1 mineral per kill based on wave number but with 50 units per wave were finding players make -too- much money too fast. I figured doing it so Every other wave but my programmers having issues with that. The best hes come up with is wave #/2 + 1 which kind of works. I'm just wondering if anyone has a better solution.
 

MissKerrigan

Active Member
Reaction score
23
Well if you give the creeps the same speed, they won't stack at each other

Be more specific about your 1x1 spaces which you not leave

Normally I'm 1 of the best in balancing creep hitpoints/speed, tower damage/attack speed/range/cost, value for creeps/boss
I haven't any clue how you programmed this so I can't tell you about the value of minerals given by creeps when killed them
It really depents on the price of your towers and upgrade how strengt grows

But you spoke about players getting minerals to fast in start so I got a suggestion for you here:

1. start the value of creeps with 5 minerals and 6 in the next wave, 7 after etc...
2. start the value of creeps with 1 mineral, and give it 2 value after a few levels (depending how hard you want to make the map)
3. if suggestion 1 is to slow, you can start wave 1 gives 10 minerals, wave 2 gives 15 minerals, wave 3 gives 20 minerals etc...

But again, I haven't any clue how you programmed your creep strenght/hitpoints, tower damage/cost, creep incoming rate
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top