Stencyl 3.4.0 is now out. Get it now!

Workflow utility engine extension

letmethink

  • *
  • Posts: 2515
Workflow utility
Works on iOS, Android, Flash, Windows and Mac.

This extension is a simple extension which I put together to add a couple of (I think) useful blocks, and to group other blocks together to improve workflow (and to slow the time it takes to change simple blocks).

Features
- Grouped simple mathematical operations
- Grouped numerical comparisons
- Index of item in list
- Random float between two numbers



Get it

- Download this Extension

(How to Install and Update an Extension)


Documentation

This extension currently contains four blocks. You can see the details of what they do below.
----------------------------------------------

Add, subtract, multiply or divide two numbers
This block can be used instead of the current (4 separate) blocks for performing simple mathematical operations.



Inputs
- First number
- Operation (selected from the dropdown)
- Second number

Returns
The result of the operation between the two chosen numbers. This is a numerical value.


Determine the relationship between two numbers
This block can be used instead of the current blocks for comparing two numbers.



Inputs
- First number
- Comparison (selected from the dropdown)
- Second number

Returns
The result of the comparison between the two chosen numbers. This is a boolean


Random float between two numbers
Currently Stencyl only has a block for a random float between 0.0 and 1.0. This block extends that so that any range can be chosen.



Inputs
- First number
- Second number

Returns
A random float between the two chosen numbers.


Index of value in list
Currently Stencyl has a block for returning the index of a value in a string, but none for this with a list. This adds this functionality.



Inputs
- Value. This can be anything
- List. This is a list attribute

Returns
The index of the block. If -1 is output, then the list doesn't contain the value.

----------------------------------------------


Version History

10/31/2015 - Version 0.1 released.
11/31/2015 - Version 0.1.1 released - fixes a bug with '='

« Last Edit: November 01, 2015, 01:51:12 am by letmethink »
~Letmethink

mdotedot

  • *
  • Posts: 1101
Nice LetMeThink!

To be honest : the 0 =,<,> and +/- should be part of Stencyl and not in an extension!

Best regards from
M.E.
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

LIBERADO

  • *
  • Posts: 2014
Thanks, letmethink.

For a faster and more comfortable workflow, I will use this extension in all my games.
I would like this extension was enabled by default every time I create a new game in Stencyl.

To be honest : the 0 =,<,> and +/- should be part of Stencyl
I agree. In fact, I suggested it: http://community.stencyl.com/index.php/topic,43890.msg245872.html#msg245872

« Last Edit: October 31, 2015, 02:22:49 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.

Justin

  • *
  • Posts: 3586
It's easier now than ever to enable an extension without losing a beat, but I can look into having default engine extensions across a workspace. File that as a suggestion and I won't forget!

For Live Support: Join our discord channel and ping me @justin.

letmethink

  • *
  • Posts: 2515
 I'll take suggestions for anything people would like to see for this extension that annoys them about events in Stencyl. (I want to learn more - so feel free to suggest anything that isn't too abstract).
~Letmethink

LIBERADO

  • *
  • Posts: 2014
Every time I see a good suggestion or a small extension as useful as this, I make myself the same question:

If a new feature is...

- Useful to perform easier and faster the more essential and basic tasks in Stencyl.
- Supposedly easy and fast to implement in Stencyl.
- Intuitive and very easy to use.
- Supposedly stable and not prone to future errors.
- Suggested and requested for many Stencyl users.
- It doesn't complicate the use of Stencyl. (this extension even simplifies it by reducing the number of blocks)

Then, why it is not implemented in Stencyl? Honestly, I never knew the answer to this question.

« Last Edit: October 31, 2015, 04:36:01 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.

rrzl

  • Posts: 243
@Liberado
I think its pretty common sense, really. No big mysteries about it.
Most extensions are created by third party, not by Stencyl's Core Developer.
It needs to be maintain always.

If it set as default in Stencyl, when in the future the extension no longer works and breaks Stencyl in the process, and at the same time the one who created it no longer active, who's gonna fix it? Since its already embeded deep into Stencyl, it'll make it even more buggy and unusable. That'll put a lot of unnecessary extra work to the Core Team.

That'll be messy. Its not the way to go. To me, personally, how it works now, is totally fine.

LIBERADO

  • *
  • Posts: 2014
It needs to be maintain always.
I can't imagine what kind of maintenance is required for this simple block: 

when in the future the extension no longer works and breaks Stencyl in the process,
I mean: "Supposedly stable and not prone to future errors.", due to its extreme simplicity.

That'll be messy. Its not the way to go. To me, personally, how it works now, is totally fine.
You can continue disassembling dozens of blocks and reassembling them again every time you need to do something as simple as changing one of the plus or minus signs in the middle of an expression.

However, I think that basic and essentials improvements are always convenient.

« Last Edit: October 31, 2015, 07:37:35 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.

yoplalala

  • *
  • Posts: 1338
