piranha305's Forum Posts

  • Published Update 1.3, update include FOV actions, Islands Detection, And Multiple Wall/Floor Tiles in Generation.

    Example projects :

    FOV Exmaple

    https://github.com/armandoalonso/C3Plugins/blob/master/addons/examples/rotjs_fov_test.c3p

    Island Example

    https://github.com/armandoalonso/C3Plugins/blob/master/addons/examples/rotjs_islandtest.c3p

    Tile Example

    https://github.com/armandoalonso/C3Plugins/blob/master/addons/examples/rotjs_tile_test.c3p

  • Yes this specific plugin is only available with the C3 runtime. I think there was another plugin that used rot.js for the c2 runtime.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Javascript

  • https://www.construct.net/en/make-games/addons/189/rot

    This addon is an implementation of the ROT.js library ondras.github.io/rot.js/hp

    This library has alot of features that assist with the creation of rogue-like games.

    CURRENT FEATURES

    • Rng Expressions
    • All Maze Generation
    • Cellular Automata
    • Dungeon Generation
    • FOV
    • Island Detection/Iteration
    • Multiple Tiles for Wall/Floors

    ROADMAP

    • Pathfining
    • Event Queue & Scheduler (needs a bit research)
    • Noise
    • String Generation (Markov process)

    I have tried to take into account several ways, to deal with the generated maps, and have exposed different ways to interact with the map, currently all the generation action require a tilemap object, and the map is generated using the 0, 1 tileIndex of the tilemap (0 == floor tile, 1 == wall tile)

    **UPDATE: now there are Add floor/wall tiles actions that let's you specify multiple tiles that will be chosen at random from the list of weighted values you pass.

    In the future i might add the same generation actions without the need for a tilemap, and have them just expose the data structure, which would require the user to populate the map using event. as of now this can be accomplished but there is the extra overhead of the population of the tilemap.

    The included example project, is the project i used to test everything was working as expected, it has some comments, but every single expression,action,condition is used, and demonstrates some basic usage, and logs everything to the console.

    Also i have test this plugin pretty well, but if you stumble on to a bug or some unexpected behavior let me know and i'll check it out.

    ** UPDATE : added FOV action

    ** UPDATE : added Island Detection/Iteration, Island detection actions, let you iterate over isolated section, useful as a room replace to cellular automata.

  • Would it be possible, to add a reload shortcut on the desktop version of c3 like a shortcut hit f5 and have NWJS reload the C3 app, this would help speed up the dev process a bit on desktop ver, i know it's not a preview reload but it beats having to reopen the whole app every timr

  • 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?

  • Thanks I think that's a cleaner way