"When this hears" block should not accept sapces

Epic428

  • Posts: 1118
So as to cause less stress/confusion for new users and non-programmers, the "When This Hears" should be set to not accept spaces.

It does throw an error if they are in there, however it would be easier to prevent it the same way that "Tell This To" prevents it.

I don't know if this is a bug or should be a suggestion.
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

Darkhog

  • Posts: 1243
I think we should be able to input spaces in both tell and when this hears blocks. What seems more easy to read: OurPrincessIsInAnotherCastle or Our Princess Is In Another Castle?

Of course I know that these names are used for method names, however I believe spaces should be seamlessly replaced by underscore character on code side.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Epic428

  • Posts: 1118
That would be a sufficient solution as well. My point was that the "Tell this to" and "When this hears" blocks should match in the way they accept spaces to minimize confusion and errors.
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

Joe

  • *
  • Posts: 2480
Good suggestion, Epic. And I agree with darkhog that all spaces could be replaced by underscores internally.

Jon

  • *
  • Posts: 17533
What should we do if the user does something stupid like...

when this hears "I am stupid" and "I_am_stupid"?

Epic428

  • Posts: 1118
Is it possible check the string for any use of underscores and ignore/strip them out when building?
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

Matt_S

  • Posts: 46
Is it possible check the string for any use of underscores and ignore/strip them out when building?
There's then a problem with inputting "Iamstupid" and "I_am_stupid" in two message blocks.

Joe

  • *
  • Posts: 2480
If StencylWorks reported errors more effectively, I'd say it'd be something the user could fix.

For the moment, maybe it'd be best to implement Epic's initial suggestion of disallowing spaces from the "when this hears" block.

Epic428

  • Posts: 1118
Hrmm, it looks better with the spaces but, it is easier to minimize errors by not allowing them.

I only suggested this because with the leniency of SW I find myself adding spaces into a lot of things, most notably Custom blocks and attributes.

Perhaps the most ideal approach would be to develop a way to turn these into another type of Custom Block. I mean they are extremely similar considering that they are both Public Functions.

A good way to do this would be to turn them into Custom Blocks with a field at the beginning that says something like "For [Actor] - Custom Block" Or a way to Make clear the difference from a Standard Custom Block, A Custom Block that targets an actor or scene, and a Global Custom block.

My point is, if we make it so there is no possibility of typing in the wrong text but so that it maintains its current function, then we would have solved the problem.
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

Darkhog

  • Posts: 1243
What should we do if the user does something stupid like...

when this hears "I am stupid" and "I_am_stupid"?

With single underscores on code side should be changed to double underscores and on XML side some field like underscores="yes" to make sure SW won't try to replace them with spaces in block. Anyway I don't think this ever will happen since when user would be able to input spaces he/she will either use underscores or spaces.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Epic428

  • Posts: 1118
Here is an example of what I talked about in my last post and I think this would be great to do.

Under messaging/Custom blocks we can have an option called "Create New Message" This would generate text-like block that would be used only in Messaging blocks. All messages would be shown under Messages -> Receiving. They would be placed in a new subcategory called "Messages"

Then whenever a user places a "When This Hears" block or "tell [whatever] to" block they would place a message block inside it.

I've attached two examples of what it would look like.

It makes it easy to use and it prevents any and all confusion/errors because they would always be the same. I had considered the same possible solution for listing all behaviors in the game so that users did not have to type in the behaviors name and possibly get it wrong, considering the blocks are case/character sensitive.
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

Greg

  • *
  • Posts: 1259
I think the best solution is to just allow spaces.  Then, do field level input checking to strip out the spaces and see if that name has already been used (if so, don't allow it).  Everything behind the scenes would work as if there were no spaces - but the user would still see the spaces. 


Luyren

  • *
  • Posts: 2704
I think the best solution is to just allow spaces.  Then, do field level input checking to strip out the spaces and see if that name has already been used (if so, don't allow it).  Everything behind the scenes would work as if there were no spaces - but the user would still see the spaces. 

I use text attributes inside a when this hears and a tell message blocks for my kit. I agree with any solution as long as I can keep doing that.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Ceric

  • *
  • Posts: 610
I actually like Epic's suggestion, though I was under the impression that some system that would eliminate typing messages was an eventual goal for SW.