[Question] Getting the Seed/random Stream from the DungeonBlueprint
Gensokian opened this issue · 4 comments
In my Dungeon I want to add multiple elements that are randomized, based on the level seed (Like sometimes there's a bookshelf at a position sometimes a table, yadayada.) But every time I try to get a random int from stream, I cannot cast to the DungeonBlueprint to get the seed. Where is that variable stored?
Also, how would I go about and set the random seed for the generator to use, when for example running the generator from the Main Menu?
Thanks a bunch!
Hello Gensokian,
In fact there is no way to get or set the seed from blueprint... (I forgot that, sorry ^^")
If your project is a C++ one, you can add an accessor in the plugin if you want, but I suppose you have a blueprint only project if you ask this question here.
What version of the plugin do you use ?
I will add it ASAP in the plugin, but if you can't wait few days, I suggest you to convert your project to C++ and add the accessors yourself in the plugin.
I will add it in the version 2.X first, and if you use 1.X I will port in it too.
Hi BenPyton,
I am running on V 2.0.0 of the plugin, I can wait for the update, and just use the default random (int, float yadayada) functions, replacing them later.
Also it would be nice if there is a way to SET the seed and generation method pre-generation. (Which would allow a user to set a specific seed in the "New game" option or something along the lines of that.
Thanks a bunch!
Hello Gensokian,
I updated the plugin to the version 2.0.1 so you can get and set the seed of the dungeon generator :)
There are also get and set of the generation type and seed type in this version.
However, to allow the player choose the seed in the main menu, then generate the dungeon in an another level with this seed,
it is up to you to pass the data between the levels, then get this player seed and set it to the dungeon generator (with the accessor I've added).
Hope this will help you :)
Hi BenPython,
Works like a charm! Thanks a bunch for the implementation!
Cheers!