Stencyl 3.4.0 is now out. Get it now!

WIP – A Tower Defense Tutorial for Stencyl 2.0

publysher

  • Posts: 41
The trick is in the last step: you're saying atan2[dy][dy] instead of atan2[dy][dx]


scjohnson243

  • Posts: 6
I changed it this morning, same thing happens - I think something is wrong with my "Target" if I take out both of the top "If" and the first line is set DX and set DY the bullet spawns, but still just sits there, never moving.

The only other thing i see different is on my SHOOT TARGETS IN RANGE Behavior



Where I have "Make self shoot target" I have to break that up in two lines, I didn't have one specific line like it shows in the tutorial....

Could these be linked?

publysher

  • Posts: 41
In your block "make [self] shoot [target]" your second line is "make [last created actor] shoot [target]" – this should be "make [last created actor] shoot [target] and apply [...] damage". The former block is part of the tower behavior, the latter block is part of the bullet behavior.

In other words, your tower never calls your bullet behavior.

scjohnson243

  • Posts: 6
I *DIDNT* have that block - but when I just went back and looked I saw I had it now... I guess it got created when I did my flying bullet logic?

Now I get bullets flying and hitting the targets, although sometimes they get "Stuck" on the target till it moves again with a min distance of 1.....

Moving on to the next tutorial and probably having more questions! :) Thanks again.

« Last Edit: May 23, 2012, 06:39:03 am by scjohnson243 »

publysher

  • Posts: 41
Yeah, after creating new blocks it often helps to press reload (cmd-R) to see them showing up.

As for the getting 'stuck' – this is a matter of finetuning speed and minimum distance. In my experience, increasing the minimum distance is the easiest option and if your speed is high enough, no-one will notice :)

scjohnson243

  • Posts: 6
Last part of this tutorial and Just when I think I'm starting to get things figured, something stumps me.

in the following screenshot, how do you get Current health for [Best Target So Far]?

my Attribute Best Target So far is a blue block(not green) and in the green box the only thing I can tell that shows up are:
Last created actor
last collided actor
choose attribute

and the only one of those that show up is a green "Actor" attribute... I can go into it and add another attribute of "actor" type ?

Is that what needs to be done?  It would make sense, since I am looking to return an actor, right?


Xietao

  • Posts: 725
Choose Attribute -> And then Select "Best Target so Far"
Note: Have you read the Stencylpedia?

« Last Edit: May 23, 2012, 10:27:23 am by Xietao »
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

scjohnson243

  • Posts: 6
Only one showing up is "Actor".

Do I need to create an actor attribute?



I created BTSF just to test to see if it WOULD show up there...  it does. :)

here is what I have defined, I have tried with the HIDDEN flag on and off on best target so far


« Last Edit: May 23, 2012, 10:27:02 am by scjohnson243 »

Xietao

  • Posts: 725
Really you need a Actor Attribute
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

Daedalon

  • Posts: 7
First I'd like to thank Publysher for the tutorial. It makes for an excellent Crash Course 3 and I really value the time you've put into this.

To offer my meager help for polishing this up, I'll list below the small ways of improvement that I noticed.

Part 1: "If the speed in the vertical direction (the y-direction) is negative, our actor is moving to the right." I believe the last word should be up, not right.

Part 2: I remember there was something small like in the first chapter, but have forgotten it while I worked my way through to chapter six and can't recall it anymore. I'll let you know if I remember it on a later reading.

Part 4: In "we can see a red dot and a green dot at screen coordinates (6,5) and (16,3)" the last coordinate should be (16,13) instead. "TIP: Every 2D game programmer should at least understand the concepts described above." I'd say understanding these at least on a surface level is most useful. The tip could indicate that it's nothing to be scared of if the reader didn't immediately feel like understanding all the concepts mentioned. It's typical for beginning programmers to learn these as they go.

Part 5: Under subtitle "Pick One", the first image could be better placed after the second paragraph instead of above the first.

The sentence coming after "TIP:" is sometimes written with a capital first letter, sometimes not. It would be the best to have the first letter always capitalized.

There also was an "is" that was written as "it" or the other way around on one chapter, but couldn't find it anymore afterwards.

I would have also welcomed a short explanation of why to use recycling for killing and creating bullets. On the later chapters the text sometimes omitted telling which attributes to create, but it was possible to figure everything out by the very helpful screenshots. Downloading the Action RPG tileset required registering on StencylForge, which some users might not want to do. While it's also good to familiarize the users with using StencylForge to download resources, providing an optional direct download link, if possible, would serve some readers best.

And finally, referring to the following screenshot, I personally changed the two occasions of "0 < 0" to "0 <= 0" when evaluating for Minimum Distance. This seemed to me more like the desired functionality and it makes the function behave usefully even when Minimum Distance is set to 0, returning true when the bullet is in the exact same spot as the enemy.



I hope this was helpful for Publysher and that this tutorial receives the official mantle of Crash Course 3. Can't wait for part 7!

Joe

  • *
  • Posts: 2480
I haven't taken a close look at these yet, but at a cursory glance, they look really good! If we can get these polished up, would you like us to host them on Stencylpedia?

Xietao

  • Posts: 725
publysher, do you check my behavior "Spawns Towers"?
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

Xietao

  • Posts: 725
You taking a lot of time to made the Part 7.
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

publysher

  • Posts: 41
Hi all,

@Daedalon: thanks for your proofreading - I will have a look at all the points you've made and update the tutorials accordingly.

@Xietao: I have looked at your behavior and decided to go for a completely different approach :-) 
Part 7 is 90% finished, and will be put online within the next 48 hours.

@Joe: for the time being I'd prefer them on my blog only, so I can go on improving old episodes - of course, a link on Stencylpedia would be more than welcome.

Xietao

  • Posts: 725
Thanks, it's is long the Part 7? (Complex)
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...