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 - LenseOnLife

Pages: 1 ... 7 8 9
Ask a Question / I Think it is a Timing question - Actor Behavior
« on: November 19, 2016, 05:00:01 am »

I've tried to pare everything back to basics to try and work out the proper sequence.

A simple scene with nothing in it called BlueScene.
A single Actor Behavior called DrawShapeBehavior
A Single Actor (not positioned on the scene) called Phantom because it will be invisible i.e. no animation (although I've added an animation for debugging purposes)

BlueScene contains only one event and it is attached called '01 BlueSceneCreation'.

The Phantom actor contains 2 events. A very simple single line debug Create attached as '02 PhantomCreate'; and a timer event attached as '03 PhantomAfterNSecs'.

The DrawShapeBehavior contains 3 events a Created, a Drawing and a timing 'after every N secs'.  However we can ignore all except 'creating' as I seem to have a problem communicating with the behavior.  The 'Created' event is attached as '04 BehaviorCreate' and just contains a single debug statement.

Finally, I have a screen shot of the program running attached as '05 DebugOutput'

It shows that the phantom actor cannot access the behavior even after waiting .1Seconds after being created.  I had a similar program running when I was using a behavior attached to a scene.  Any ideas?



P.S.  Is this the place to post or should I be using CHAT instead?

Ask a Question / Re: Timing regarding creating behaviors
« on: November 19, 2016, 04:32:32 am »
It's OK - I found a post on the chat that said this is the current way of doing it.

Ask a Question / Timing regarding creating behaviors
« on: November 17, 2016, 04:00:16 am »

I have a question regarding timing.  If I attach a scene behavior to a scene and want to setup an attribute of that behavior when the scene loads - when do I do it?  Am presuming that the behavior doesn't get created till after the scene is created so it can't go into that 'when creating' code for the scene.  Currently I'm just using a 'After .1 second' event for the scene but was wondering if there is a more elegant way of doing it?  For example, is it possible to force the creation of the behavior early during the scene creation block?



Hi Justin,

Thanks for that info - much appreciated.

Yes, I am a traditionalist being over 60  :'(

Stencyl is quite interesting, so right now I'm just putting together some video tutorials for young adults and want to try and put Stencyl into perspective in relation to other mainstream programming practices




Just want to get some things straight in my mind regarding Behaviors - attributes in particular.

Am I right in thinking that a Behavior is something akin to Objects in traditional programming which have variables - some internal (local) and some exposed as external.  In Stencyl, the 'Not Hidden' attributes are external only in so far as they can be modified through a menu system when the Behavior is attached to a scene or an actor.

However, programmatically, there is no difference between hidden and not hidden attributes - they can all be accessed through the code block 'for this scene set ...'

Have I got it right?


Ask a Question / Re: Can I pass a 'font' into a behavior?
« on: November 12, 2016, 11:34:53 am »
Hi 'Hectate',

Thanks for the reply.  As I'm putting together a simple tutorial for novices (like myself) explaining unhidden attributes for a behavior, I think I'll steer clear of the Font and just show how numeric/boolean etc attributes can be used to modify the operation of the behavior.

Thanks for going to all that trouble for me - hopefully, someone else will also find it useful.

Cheers for now,


Ask a Question / Can I pass a 'font' into a behavior?
« on: November 12, 2016, 03:39:18 am »

This is my first post so I hope that I'm observing protocol correctly (I did check existing posts but couldn't find an answer to my question) ::)

At the moment I am trying to get my head around behaviors, attributes, hidden/unhidden .....

In the test I have a font called 16ptFont, a behavior called FontBehavior which has a single attribute called MyFont.

Within FontBahavior I want to set the font to whatever Font is in MyFont 'when drawing'.  I presume this attribute should be set from whatever snippet is calling it.  In my case I'm doing it when the scene is created.

My question is - how do I pass the font 16ptFont to the behavior FontBahavior.  I know I can set a value for MyFont when attaching the behavior to the scene - but what I'm trying to do is see can the font be changed for different calls to the behavior - i.e. set it programmatically

I've attached screen shots - at least I THINK they're attached


Pages: 1 ... 7 8 9