Request: Game Attribute Extension Blocks


Donni11

  • *
  • Posts: 2182
Game attribute list are still going to be a problem. I'm just going to have to add a ton of game attributes to a list ( I have 80 , don't ask). Since they are already created within a category, it might just be better to just make action blocks based on the category. I know I should've went with list from the begging. But the game I'm working on is very, very complex and list will just create contradiction in conditions within the code, resulting with Stencyl just throwing back errors. It would just be easier to have game attribute_category blocks. Should I leave the request for a extension in this topic? Or it would make more sense to move it to the issue tracker ( for the block to just be added through a update..) ?
Peace

gurigraphics

  • Posts: 688
Quote
It would just be easier to have game attribute_category blocks.

"Attribute_category blocks" is the same as array.

If you do not want to use list and numbers, try using a array extension.

Donni11

  • *
  • Posts: 2182
What array extension?
Peace

gurigraphics

  • Posts: 688
I think there's only this one like array
http://community.stencyl.com/index.php/topic,28081.0.html

Array code is like this:
Code: [Select]
var my_attribute:Dynamic = {
     category1 : [["name1",true],["name2",456]],
     category2 : [["name1",false],["name2",000]],
     category3 : [["name1",false],["name2",000]]
 };

 var x  = my_attribute.category1[0][0] // get name1;
 var x  = my_attribute.category1[0][1] // get true;
 var x  = my_attribute.category1[1][0] // get name2;
 var x  = my_attribute.category1[1][1] // get 456;

my_attribute.category1[0][0] = name3; // set name3
var x  = my_attribute.category1[0][0] // get name3;


Or use maps
http://www.stencyl.com/help/view/maps/



« Last Edit: March 30, 2017, 07:33:06 pm by gurigraphics »