Floor Generarion out of Several maps Event.

● ARCHIVED · READ-ONLY
Started by BlondeSamurai 11 posts View original ↗
  1. Hello everyone, 

    first of all I would like to appologise for any bad grammar I am not a native speaker, I am using RPGVXA and what I mean by Floor Generation is the following :

    I´d like a map (Number 6) to have 4 Teleports one on each side, These teleports should Teleport you to a Random map of a Certain "Pack" ( Like lets say Choose 1 map out of the first 20.

    But after a Map has been chosen the Teleport is suppost to kinda "lock" on to the randomly chosen map so that when you return to your Start Map you can take that very same teleport again and it will send you to the same map as before rather than chosing a new one. You could Imagine it looking in the end like a Dice shape 

    Spoiler
    http://www.cozyowl.com/storage/printable_die.svg?__SQUARESPACE_CACHEVERSION=1325869017605
    Basicly its about me wanting to have a Vast world being Generated out of Randomly chosen Maps. So that every "run" will be different for the players since every Map will have different enemys/Items/Allies etc.

    I believe it has something to do with Variables but I have difficulties understanding them so I was unable to write the event myself.

    If theres anything that Is not clear or not understandable say so and I will ofc. try my best to explain it better.

    Thanks In advance everyone.

    -BSamurai
  2. Setting the variable would be the easy part. In the control variable event command, you would put the Operation to "Set" and the Operand to "Random: 1 ~ 20". Then you could have a series of conditional branches set to check and transfer to different maps.

    What I'm not certain about is the easiest way to make it go to that map each time. I will be thinking on it and perhaps someone more knowledgeable will speak up.
  3. If you only set the variable the first time the event is called, then go to the stored variable next time, it will work. You can do that with self-switches.
  4. Yeah, I was thinking along those lines, but a self-switch wouldn't work I don't think. For ex, if the first page sets the variable, then the second page of the event does the conditional branches, the next time you went to the event, it would start again with the first page, resetting the variable, thus taking you to a different map.

    So you would need to use regular switches, which, depending on how many transfer spots you have, would use a lot of switches.

    Also, the other concern would be to have some sort of check to see if the map has already been used by another portal.
  5. Actually, if you put the event on the map, it will work. Have page one generate the variable, and save it in a game variable that is *never* touched again. Also have that same page (1) on the event teleport, and put a self switch A on at the end. On page two, check the self switch A is on, then redo the teleport part of the event only. As long as you never change the variable that the random roll was saved in, it will still teleport you.

    I use this trick to have conversations when teleporters are first found, and turn on self switch A after the event runs, then on page two only do the teleport. As long as you set page two to run when self switch A is on, it will run page 2 the second time, not the first page (as it always runs the highest page number that first meets the conditions set).
  6. Ahhh, hmmm, I thought self-switches reset after you left the map. Apparently, I am wrong. So that would make that part much easier. In that case, I would probably just set a variable on page 1, turn on Self-Switch, and then on page 2 set the conditional branches for the teleport.

    You would still need a way to check to make sure the random map hasn't been used. And personally, I can only think of seriously complicated conditional branches to do that.
  7. Yeah, that is the hard part. Maybe a check to see if the variable on the first teleporter is not the same as the 2nd teleporter, if so, reroll? Repeat for all the teleporters? Otherwise, if teleporter one can only go to worlds 1 - 10, 2 goes to worlds 11 - 20, etc, it would work without conditional branches.
  8. such a thing could be made easier by using PK8's Self-Data Suite. That allows you to add self-variables to maps, and then you can store into a map the ID of those maps that already teleport there.


    When randomly setting the destination of any teleport, you first check if the map's variable is still zero (=unused) for that entry point, if yes then set the transfer variables there and set the map variable into the current map's ID.


    If not, that map had been used already and you reroll the random target.
  9. The way I would do it is to give a new property to Game_CharacterBase called "target_map" (or something similar) that tracks which map a specific Teleport will send you to.  The initial target_map value for each event is 0.

    When the player activates on a Teleport event, if that Teleport's target_map value is still 0, it will pick a value randomly from all eligible maps that it can Teleport you to.  If it already has a non-zero value for target_map, it will leave the value alone.  Then, it will warp you to the Map ID equal to the value of its target_map value.

    Using this method, it is easy to select and store targets for Teleports to create a consistent and randomized dungeon.

    Here's the tricky part, though - and it's going to rear its ugly head no matter what method you use if you want true randomness (and not just something like "pick one of two possible maps to warp to").  You need a way to pick an appropriate map to warp to.  For example, if you're using a "North" teleport, but some of your maps don't have a "South" teleport, you probably do not want to Teleport to those maps, unless you're in some kind of weird MC Escheresque space.  (And then what happens if you run out of eligible maps to warp to because of unlucky randomized design?  You'd probably want to create a "dead end" map to address this.)  If every single map is N-E-S-W with one Teleport on each side it becomes much easier.

    Additionally, if another room in the dungeon already has a North Teleport that has targetted Map 5, you would want to disqualify Map 5 from consideration... unless Map 5 has more than one South Teleport!  It gets complicated quickly. 

    Finally, considering that you probably have a "goal" map somewhere in the dungeon, you need to make sure that this goal map is chosen at some point during the random generation.  This is much easier said than done.  There are ways you could go about ensuring this (e.g. if the last remaining path would lead to a dead end, it will lead to the goal map instead), but they are not trivial.

    So, if this is something you really want, you might be able to get someone to make it for you in RGSS3 Script Requests, since it's something that could be applied to a wide variety of games and thus might be an appealing challenge for a scripter.  Or you can offer payment in Classifieds - Requests, which would give you an even better chance to get someone for the job.
  10. Lets try this for the eleventh time ( damn my Pc crashing right before I finish writing ) 

    Thanks for all your advice and help it helped greatly.

    So far Ive come up with this : 

    Spoiler
    http://www.image-hoster.de/files/c9bcea4d32560971e44ecf0d2.png
    It was kept Simple for now by only chosing 5 Randoms and the Swich that is turned on activates on another page to change into a Teleport to only that one Chosen map.

    The Problems with 2 Maps at a time and things like that wont appear since I can organise my maps xD 

    Have an Folder for the first Block of East contain several Maps each of those are Only for the first block of EAST, So that they cant appear twice in a playthrough unless I make the same map several times.

    I can thus Control it quite nicely I believe, I don´t know how Efficent it is tho but I am sure someone will tell me xD 

    So Basicly instead of having 1 Event Controll EVERYTHING at once I split it into having one event for the next map wich makes things alot easyer it requires me to Organise my maps but heck why not ? xD

    Thanks again for all your help I Liked all the Comments given so far.

    Id like to finish writing now since im afraid of my Pc crashing again D:

    P.S This task is finished but id like to leave it open a bit longer for more suggestions if that is not a Problem thx :D
  11. Closing at OP's request