semi-random event spawing

● ARCHIVED · READ-ONLY
Started by Oddball 5 posts View original ↗
  1. I'm not sure if this is the right place to put this or not. So I'm just going to hope it is

    how do you make an event that spawns at one of three or four different locations choosen at random for different save files?

    I was thinking of using different variables, but then people would figure out "oh, this combination puts this here"

    Any help would be appreciated. I'm not going to be on here asking for help very often, because iv'e had other difficult problems with my project that iv'e solved by myself.

    thanks
  2. You could assign a random value to your variables. If you have to make the event spawn randomly in four different locations, you assign to your variables a value between 1 and 4.
  3. This is how the chests, enemies, and even stairs work in my random map generator.

    You have events in any place you want a possible spawn. run a random number generator, in your case it would be 1-4, then run 4 condition branches, one for each possible number, and turning on a different switch, Each switch dictates where the event will spawn.

    PS> Make sure each of these events have 2 pages, and that the first page has no graphic.
  4. Program and Utility Discussion is for programs OTHER than RPG Maker and IG Maker. You are asking for support for VX Ace, so you would post in the VX Ace Support forum :)


    Are these 3 or 4 locations all on the same map? If they are, do something like this:


    One event with 5 pages, set to parallel process.


    On the first page, do a Control Variables, and set a variable to a random number between 1 and 4.


    On the second page, set the condition to be the variable above = 1


    On the third page, set the condition to be the variable above = 2


    On the fourth page, set the condition to be the variable above = 3


    On the fifth page, set the condition to be the variable above = 4


    Now, on each page, in the event list, add 2 commands. The first is Set Event Location, which will move your "spawning" event to one of 4 different locations. The second is Erase Event.


    Then your second event will be the actual event your player will interact with, and you just set it up normally.


    The first time the map loads, your event will be placed randomly in one of the 4 locations. Every other time you go back to that map, it will be placed in the same location again.


    If your events are going to spawn on different maps, you'll need a slightly different approach.


    At the start of the game, set a variable to a random number between 1 and 4.


    Now create 4 different events, which don't have to be on the same map.


    Each event will have 3 pages - the page to show the event when it spawns in that area, the page that shows after the player has interacted with it (for example, a closed chest vs an open chest), and the page that shows when the event does NOT spawn in that area.


    So the first page will be, using the same example, your closed chest graphic. It will be conditioned by the variable being equal to 1, 2, 3 or 4. Add your event interactions here (open chest, give item) and turn on self switch A.


    The second page will be conditioned by self switch A and will contain the sprite and commands for what happens after you have interacted with it.


    The third page will have no sprite and will be conditioned by the same variable being 1 higher than it was on the first page.


    So if your first page is active when variable = 2, the last page will be conditioned by variable = 3.


    This way, only one of the chests will be visible - the one where the first page is conditioned by the variable being set to the correct number. All others will not be visible, either because the variable is too small to activate the first page, or is higher than that needed, activating the last page instead.
  5. thank you :D