Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - publysher

Pages: 1 2 3
1
Shared Resources / Re: WIP – A Tower Defense Tutorial for Stencyl 2.0
« on: August 04, 2012, 04:27:27 am »
It might have been a while, but I promised you a new part would appear. So I'm happy to pronounce part 10, where the player can finally actually win.

By the way, part of the reason this took so long was that I was very busy setting up my own company. At the moment this is eating up a lot of my time, so updates will remain irregular for the time being.

Anyways, Happy Stencyling!

- publysher

2
??? What about this?
I guess hes having troubles with it, has no time or just doesn't wanna do it anymore. :(

Hi guys,

Don't worry too much – the next part _is_ being written and it _will_ appear, but sometimes life gets in the way.

- publysher

3
Sorry for the triple post but, am I the only one that every now and then when I push the create tower button instead of the fan coming out one of the fan buttons replace the create tower button? And at other times the fan just spawns in a really weird shape?

I have noticed this behavior when I set the debugger on high speed; I believe Xietao also mentioned something like that happening on slower computers.

Also my machine gun towers (the red ones) keep shooting even after doing the fix... I uploaded it to the Forge (Tower Defense Game) if you would like to have a look. :)

Have you checked if your Red Tower actor is indeed part of the Towers collision group?

4
Just a question are you gonna code it so the enemies find their own path? Like in those wide open TD levels where you can build towers so it has to go through a path that you create, to slow it down? Just curious. :)

I consider Pathfinding a pretty advanced topic for a tutorial, so I doubt I will do that.

But then again, I'm making this all up as I go along, so who knows :D

- publysher

5
Hi all,

I've fixed the bug noticed by CrimsonThunder and updated part 9 accordingly: the behavior "Player Dies" has been updated to disable more features.

- publysher

6
Did I do something wrong?

Apart from finding bugs in my code, you did nothing wrong ;-)

The Player Finished behavior should also disable the Spawn Enemies and Shoot Bullet behaviors – I will update the tutorial this evening. For now, fixing the bug is left as an exercise :D

7
I've just published part 9 – Staying Alive. Learn how to track the number of lives remaining and show a cool message when the player loses.

Happy Stencyling,
- publisher

8
Hi impatient followers ;-)

I've finished the code and notes for part 9, but I'm having some troubles with the final write-up. So rest assured, it will come.

- publysher

9
But if my actor doesn't exist how come the when mouse is pressed on self works? That is what I want to know, since my own logic tells me if one works, so should the other.

Hi SadiQ,

First of all: good to see you are improving on the tutorial :)

The problem you encountered has to do with the order in which Stencyl initializes its actors. As far as I understand, it works like this:

  • Actor is created
  • Every attached behavior is created and then:
    • The initial attributes are set
    • The events and custom blocks are initialized
    • The "when creating" block is executed
  • For every behavior: the "When [self] is created" blocks are executed


In your case, this means that Stencyl will first initialize the "When mouse enters [resource button]" event, and only then will it call the "when creating" block where [resource button] is created.

In other words, Stencyl tries to reference the "resource button" actor before it has been created. The same holds for your "range_actor".

I think that in this specific case, you have two options:

1. create a specific behavior for your resource button that does the custom drawing on mouse-over.
2. follow coleislazy's advice and use a "when updating" event.

Good luck!
- publysher

10
Hi all,

I seem to have encountered a bug in Stencyl's handling of initial values.

Problem description
Modifying List attributes in a behavior also modifies the initial value – by "initial value" I mean either the  value set as "Default Value" in the behavior, the value set in the when attaching a behavior to an actor, and the value set when customizing an actor.

Reproducing the problem
I have a behavior with a List Attribute. The list attribute has an initial value. When my behavior modifies the value of this list attribute and reloads the scene, the value of the list is NOT restored to its initial value.

Attached you will find a game which shows this behavior and compares it to the behavior of e.g. Text attributes.

Expected behavior
When reloading the scene, I expect the List attribute to be completely restored to its initial value.

Workaround
The workaround is of course to _not_ modify your list attributes, but it's quite annoying.

- publysher

june 10, 2012 Updated the description and reformatted the post

11
Awesome! Just completed tutorial 8 and had no problems what so ever, besides having to double check in your flicker file to make sure I did it properly (so I attatched it here for anyone that wants to see quickly).

Good point, I will add it to the tutorial at my next update.

Just got a few questions. With the score to the right it keeps going to the right instead of going to the left (if that doesn't make sense... I want the initial 0 to be the place that it ends, any extra numbers appear to the right) is that possible? Either way I just set my score to the left part of the screen as that works for now.

Yep, it's quite annoying, I know :)  I will eventually replace the Score Manager by a custom Score Manager that (among others) aligns to the right instead of to the left. So much features I'd like to implement.... :)

Second, with the enemy configuration file you have to fill in everything if you want to use it for a character. I'm assuming you also can't have any content in the original places (eg: in the health manager) if you want it to work because you'll have two conflicting numbers? Would it be possible to add a tick box to make it so that number is used. eg:

Starting Health:
[ x ] - Use this setting
120 Health.

Flicker Count:
[ ] - Use this setting
0 Flickers

If that makes sense? So because the health was ticked it would use that, but wouldn't use the flicker count and instead would use the original one.

Yes, that is possible. However, in the current setup the settings in Enemy Configuration will always override the settings in your other behaviors, so in the end it's quite clear where everything goes (I hope...)

Cheers for a great tutorial so far Publysher, I've learnt so much from it! My favorite part was the GUI how the buttons pan out (even though I spent about 3 hours trying to see why it didn't work... and it was just one little detail that stuffed it up lol) And thanks to all the other users in here helping eachother and myself! This is a great community and Stencyl is a great program to use. :)

You're welcome :) It's really nice to see you all helping each other out.

12
In that case: can you upload your game to StencylForge? I'll have a look at it.

13
But when use you copy code it works great! Why?

Hi Xietao,

If copy works, there must be a tiny difference between your own code and mine – please re-check part 6 where I've added the "Create Custom Blocks" screenshots and check the exact version of your Block Fields.

As for your English: keep reading and posting, it's the best way to learn – that's how I did it :)

- publysher

14
As for that block, I deleted the old one and created a new one, I now don't get the error but no enemies get spawned at all.

Deleting blocks also deletes the original calls to the block – so make sure your "make [self] spawn the enemies defined in [definition]" block still calls the "make [self] spawn enemy of type [type]" block.

15
OK, I found the first problem. Your "make [self] spawn actor of type [type]" states that "Type" is an Actor Type – however, we are giving it Text; the result is that Stencyl tries to convert the text "A" to an actor type, but there is no such actor type.

I have updated part 6 – it now shows the "Create Custom Block" dialogs for every custom block.

- publysher
Awesome. Thanks. :) Is there any way to edit a custom block or do I have to delete and start again?

Yes, editing a custom block is possible, but it's tricky (@Stencyl girls & guys: this should be easier ;-) )

Go to the Palette and click on Custom – there you can see all your custom blocks. Find the block you want to edit and right-click on it. Now you get the option to edit your custom block.

Pages: 1 2 3