Request: Game Attribute Extension Blocks

Donni11

  • *
  • Posts: 2181
Hello Stencyl Community,

I'd deeply appreciate if any of the haxe coders could create the following blocks. Really need them in my projects.

Blocks:

1. If (Game attribute) becomes ( true/false)set all game attribute of its category* to ( true/false)
                                                                                                                                       

2. If (Game attribute)  becomes ( true/false)  set all other game attribute  to ( true/false)
       

3. If any game attribute from category becomes   ( true/false)  set all game attribute in  category  to  ( true/false)
                                                                         
4. If any game attribute from category    becomes  ( true/false) set all the other game attribute in that category* to   ( true/false)                 

5. Run operation, except (attribute, list, map, game attribute)
Description: Runs the operation but excludes the operation on a specif attribute, list, map, or game attribute.
                                                                 

« Last Edit: March 25, 2017, 06:44:27 pm by Donni11 »
Peace

Donni11

  • *
  • Posts: 2181
Fixed up the first post a bit,

Yeah so if any one is interested in creating these extension blocks, I'd deeply appreciate it, I'm sure other users would as well. So if any ones up for it, just leave a comment below.

Thanks,

Donni,
Peace

rob1221

  • *
  • Posts: 9473
Those seem like events, but I don't think those work in extensions.  I guess someone could do the add/remove event listener thing I do in my Chartboost extension but that seems too complicated for just checking the value of a game attribute.

merrak

  • *
  • Posts: 2738
Are categories even visible to anything other than the Java-based development environment?

Donni11

  • *
  • Posts: 2181
@rob1221, So I guess this would just have to be a new feature thing, not extension? Maybe I should just put this in the issue tracker....
@merrak, I think so, found them in the haxe part of Stencyl directory.
Peace

rob1221

  • *
  • Posts: 9473
Thinking about this some more, supporting events in extensions wouldn't really make a difference because the event code would still have to be stopped either by the extension automatically or with another block.  Stencyl's engine takes care of Stencyl events but the same would not apply to extension event blocks.  So if you had an extension block to listen to changes in a game attribute, you would need a second block in order to stop listening to those changes.

Making game attribute events to match the blue attribute events could be an option though.  I don't see the benefit of category checking though and why you'd need to do that.  What is the situation that requires you setting many game attributes in a category to the same value?  It seems like a game attribute list would be a better option there.

Donni11

  • *
  • Posts: 2181
  What is the situation that requires you setting many game attributes in a category to the same value? 

Its complicated. But it would really help to have these blocks. Also, they would serve use for future purposes...
Peace

Donni11

  • *
  • Posts: 2181
Wait, how does game attribute list work?
Peace

rob1221

  • *
  • Posts: 9473
It's like a regular list except the data inside is saved.

Donni11

  • *
  • Posts: 2181
Doe Stencyl currently have that feature?
Peace

rob1221

  • *
  • Posts: 9473
Game attribute lists have always been in Stencyl.

gurigraphics

  • Posts: 690
Game attributes can not be created dynamically. And you can not set a Game attribute without a name. For this reason I create a predefined Game attribute before use in an extension. And if you do not know how many you're going to use, this is a problem.

As suggested, easier to use lists as game attribute. Instead of use names of lists with text, you put numbers as name and use positions in list: 0,1,2,3,4,5, etc. Then uses a event with a loop to iterate.

For example, event set_all_true

var number = 0;
loop(){
set list (number) = true;
set number = number + 1;

if(number<number_of_lists){
loop();
}
else{
trigger event end
}

}

With events and updates you control when to reset or change true to false and vice versa.

Changing attributes in update does not cause memory problems. However, using much events therefore depends frequency of changes.

rob1221

  • *
  • Posts: 9473
Game attributes can not be created dynamically.
Yes they can, by using the two default blocks in the Game Attributes section.

gurigraphics

  • Posts: 690
Quote
Yes they can, by using the two default blocks in the Game Attributes section.

Theses?


Truth. The block category is precisely Dynamic Game Attributes. ^ ^

Where do I find the haxe code to get this blocks?