"Set Text Attribute To []" doesn't compile

Epic428

  • Posts: 1118
I'm trying to make a behavior for my game that works as a universal text display. This behavior is primarily for the menu system which basically displays text in a message bar when the player hovers over different buttons.

For example hovering over the credits button, it will display "Find out who the coolest Stencyl users, that created this game, are!"

My problem is that for my "Clear Message" custom block, I want the behavior to set a text attribute equal to nothing. But when leaving the Set Text Attribute block empty the game won't compile.

I assume this is a bug considering variables of type String can be equal to ""

i.e.
Code: [Select]
var Text:String = "";
I'm not sure if it would be easier to create a "Clear Text" block, or just allow any block in Stencyl of type text to compile while being empty.

Below is a screen shot of what I want to do in case I didn't make sense.

« Last Edit: March 28, 2011, 05:33:10 pm by Epic428 »
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

Alexin

  • *
  • Posts: 3130
You can't use any drawing blocks anywhere else than the "when drawing..." wrapper.
In this case, you can't use font related blocks in "Display Message:". Use an attribute to store the font or any related info.
"Find the fun"
alexin@stencyl.com

Legendary Hoamaru

  • *
  • Posts: 1088
You can use the other font block, the one that takes an actual selected font or font attribute, outside of drawing blocks.  The "using current font" version relies on the Graphics object, which can only be accessed while drawing.

Epic428

  • Posts: 1118
Ah! Good find! I had completely forgotten about that. It compiled once corrected.

Though, I think one thing that could be fixed, is that the Red "X" is displayed in the empty text fields, when perhaps it shouldn't be displayed at all. I think that could cause confusion for some who may not be familiar with coding, and they may think that they should be placing a block inside it, or some value.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

Alexin

  • *
  • Posts: 3130
Actually, it's exactly what they should do.
"Find the fun"
alexin@stencyl.com

Epic428

  • Posts: 1118
Well, I see that the game will compile with the red "X" still in place, unfortunately, it was the other issues pointed out that kept the game from compiling.

I never really clicked on the "Functions" part of the attributes tab in the palette, so I was completely unaware of the "Clear value of [Attribute]" Block.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

Jon

  • *
  • Posts: 17533
Matt could address this in the future. This falls a suggestion, though.