I agree with Liberado. I think simple blocks like this should be in the default Stencyl.
(Sounds stupid but that's why in part I didn't do an extension  for the operations block. I really think it should be in the stencyl core and as I'm working it on a long term project, I wouldn't want to have to change the blocks later when Stencyl will have integrated this feature ;)  )
Because most of them ( except maybe the random float) are a simple transcription of a haxe function ( not even openfl),  it will never need to be mantained.

mdotedot

  • *
  • Posts: 1101
A few suggestions to add to the workflow extension:

I use these in my extension blocks :
  • set [ game_attribute] to [ value ] PURPLE   or set public [ ] to [ value ]
      it is still better than the [ set game attribute with name [ ] to [ ] ]
  • get [ game_attribute ]     PURPLE
  • [null]
There is [empty] but that is only for map,lists . When you have a variable like image it is hard to know if it is set or not. Also checking for null rather than the approriate block is empty, has value etc.. is more direct. Granted : you need more programming background to know how use it.

  • [ condintion ] ? [ true ] : [false ] 
when you want to set a value for instance [ set X to [ y = 2 ] ? 3 : 2 ]   Now you need to do this:
if [ y = 2  ]
   set X to 3;
otherwise
   set X to 2;
You could make this block using your own method of combining the condition elements. Not sure if it would need to allow AND , OR since that would make the block harder to make.

  • [] & [] & [] & [] & [] 
  (or mabye more difficult to make:  a [>] icon to click on with the default to automatically add a & [ ] Now you need to copy / paste text )


  • get scale width/height of [Actor]

actor.realScaleX and actor.realScaleY   : to get the scaling width/height after you used the grow block


  • set name from [Actor] to []
  • get actor name of [Actor]
  • get actor by name []
set / get Actor Name  in combination with [  get Actor by name []   ]
 get =  [actor.name] ,  set = [actor.name=“abc”;]   You have get actor type by name but it would be easier to reference a particular actor instead of the [for each type of actor ] block to get just one actor who you know exist only once .

  • DateTools.format(Date.now(),"%Y-%m-%d_%H:%M:%S”)   
Put this in draw block on scene draw event and you see nice clock :D  You can get wild with blocks on this one ) Maybe one for date and one for time and one for both?

A little more obscure  = not needed much and more difficult to maintain:
  • set origin point of animation to [ center, top, etc.. ]

It would be awesome to have these workflow blocks in a default extension or implemented in Stencyl. I have the upmost confidence that the core developers know how to maintain them.

Important:
Maybe the biggest reason not to implement  the [<,>,=]  and [+,- etc.]  : When you click in a block you can change this and lead to logic-bugs that are hard to spot later. So that might be a reason not to change the core-blocks and have them as seperate blocks to be used or not.

Best regards from
M.E.

« Last Edit: November 01, 2015, 01:47:39 am by mdotedot »
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

yoplalala

  • *
  • Posts: 1338
There are a few of your suggestions in here
http://community.stencyl.com/index.php/topic,35612.0.html
(love the scene value trick in this one)
and others in other extension ( like the scale Utils extension) .

mdotedot

  • *
  • Posts: 1101
Ah forget that one. That has the ? : block in it! Thanks for pointing to that yoplalalala
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Jon

  • *
  • Posts: 17497
The main roadblock to introducing a new core block is to make sure we cleanly convert over instances of the old block. In the past, we "deprecated" old blocks by hiding them from the palette but this would lead to a bunch of now-dead blocks that we'd have to continue supporting. Some blocks are up to their 4th revision now.

Having just finished up the blocks guide, documentation also has to be updated in multiple places (it's old screenshots that tend to show their age and become difficult to track). For basic blocks like this, it's not a big deal, but for something slightly more complex, it confuses users if the wording is different or a new field got added.

Nothing here is a big deal, but it's helpful to think about what's involved in replacing an existing block.

I really like the Input/Returns style of documenting the blocks.  We should do this for the blocks guide in the future.

On that note, I'm going to figure out a way to make the extensions repository a bit easier to maintain. It currently requires me to edit the listing each time, when it really ought to be community edited. There have been lots of quality extensions going around lately.

rrzl

  • Posts: 243
I can't imagine what kind of maintenance is required for this simple block: 

@Liberado
I think you misunderstood what I'm trying to say.

What I really meant is, not about this (workflow utility) extension specifically, but more about every extension there is and to answer your question, on why most extension hasn't been implemented into Stencyl as a default.
Jon has probably answer it in a better way.

Basic simple stuff, as its name... is basic. It doesn't need much maintenance, sure.
And I'm sure most who have been using Stencyl for a while, already have created their own method,
custom extension, custom workaround, workflow...etc.
But, don't get me wrong, I'm not against any new additional implementation. Its great for new users and others that only use default blocks exclusively.

LIBERADO

  • *
  • Posts: 2014
There have been lots of quality extensions going around lately.
:) Certainly.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.