Is there a default null or void type? (SOLVED)

Fool

  • Posts: 88
I have a scene behavior that draws and runs the logic for a global character 'selector.'
It has a couple attributes, Actor Source, and Actor Target.

Whenever a click happens on an actor, the selector checks to see if the source is blank. If it is then it sets the source attribute to the instance of the given actor. If a source is set, then a subsequent click on another actor will set it as the target of
a command.

What I'm struggling with is the check for if source is blank. If no source has previously been set, thats great, we just set the source. But if the source HAS been set, how do I type check that it is an actor? Has the type check been performed for me when detecting the event? The issue arises where the code may detect SOMETHING is set as source, so a following click on another actor sets the given actor as a target, even though it SHOULD have been the source.

And what, if any, default values are built in Stencyl for "null", or "void"?

Edit: Thanks LIberado, that worked. And thanks anyway tigerteeth. If the first method hadn't worked like a charm, I'm sure the second would have.

« Last Edit: March 17, 2016, 10:22:44 pm by Fool »

LIBERADO

  • *
  • Posts: 2720
You can find these blocks under:  Attributes > Functions


Returns true if the given attribute has a value (is not "null").


Disassociates the given attribute from any value. (Sets its value to "null", does not have any effect on primitive types like numbers/booleans)

« Last Edit: January 12, 2016, 08:34:45 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

tigerteeth

  • Posts: 733
If you create a drawing event, and make an actor draw text, and then drag the attribute into the text box, you can make an actor show that attribute at run time (great for debugging).

tigerteeth

  • Posts: 733
From my experience it tends to be "null" rather than "void"