Page 2 of 3

Re: Tower Defense Full Version!

PostPosted: Wed May 12, 2010 7:02 pm
by grimlog
I really love this game. I am looking through the .ged file and I am trying to find the path the creeps take every time the level begins. I wan to change the path, but I cannot seem to find the script that handles the path following or is something else going on to which I am completely oblivious too. Which is a great possibility 8)
How do I adjust the creep health, speed?
Thank you for your time and answers.

Re: Tower Defense Full Version!

PostPosted: Wed May 12, 2010 7:24 pm
by grimlog
Okay, found it. It is in the control script, where the case changes and then there is the turn x turn y for each difficulty level, to achieve those coordinates, did you first draw the path over the path object, then enter those into the script or does game-editior automate that by the path finder? I ask becuase when i click on the path menu in GE, I find no existing path.

Re: Tower Defense Full Version!

PostPosted: Wed May 12, 2010 10:20 pm
by DST
No, i made those paths by hand (programmed the numbers in ).

In retrospect, a level editor would be a better way to do it.

In my newer games, my pathfinding works like this:

All squares start as 0.
The start of the path is square 1.
The next block is square 2, then square 3, and so forth. Turns do not have to be labelled as turns anymore.

All the way up to the final block, at which the creep returns to square 1.

In this way, keep the creep looking for the largest block it can find; at any given point, that will be the next one, whether it is in front or turns.

You can even split paths using this method, where say at block 10, we split into two, so there are 2 block 11's. Program the creep to pick one randomly whenever it finds two of the same number.

So the left path goes from 11-20, but the right path is shorter, say, 11-18. The block that joins the paths again will be block 21, so no matter which path you came from, it's still the highest number.

And as well, you can then program a 'threat' option in the tower targeting, where they pick the creep with the highest 'mysquare', the block the creep has determined itself to be in. This would be the creep closest to the finish.

Re: Tower Defense Full Version!

PostPosted: Thu May 13, 2010 2:03 pm
by grimlog
Yes, that sounds amazing, would really open the dynamics of game play. I was thinking of adding a firing mechanism to the creeps along with health meters to the towers. I was also thinking of adding some traps for the creeps to walk over, but are manually set off for interactivity. The control script is the script to change creep health, speed and such? I suppose I just change the variable value?
Are the laser beams drawn by the script or are they animated? How can they be altered?

Again, thank you for such an education and uploading the files, this helps tremendously in my learning curve. :mrgreen:

Re: Tower Defense Full Version!

PostPosted: Thu May 13, 2010 7:07 pm
by DST
The lasers are drawn by canvas; with series of semi-transparent lines.

So make another array, and in this one, you can store the trap value of the cell;

In the creep script, have two values: mycell, their current cell, and prevcell, the last cell they were in. So then a creep looks at the other array(s) only if the two do not match; then at the end of its draw frame, set prevcell to mycell;

So now the creep will take trap damage, or terrain speed adjustments, only once upon entering the cell.

Re: Tower Defense Full Version!

PostPosted: Fri May 14, 2010 1:21 pm
by grimlog
is that what the laser1 and laser 2 region frame type things are for? I have made the paths different from the defaults with my own artwork, and I have made the towers themselves 20x20 instead of 32x32, in the draw actor script is specified 20 20 as well, but now it seems not to place my towers flush with the path. Do I need to readjust some grids, my prefs are ste now for a 20x20 grid. but still no flush placing, I know I am missing something. My path is independent of the bg picture, it overlays perfectly with it. Is there a path size call out in the script I am not finding?

Re: Tower Defense Full Version!

PostPosted: Fri May 14, 2010 2:06 pm
by DST
The laser 1 and laser 2 are canvas actors, they draw the lasers and health bars.

If you look in the tower>draw actor, you can see the lines that say:

x=(round(xmouse/32)*32)+16;
y=(round(ymouse/32)*32)+16;

this snaps it to 32 x 32. To snap to 20, the code would be
x=(round(xmouse/20)*20)+10; //snap to 20 and then offset by 10 (because actors' xy is their center).
y=(round(ymouse/20)*20)+10;

However, you also need to change the size of the tower arrays, because the tile number is 300, but you need a much bigger grid than that. 24 across by 24 down, (and no longer including the menu). So that's 576 for the tower arrays.

Re: Tower Defense Full Version!

PostPosted: Sun May 16, 2010 9:23 pm
by sonicfire
Simply amazing ... tried it and am now playing it for 2 hours already :D Excellent job!!

Re: Tower Defense Full Version!

PostPosted: Sun May 16, 2010 10:16 pm
by DST
:D thanks!

Re: Tower Defense Full Version!

PostPosted: Sun May 16, 2010 11:04 pm
by sonicfire
sonicfire wrote:Simply amazing ... tried it and am now playing it for 2 hours already :D Excellent job!!


...5 hours and counting :lol:

Re: Tower Defense Full Version!

PostPosted: Mon May 17, 2010 2:11 pm
by Hblade
This is very nice! :D thanks :3

Re: Tower Defense Full Version!

PostPosted: Mon May 17, 2010 2:24 pm
by Hblade
This game has inspired me to make an adventure type TD game... Where there is a story :o Thanks DST :3

80000+

PostPosted: Mon May 17, 2010 3:51 pm
by Hblade
hey look :3 round 2 pwnt
pwnage.JPG

pwnage2.JPG

lol.. Just thought I'd share that >.>

Look at the damage on this lazer xD
trtrhtrhtrh.JPG

I'ma firen mah lazar!

yeah its 32,000+ now :3 It's gonna continue to get higher too xD



Edit again 41,000+

Edit again...
64,000+ damage per frame... no boss alive can beat that xD
125,000+
244,000+ damage per frame
478,049 damage per frame is the highest I can get it xD
scrensafafadfg.JPG



Heres one with over 2,600,000 damage per hit...
26mill.JPG


xD :D Fun... but now it got boring for a while lol

Re: Tower Defense Full Version!

PostPosted: Tue Nov 30, 2010 4:02 pm
by foleyjo
Hi

I was wondering if you could give me a bit of advice.

This is a great game but I've been looking through the code and there's one thing that I can't figure out.

How are you creating the lasers and health bars.

I found something that suggested they are done by using canvases laser 1 and laser 2. However they all seem to work independent of each other which I thought wasn't possible

Re: Tower Defense Full Version!

PostPosted: Sun Apr 01, 2012 2:59 am
by friedfish
is DST still active? or anyone that know the workings of the game... I'm trying to find how he did the health bars found on the head of the creeps and i wanna see how he is doing it but i can't seem to find it... i dont know if posting here is ok but if anyone knows it would be great... thank you so much!... :)