Rename attributes via right-click

Silux

  • Posts: 438
I'm used to code what i need, but i love stencyl option to snap blocks together.The only down-side is that i can't rename attributes or delete them(easily doable in code-mode).
 
However i got the habit to edit many times my 'x' and 'y' attributes first time to make me work faster (small words) and second time to have a more plain and intuitive names, so that other can easily understood what i did without redundant comments.

That would be a small improvement ,but i'd love that!

« Last Edit: November 13, 2011, 01:07:23 pm by Silux »
Currently working at:
Starwarrior 2097(my main project)
How to make successful games in Kongregate and the world(article)

coleislazy

  • *
  • Posts: 2607
You can both rename and delete attributes. There should be a button next to the name field when you are on the attributes page to apply the new name. It requires the behavior be refreshed, but it changes all instances in the behavior.

Silux

  • Posts: 438
o.o
Never noticed these two buttons, and i used that panel a lot!

I was thinking also about something like right-click->edit
Currently working at:
Starwarrior 2097(my main project)
How to make successful games in Kongregate and the world(article)

Jon

  • *
  • Posts: 17524
Being able to edit it directly from the table makes more sense.

captaincomic

  • *
  • Posts: 6108
Hello!
I'm new, so the first thing I wanted to say is: Stencyl is great :)

I can rename attributes just fine, but it would be also nice to change the type of an attribute after it was created. I often forget to set the type correctly and accidentally create an Actor attribute. Then I have to delete it and create it with the correct type again.

Btw. when I right click on an attribute in the attribute tab I see a context menu with only one item "Edit Attribute" but this one doesn't do anything...

Jon

  • *
  • Posts: 17524
One of the reasons why we don't do that is that it would lead to some issues with attribute you've already got in your behavior and lead to breaking in it that's more difficult to track down.

For example, if you've got an actor attribute and then switch it to a number attribute - what happens to all the cases where you're using that attribute already?

I think that one solution would be to improve the way you create attributes in the first place perhaps. Instead of bringing up a full dialog, do it through a popup menu where you just select the type (this seems less prone to error because you're picking the type first and not reflexively entering the name and forgetting to pick the type). Then that prompts you for a name (or auto-assigns it to a default name).

captaincomic

  • *
  • Posts: 6108
Okay, I see.

One way it could work is to delete all blocks of the attribute when you change the type. This also kind of happens when you copy blocks from one behavior to another, then all blocks that reference an attribute just get deleted (because the attribute probably doesn't exist in the other behavior).

And if you have chosen the wrong type then usually you havn't used the attribute anyway, so nothing would get deleted.

Silux

  • Posts: 438
One of the reasons why we don't do that is that it would lead to some issues with attribute you've already got in your behavior and lead to breaking in it that's more difficult to track down.

For example, if you've got an actor attribute and then switch it to a number attribute - what happens to all the cases where you're using that attribute already?

I think that one solution would be to improve the way you create attributes in the first place perhaps. Instead of bringing up a full dialog, do it through a popup menu where you just select the type (this seems less prone to error because you're picking the type first and not reflexively entering the name and forgetting to pick the type). Then that prompts you for a name (or auto-assigns it to a default name).
scope->type->name
That's how works in java
Agreed that type is the first thing to ask!
Currently working at:
Starwarrior 2097(my main project)
How to make successful games in Kongregate and the world(article)