Installation

To enable MapGraph you need to do the following changes:

  1. Change Map.cs

using GraphProcessor; // Add the namespace
//...
public class Map {
  // ...
  public virtual void GenerateMap(World world) // Replace the GenerateMap with this method
  {
    MapData mdata = MapData.Get(map_id);
    System.Random seed_rand = new System.Random(seed);
    System.Random gen_rand = new System.Random(seed + map_id.GetHashCode());

    mdata.map.SetParameterValue("Map", this);
    mdata.map.SetParameterValue("Seed", seed_rand);
    mdata.map.SetParameterValue("GenSeed", gen_rand);

    new ProcessGraphProcessor(mdata.map).Run();
  }
  
  public int Depth()
  {
      return locations.Any() ? locations.Keys.OrderBy(k => k).Last() / 100 : 0;
  }

  //...
}
  1. Change MapViewer.cs

max_scroll = map.Depth() * row_spacing - cam_width + row_offset;
  1. Change WorldLogic.cs

if (location != null && location.depth == world_data.GetMap(map).Depth())
  1. (Optional) Now that you migrated to the new Map system, you can remove some properties on MapData, like:

    1. events

    2. fixed_widths

    3. ixed_events

    4. fork_probability

    5. width_min

    6. width_max

    7. GetLocationEvent()

    8. GetFixedLocation()

    9. GetFixedWidth()

Last updated