View Full Version : Tower Defense Help!
Ok, So I found one of your Tutorials and i followed them and instead of have one set of Regions i made two. so you will need to check out the triggers to see what I mean.. But the problem is after 30 seconds when the first wave should come my Warcraft 3 freezes.. Alls im asking is if some experienced coder could fix my error(s) (Cause I dont know where they are) Thankyou...
PS: I also dont know how to altler the Map to just start out with 1 unit and no building + 150 Gold and 150 Lumber
I hope you guys can help i am really hoping you guys can figure out where I went wrong! :-\
Thankyou
hooded
07-20-2007, 12:10 PM
first thing is to seperate your movement triggers. Right now, you have people entering a region, and being ordered to move to two different regions at the same time. Make sure you only have one region in the event and one region in the actions. Next, the units should not "move instantly", instead use the unit-order-issue order targeting a point action. Set the point to the center of the next region. Try these things out and see how it works.
For your second part, just pre-place the units you want to start with, and remove the melee triggers. Then use the triggers under player - set property to set the resources of a player with a trigger that has "on map initialization" for its event.
Ok, I used the Move to thingy and now they move.. YEAAA!!
But I have 4 or 5 problems
Problem List:
1. When I try to build a Tower the healt stops at 50 and the Peasent Quits Buildin?!?!?
2. I need a countdown timer that starts off at the beggingin for 30 seconds and counts down to 0.
3. When the Footmen reach the end nothing happens (No Defeat).
4. When footmen reach the bottom it only shows -1 Lives left, instead of he real ammount?!?!?
5. After we figure all that out I would like to create a second Wave. with a 30 second timer after the first wave. (But this is later)
Thankyou!
edwinfong25
07-20-2007, 8:19 PM
Ok, I used the Move to thingy and now they move.. YEAAA!!
But I have 4 or 5 problems
Problem List:
1. When I try to build a Tower the healt stops at 50 and the Peasent Quits Buildin?!?!?
2. I need a countdown timer that starts off at the beggingin for 30 seconds and counts down to 0.
3. When the Footmen reach the end nothing happens (No Defeat).
4. When footmen reach the bottom it only shows -1 Lives left, instead of he real ammount?!?!?
5. After we figure all that out I would like to create a second Wave. with a 30 second timer after the first wave. (But this is later)
Thankyou!
ok, just to say... there are actually a couple of other problems in the map...
lets see... to answer your questions first
1. That occurs because you are using the human build style... the way to fix that is to add the repair ability to the builder (the human one should work fine, unless you want to edit some stuff)
2. well, if you need one then you should make one...
but i'll explain that as well:
First off, you'll need to create a variable for the Countdown Timer, and another for its window
then in the triggers all you have to do is use the action 'Countdown Timer - Create a timer window for <Countdown Timer> with title <Title>' to create the window for the timer
then use 'Countdown Timer - Start <Countdown Timer> as a One-shot timer that will expire in <time> seconds' to start the timer
and then use either:
'Countdown Timer - Show <Countdown Timer Window> for Player 1 (Red)'
- OR -
'Countdown Timer - Show <Countdown Timer Window>'
(keeping in mind that you can't do that in a trigger that runs using the event 'Map Initialization')
3 & 4. The reason that nothing happens (in terms of defeat) is as a result of two things...
first in number 4, technically, the way that you had set up the trigger... that would occur every time... cuz you had the action as 'Set Lives = -1'
thus, no matter what happens it would become the exact value of "-1"
the way to fix this would be to change it to 'Set Lives = (Lives - 1)'
thus, it would take the current value of the variable, and lower it by one, and then set it back to the variable, effectively becoming the new variable
now for 3, there are a couple of flaws... the first being that the lives always became -1 instantly... but, also... the way that you set up the trigger
you have as an action:
'If (Lives Less than or equal to 0) then do (Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Remove (Picked unit) from the game)) else do (Game - Defeat Player 1 (Red) with the message: <Empty String>)'
this essentially works out as saying...
value of Lives is less than or equal to zero, pick every unit and remove it from the game (this is logical, and works out fine)
but then you have as an else function, which works out as saying:
value of Lives is greater than zero (negation of the condition), defeat player... (obviously not what you'd want to happen)
* remember, the else occurs if (and only if) the conditions presented come out as false
so... to fix that is quite simple...
basically you'd just put the player defeating function, into the Then actions with the other things
(i'd recommend that you use 'If/Then/Else (multiple functions)' for that)
5. well, like you said, this would come later...
but just to say... there are numerous ways to do this... such as making separate triggers that would run every time a certain elapsed time had occurred, or making a timer for each level, or re-using the timer, but having something in each trigger that would check what level it's up to... (and so on...)
also, some things that you should think about...
one, those triggers that check when the units enter the region... they dont check if its not the builder... (the end one does... but not the ones that direct the creeps through the course...)
also, you should make it such that the towers can't be built onto the path
and also perhaps that the creeps can't leave the path... (although that shouldn't be a problem as long as nothing can block the path)
hopefully that helps :)
(if you have any further questions, don't hesitate to ask ;)
hooded
07-20-2007, 8:38 PM
1. Change the peasant's ability from repair to repair (human). Make sure the tower's construction times are low enough to build quickly.
2. Use the timer triggers. I see you have a variable called "timer". Now create a trigger somthing like this:
events - time elapsed is .01 seconds
conditions - none
actions -
countdown timer - create timer window for Timer with title "next wave in:"
countdown timer - show Last Created Timer Window
countdown timer - start Timer as a repeating timer that will expire in 30 seconds
3. Your defeat trigger works, but doesnt have an event. For an event try time-periodic event - every 0.5 seconds. Also make sure the 2nd half of the if thing (the else half) is "do nothing", otherwise you will be defeated quite quickly.
4. You have lives set to go down to -1 automatically. On the life lost trigger make sure the action isnt set lives to -1, but rather, set lives = lives - 1
5. The "nicest" way of doing this is to use the timer you already have and to use an array to store which unit is for which wave, but thats a little complex for now. If you want to try that, keep reading, otherwise, just use time elapsed equal to 60 seconds, rather than 30.
first things first...open up the variable window again, and create a new variable, of type "unit type" (ill call it spawnType for now), now click on the array box, and set the size to the number of waves you want. Now create a new integer variable, ill call it waveNumber for now. Next create a new trigger, with map initialization as the event. Use the set variable action to set your spawnType variable. It will be a little different than usual, in this case, set the index to the wave number, and the unit to whatever unit is in that wave. For example: set spawnType[1] = footman, spawnType[2] = rifleman. Go to your existing spawn triggers, ill type out what one would look like, and you can do the other one (the only difference is which region the units spawn in).
Wave 1
Events - timer (your timer variable) expires.
conditions - none
actions - set waveNumber = waveNumber + 1
unit - create 20 spawnType[waveNumber] for player 12 (brown) at center of Spawn region facing 0 degrees.
this way, you will create 20 of whatever the spawnUnit is at the wave number, every 30 seconds.
Edit: Sorry if this is redundant, I typed this before I could see Edwin's Post. I guess im a slow typer:P.
edwinfong25
07-20-2007, 9:29 PM
actually hooded, i was the one who typed really slow, lol :)
(i started typing before you even came online, lol, and i happened to see that you were on, lol, so i went ahead and sped up my typing, lol)
also, the defeat trigger actually was run through another trigger (the lives one) ;)
Yeaa!! We have made progress...
Ok look at this now.. You can get defeated when you run outta lives :).
But the problem is with the waves... ...they dont work like i want them too..
and I need someone to do the variables for me and repost the map here. i am good (Kinda) with the triggers. but when I try to make those triggers for the waves I get lost. (sorry if im repetitive) Also I want there to be just one timer that reset right after all the units hit the End Region. Not every 60 seconds.. :confused:
then after we get all this sorted out we make a real (working) wave 2
The map is getting there.. Attached below!
(The Sell Tower Button Doesnt Show Up. (I dont know what I did wrong))
Edited: Reuploaded map now you cant build where the Enemies travel and I outlined it for some cooler detail! + Now all 3 towers can tech!
WarInSerbia
07-21-2007, 6:18 AM
Maybe one of my test TD maps will help you.Do you want to see them?
Sure, But I would still like help from the 2 guys that helped me before! :)
WarInSerbia
07-21-2007, 12:27 PM
So,the first one is the TD I started to make.It could help you with the spawnings and ending the waves.
The second one is my old and the first TD I made.Realy its only the basics,but still could help. :D
The second file is 461 kb so its below.
Thankyou so much, but where is the 460 kb file i only see a 57 kb one.. :D
I really appreciate this.
WarInSerbia
07-21-2007, 12:50 PM
The other one is somewhere in epicwar.com search with the name Dalaran Defence
I am gunna stick with the help i get from hooded cause i dont wanna copy any of your code. and mine is different from yours soo Please Help Me Hooded!
Here is my lastest Version Attached below!
Fixed List:
Teching.
Lives Left.
I dont remmeber the rest ;)
hooded
07-21-2007, 4:32 PM
see the attached map. I created triggers for how to have more than 1 wave, in the method i explained in my post. If you want to change the waves, just change the wave setup variables. I also corrected your selling ability (created a new, and added a victory trigger (make sure if you change/add more waves you also look at the victory trigger, because right now, it victories you if youre still around after lvl 5).
If you have any questions, or if I left somthing out, post back here.
Ok, Thankyou so very much!!!!!!
I added 1 more level to it.. and of course i beat it :D
Then the victory worked.. :D
Then I lost once.. and the defeat worked.. :D
Then I upgraded (Teched) and it worked.. :D
Then I got money for all the kills.. :D
SO0o0o0o0o0o....
Only 1 problem that I know of..
at the end when you have victory... ...It keeps trying to spawn and say "Started Spawing ()" (or something like that) and it keeps repeating it..
Scratch that.. 2 problems when I played for the 8th time the Sell Tower Button doesnt work.. (It might on the other towers but I only used Guard Towers)
Will you please see why you cant sell your towers?!?!
I really appreciate all this help.. :rolleyes: Here is my extra modified version of the game.. please use this one to check on the Sell tower and Spawning (at the victory) problems..
Thankyou,
Joey
hooded
07-22-2007, 1:52 AM
i combined the spawn trigger with the victory trigger, you should take a look. Also, my bad on the selling thing, it was a simple field in the object editor called "visible" on the sell ability I should have remembered to turn on. seemed to work when I fixed it, but I havnt done too much testing...
Ok, I know how to make more levels and now there are 11 levels and 1 boss..
The only problem is the regions.. if the builder steps on one it takes him away just like the enemy..
I was working on the map Looks a little so if your gunna try to see if that can be fixed here is the newer version attached below...
Thankyou :D
Looky at map now.. :) I got a Shack and you can harvest lumber to buy a doom tower!!
edwinfong25
07-22-2007, 7:56 PM
yeah, i had mentioned that in my earlier post, lol :)
(but i guess that no one noticed it, lol)
basically just add a condition (like the one that is at the end regions)
as a matter of fact, you could just copy and paste the condition from the end region triggers into the movement triggers ;)
mind you, i haven't checked your latest map and stuff yet... so i'll have to look it over to be certain that you haven't changed it already, lol :)
Ok, Ill get around to that when i get to my other computer.. :D im on my big computer now... Btw how many levels of TD should it have?!
Hey Hooded The Problem is Posted Above!
WarInSerbia
07-23-2007, 6:49 AM
Btw how many levels of TD should it have?!
You mean waves?
Min:30-40
Max:60-99999999
ok, Hooded.. Im waiting for you show me how to stop the region problems so i can start adding new features.. :)
here is the link to the map u need to modify
http://www.warboards.org/attachment.php?attachmentid=8005&d=1185166503
hooded
07-23-2007, 10:46 PM
i dont think i need to modify the map, its pretty simple. Just add the following condition to each of the movement triggers:
player comparison - owner of <entering unit> equal to <player 12 (brown)
this ensures that the trigger will only run if the entering unit is controlled by player 12.
Like edwin said on a previous post, if you have difficulty finding this condition, you already used it on your loose life trigger -- you can copy and paste it from there.
Ok, Thats done.
My new problem is I made upgrades for the Library and whenever I buy them I think they work but for u to see the damage of the towers go up you need to build a new tower.?!?!? Kinda confusin.. I have been doing this map all night.. there are now 30 something Waves.
Plenty Of Wood....
and Speed, Range, and Attack upgrades.
can u please take a look and see if I did the Upgrades right?!
Then that should be it.. :) Wooohoo!! My First Tower Defence Map that is 1 Player! :D
so...
Problem(s):
I dont know If I did the Speed, Attack and Range Upgrades Propperly!
Blacker
07-29-2007, 6:59 AM
Please,can you 'excatly' tell me the problem,i can't understand! :(
but have no time to test map....
Well. I buy an upgrade at the library and it doesnt show up on the tower until i build a new one!?! Could someone please take a look at my custom upgrades and see what i did wrong?!
Blacker
07-30-2007, 3:19 AM
Look at WE in Object Editor.Find type of tower which you want to upgrade,go under option '''upgrades used''' and that should be all!
yes I know that! but i doesnt seem to add the upgrade propperly!?
Is the unit/building affected by this upgrade in it's settings (tech' tree) inside the Object Editor? And was this upgrade properly inserted into that race's tech' tree? :confused:
Blacker
08-03-2007, 5:17 AM
Upload your map,plz/
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.