piranha305's Recent Forum Activity

  • If you are using the Array.json file, you will need an AJAX object to request that file, then use the AJAX objects LastData Property to Load the Array using the Array.Load Action

    here is an exmaple:

  • That really great! Thanks, man you guys are fast. I will start working on the plugin I had in mind, and then test it with the next beta release.

  • This works really well, thanks for the quick implementation of this stuff! could the next plugin you look at when you have time be the Tile Map plugin? i know that's a big plugin, but maybe add it to the backlog, things like being able to set cells and get cells also get width/height and alter the tile state, would be useful. this would be pretty neat for procedural generation of tile maps where the plugin can hold the data structure and then apply it to the tile map without having to do it through the event system.

  • No the issue was related to the array filter for selecting which array to shuffle on the project, it was related to the plugin id which was arr not array.. I have fixed it and I will push that out later today.

  • download the plugin here: https://www.construct.net/make-games/addons/176/chance

    example project here : https://www.construct.net/make-games/addons/176/chance/examples/1/chance.c3p

    This plugin is based on https://chancejs.com/

    You can also get the plugins on my github page https://github.com/armandoalonso/C3Plugins

    Release Notes

    • 09/18/2018 - initial release,
    • 09/19/2018 - updated example project, and fixed bug with array selection
    • 09/23/2018 - finished implementing remaining expressions
  • Ashley

    I think i found a bug with the allowedPluginIds, i wanted to post it here before i file a report just to make sure this is not the expected behavior, So the allowedPluginIds and the object picker work perfect when there is one instance of an array. i was able to specify the instance and i was able to modify that particular instance,

    now when i added a second array and tried to run the same action on it, the item filter came up empty, see image below.

    so the reason i'm not sure if this is a bug is, when you filter by an object type your not really selecting it's instance, in this case the array is a global plugin but there are multiple objects for the same object class. is this expected or should we see the second array in that list? or even the first one ? what if i wanted to perform the same operation on the same array twice? i feel likes it's a bug

    this is my action def i'm using

    { "id": "array-shuffle-1d", "scriptName": "ShuffleArray", "params": [ {"id": "arr", "type": "object", "allowedPluginIds": ["Array"]} ]}

    should i file this a a bug?

  • Is there a way we can get Access to the complete array data structure? with the dictionary version we can get the complete map? can we have the same thing for array? some like instance.GetArray() - / instance.SetArray(3darray) * this should probably also update the size based on the passed in array?

    so the reason i'm asking for this is, it seems like there if you needed to pass that array around to a 3rd party js lib? or some other js functions that take an array as a param i would first have to iterate the array and create a copy on the fly, then i pass it in to the whatever js function, have some operation on it which then returns the modified array, then in order to set the array back you have to then iterate one more time to then set each value separately.

    so i did a proof of concept, using an external js lib chancejs.com/helpers/shuffle.html pretty much takes an array as a param and spits a shuffled array (i mean i could write the shuffling logic myself in the plugin, but if i wanted to create a wrapper for an external lib this might be helpful);

    for(var i = 0; i<width; i++) {temp.push(instance.At(i,0,0));} var temp = this.chance.shuffle(temp); for(var i = 0; i<width; i++) {instance.Set(i,0,0,temp);}

    here is how the same logic can be done using the private reference to the array, which seems cleaner.

    here we are just replacing the array reference.

    var newArr = this.chance.shuffle(instance._arr); instance._arr = newArr;

    Is there any reason, why we can't have access to proper array data structure?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks I think that's a cleaner way

  • When u use a variadic parameter, it's still calling one expression. It just returning an array as a Param.

    So I would need to handle all the cases in that expression to account for all the Parameters I'm expecting.

    I guess if the max Param I'm expecting is 3 I can just ignore every other Param after that.

    As for documentation? Can u document the parameters? In a variadic function?

  • Is there a way to create Expression overloads??

    for example

    let's say i have 2 expressions Sum(a,b) and Sum(a,b,c)

    is there a way to have both of these expression share the same expressionName but have construct determine which one to use based on the number of param passed in? this is a very trivial example which we can use varadic param for? but i'm think of a more complex example which a varadic param cannot be used, i'm just wonder if there is a way to have the same expression name instead of having to add a separate name for each function?

  • Is it possible to have a container with multiple of the same object object type? i want to have a container that has 1 instance of Object A and 2 instances of Object B? is this possible?

  • Thank you

piranha305's avatar

piranha305

Early Adopter

Member since 26 Apr, 2016

Twitter
piranha305 has 34 followers

Connect with piranha305

Trophy Case

  • 8-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x5
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x3
    Lightning Draw First person to up-vote a new Construct 3 release
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies