Stencyl 3.4.0 is now out. Get it now!

Request: Game Attribute Extension Blocks

Donni11

  • *
  • Posts: 2116
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 »
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

Donni11

  • *
  • Posts: 2116
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,
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

rob1221

  • *
  • Posts: 8954
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: 1280
Are categories even visible to anything other than the Java-based development environment?

Donni11

  • *
  • Posts: 2116
@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.
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

rob1221

  • *
  • Posts: 8954
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: 2116
  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...
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

Donni11

  • *
  • Posts: 2116
Wait, how does game attribute list work?
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

rob1221

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

Donni11

  • *
  • Posts: 2116
Doe Stencyl currently have that feature?
The Stencyl Discord Channel , Where the real Stencyl work happens ;).

rob1221

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

gurigraphics

  • Posts: 687
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: 8954
Game attributes can not be created dynamically.
Yes they can, by using the two default blocks in the Game Attributes section.

gurigraphics

  • Posts: 687
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?

rob1221

  • *
  • Posts: 8954
Check the code preview.