Jump to content
Tsukihime

Random Event Positions

Recommended Posts

This script allows you to randomize an event's position when you enter the

map. Regions are used to designate the tiles where an event can appear.

 

randomeventpositions1.gif

 

Download

 

Get it at Hime Works!

 

Installation

 

Place this script below Materials and above Main

 

Usage

 

To designate an event page where the event's position is randomized, create

a comment and write

<random position region: x type>
For some region ID x

The type determines when position randomization occurs

init - only when the event is created
page - when you change to that page
If that page is active when the map is loaded, then the event will be randomly

moved to a tile in that region.

 

This is applied to events on a per-page basis, so you may need to add the

comment to multiple pages.

 

randomeventpositions2.gif

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Just realized a limitation. If the event used is not active when loading the map it will not be randomized even if it has the same randomize comment. ex: needs a variable. A solution I found was making an empty event with the comment and making it use a self switch when the variable is obtained.

Share this post


Link to post
Share on other sites

hime you could call the randomize position not at initialize but at

def setup_page_settings

it will fix the issues anavn1 encounter

(no need for extra blank event page and one selfswitch for randomize. because self switch is valuable for eventer and by default we only have 4 :D)

Share this post


Link to post
Share on other sites

Updated script with an extra argument to the comment

<random position region: 3>
<random position region: 3 init>
<random position region: 3 page>
If you write page, the position is randomized whenever you change to that page.

If you write init, or don't write anything at all, it will just be randomized only when the event is created.

Share this post


Link to post
Share on other sites

I'm trying to create a psuado-random dungeon generator by using the Random Generator on template maps then copying & pasting them onto a 500x500 map to make different generated areas. I'm using 100x100 maps so I can fit up to 25 different areas on one map. This script would help randomly place my events around but I rely on a randomly generated variable to determine which section the player gets transferred to. I want to label the floor tiles in each section with Region IDs so they won't get placed in walls & ceilings, but the script requires you to specify only 1 predetermined Region ID. I need to label each section with a different region ID so that the events get placed in the right section.

So I was wondering if you could set an option that would check a custom variable to determine which region ID the events get placed on. It would be too difficult to try to make separate events for each section (1 staircase, 1 recovery point, 20 chests & 40 enemies to randomly place). That would be WAY too many events on one map, & would be equally difficult to try to use eventing to workaround it. So if you could add this option to the script I would appreciate it very much. Thank you.

Share this post


Link to post
Share on other sites

 

I've added support for variables so you can say

<random position region: v[2]>
To use whatever value is stored in variable 2 as the region ID where the event could be placed.

Sweet! Thanks! My psuado-random dungeon idea might just actually work!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×