Jump to content
Animebryan

Script for Random Generating Dungeons

Recommended Posts

Oopsie doopsie, there was an extra if there... try this:

 

 

#==============================================================================

# - Dungeon Creation 6 (Events) KZ Edit

# @based on version 0.14 12/01/21 RGSS3

# @original author Saba Kan

# @translator kirinelf

#------------------------------------------------------------------------------

# Put all event logic here for easier access and stuff.

#==============================================================================

 

class Room

 

def put_to_random_place(event)

tiles = []

for i in @lx...@hx

for j in @ly...@hy

next if event.collide_with_characters?(i, j)

#next if i == $game_player.x && j == $game_player.y

next unless $game_map.floor?(i, j)

next unless $game_map.spawner_passable?(i, j)

next if @events[[i, j]] != nil

next if @couple_areas.include?([i, j])

tiles.push([i, j])

end

end

return false if tiles.empty?

key = tiles.sample

@events[key] = event

event.moveto(key[0], key[1])

return true

end

 

end

 

class Game_Map

attr_accessor :new_events

 

def setup_player_initial_position

put_to_random_place($game_player) unless floor?($game_player.x, $game_player.y)

end

 

def setup_dungeon_events

@next_enemy_event_id = 10000

@enemy_events = []

@chest_events = []

 

for event in @events.values

if event.event.name.include?("*")

@enemy_events.push(event.event)

self.events[event.id].erase

elsif event.event.name.include?("!")

@chest_events.push(event.event)

self.events[event.id].erase

else

put_to_random_place(event)

end

end

setup_enemy

end

 

def setup_enemy

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] = 0

return if @enemy_events.count == 0

n = @map.encounter_step

n.times do |i|

add_random_enemy

end unless @enemy_events.empty?

(n / (rand(3)+1)).times do |i|

add_random_chest

end unless @chest_events.empty?

end

 

def add_random_enemy

return if @enemy_events.empty?

add_enemy(rand(@enemy_events.count))

end

 

def add_random_chest

return if @chest_events.empty?

add_chest(rand(@chest_events.count))

end

 

def add_enemy(event_id)

enemy_event = @enemy_events[event_id]

event = Game_Event.new(@map_id, enemy_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] += 1

end

 

def add_chest(event_id)

chest_event = @chest_events[event_id]

event = Game_Event.new(@map_id, chest_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

puts("Chest event "+chest_event.id.to_s+" created.")

end

 

alias saba_randomdungeon_update_events update_events

def update_events

saba_randomdungeon_update_events

if @new_events

for key in @new_events.keys

@events[key] = @new_events[key]

put_to_random_place(@events[key])

$game_minimap.add_event(@events[key]) if $game_minimap

end

end

@init_phase = false

end

 

def put_to_random_place(event)

return if event.nil?

if @init_phase

room_list = @room_list.select {|room| room.remain != 0 }

else

room_list = @room_list.select {|room| room.remain != 0 && room != $game_player.room }

end

room_list.shuffle!

loop do

if room_list.empty?

msgbox("Could not place event "+event.id.to_s+"!")

break

end

room = room_list.pop

next if room.nil?

break if room.put_to_random_place(event)

end

end

 

def setup_starting_map_event

event = @events.values.find {|event| event.starting }

event.clear_starting_flag if event

@interpreter.setup(event.list, event.event_id) if event

event

end

 

def room(x, y)

for rect in @rect_list

if rect.room.contains(x, y)

return rect.room

end

end

return nil

end

 

def spawner_passable?(x, y)

return false unless (passable?(x, y, 2) && passable?(x, y + 1, 8)) ||

(passable?(x, y, 4) && passable?(x + 1, y, 6)) ||

(passable?(x, y, 6) && passable?(x - 1, y, 4)) ||

(passable?(x, y, 8) && passable?(x, y - 1, 2))

return true

end

 

end

 

class Spriteset_Map

 

alias saba_dungeon_update update

def update

if $game_map.new_events

$game_map.new_events.values.each do |event|

@character_sprites.push(Sprite_Character.new(@viewport1, event))

end

$game_map.new_events = nil

end

saba_dungeon_update

end

 

end

 

class Sprite_Character

 

alias saba_dangeon_update update

 

def update

saba_dangeon_update

return unless $game_map.dungeon?

if @character.is_a?(Game_Event)

self.visible = false

if $game_player.room

self.visible = $game_player.room.contains(@character.x, @character.y)

@last_visible = self.visible

end

if $game_player.distance(@character) <= 1

self.visible = true

@last_visible = true

else

self.visible |= @last_visible

@last_visible = false

end

if @character.balloon_id != 0 || @character.animation_id != 0 ||

($imported["KZ!-EventBattlers"] && $game_map.event_battlers != nil && $game_map.event_battlers.include?(@character))

self.visible = true

@last_visible = true

end

@last_visible &= self.visible

end

end

 

end

 

class Game_Event

attr_reader :event

attr_accessor :event_id

attr_reader :erased

 

alias saba_dungeon_initialize initialize

def initialize(map_id, event)

saba_dungeon_initialize(map_id, event)

@event_id = event.id

end

 

def name

@event.name

end

 

alias saba_dungeon_erase erase

def erase

saba_dungeon_erase

return unless enemy?

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] -= 1

end

 

def enemy?

return name.include?("*")

end

 

end

 

class Game_Player

 

attr_accessor :room

 

alias saba_dungeon_moveto moveto

def moveto(x, y)

saba_dungeon_moveto(x, y)

$game_map.setup_player_initial_position if $game_map.dungeon?

end

 

def distance(event)

min = $game_player.distance_xy_from(event.x, event.y)

return min unless $game_player.followers.visible

$game_player.followers.visible_folloers.each do |character|

dist = character.distance_xy_from(event.x, event.y)

if dist < min

min = dist

end

end

return min

end

 

end

 

class Game_Character

 

def distance_xy_from(x, y)

sx = distance_x_from(x)

sy = distance_y_from(y)

return [sx.abs, sy.abs].max

end

 

end

 

 

Sorry for making this such a hassle! I think I sort of hacked my way through the code without much thought to anything but my own use when I fiddled with it... I should be more careful about that!

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Oopsie doopsie, there was an extra if there... try this:

 

 

#==============================================================================

# - Dungeon Creation 6 (Events) KZ Edit

# @based on version 0.14 12/01/21 RGSS3

# @original author Saba Kan

# @translator kirinelf

#------------------------------------------------------------------------------

# Put all event logic here for easier access and stuff.

#==============================================================================

 

class Room

 

def put_to_random_place(event)

tiles = []

for i in @lx...@hx

for j in @ly...@hy

next if event.collide_with_characters?(i, j)

#next if i == $game_player.x && j == $game_player.y

next unless $game_map.floor?(i, j)

next unless $game_map.spawner_passable?(i, j)

next if @events[[i, j]] != nil

next if @couple_areas.include?([i, j])

tiles.push([i, j])

end

end

return false if tiles.empty?

key = tiles.sample

@events[key] = event

event.moveto(key[0], key[1])

return true

end

 

end

 

class Game_Map

attr_accessor :new_events

 

def setup_player_initial_position

put_to_random_place($game_player) unless floor?($game_player.x, $game_player.y)

end

 

def setup_dungeon_events

@next_enemy_event_id = 10000

@enemy_events = []

@chest_events = []

 

for event in @events.values

if event.event.name.include?("*")

@enemy_events.push(event.event)

self.events[event.id].erase

elsif event.event.name.include?("!")

@chest_events.push(event.event)

self.events[event.id].erase

else

put_to_random_place(event)

end

end

setup_enemy

end

 

def setup_enemy

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] = 0

return if @enemy_events.count == 0

n = @map.encounter_step

n.times do |i|

add_random_enemy

end unless @enemy_events.empty?

(n / (rand(3)+1)).times do |i|

add_random_chest

end unless @chest_events.empty?

end

 

def add_random_enemy

return if @enemy_events.empty?

add_enemy(rand(@enemy_events.count))

end

 

def add_random_chest

return if @chest_events.empty?

add_chest(rand(@chest_events.count))

end

 

def add_enemy(event_id)

enemy_event = @enemy_events[event_id]

event = Game_Event.new(@map_id, enemy_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] += 1

end

 

def add_chest(event_id)

chest_event = @chest_events[event_id]

event = Game_Event.new(@map_id, chest_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

puts("Chest event "+chest_event.id.to_s+" created.")

end

 

alias saba_randomdungeon_update_events update_events

def update_events

saba_randomdungeon_update_events

if @new_events

for key in @new_events.keys

@events[key] = @new_events[key]

put_to_random_place(@events[key])

$game_minimap.add_event(@events[key]) if $game_minimap

end

end

@init_phase = false

end

 

def put_to_random_place(event)

return if event.nil?

if @init_phase

room_list = @room_list.select {|room| room.remain != 0 }

else

room_list = @room_list.select {|room| room.remain != 0 && room != $game_player.room }

end

room_list.shuffle!

loop do

if room_list.empty?

msgbox("Could not place event "+event.id.to_s+"!")

break

end

room = room_list.pop

next if room.nil?

break if room.put_to_random_place(event)

end

end

 

def setup_starting_map_event

event = @events.values.find {|event| event.starting }

event.clear_starting_flag if event

@interpreter.setup(event.list, event.event_id) if event

event

end

 

def room(x, y)

for rect in @rect_list

if rect.room.contains(x, y)

return rect.room

end

end

return nil

end

 

def spawner_passable?(x, y)

return false unless (passable?(x, y, 2) && passable?(x, y + 1, 8)) ||

(passable?(x, y, 4) && passable?(x + 1, y, 6)) ||

(passable?(x, y, 6) && passable?(x - 1, y, 4)) ||

(passable?(x, y, 8) && passable?(x, y - 1, 2))

return true

end

 

end

 

class Spriteset_Map

 

alias saba_dungeon_update update

def update

if $game_map.new_events

$game_map.new_events.values.each do |event|

@character_sprites.push(Sprite_Character.new(@viewport1, event))

end

$game_map.new_events = nil

end

saba_dungeon_update

end

 

end

 

class Sprite_Character

 

alias saba_dangeon_update update

 

def update

saba_dangeon_update

return unless $game_map.dungeon?

if @character.is_a?(Game_Event)

self.visible = false

if $game_player.room

self.visible = $game_player.room.contains(@character.x, @character.y)

@last_visible = self.visible

end

if $game_player.distance(@character) <= 1

self.visible = true

@last_visible = true

else

self.visible |= @last_visible

@last_visible = false

end

if @character.balloon_id != 0 || @character.animation_id != 0 ||

($imported["KZ!-EventBattlers"] && $game_map.event_battlers != nil && $game_map.event_battlers.include?(@character))

self.visible = true

@last_visible = true

end

@last_visible &= self.visible

end

end

 

end

 

class Game_Event

attr_reader :event

attr_accessor :event_id

attr_reader :erased

 

alias saba_dungeon_initialize initialize

def initialize(map_id, event)

saba_dungeon_initialize(map_id, event)

@event_id = event.id

end

 

def name

@event.name

end

 

alias saba_dungeon_erase erase

def erase

saba_dungeon_erase

return unless enemy?

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] -= 1

end

 

def enemy?

return name.include?("*")

end

 

end

 

class Game_Player

 

attr_accessor :room

 

alias saba_dungeon_moveto moveto

def moveto(x, y)

saba_dungeon_moveto(x, y)

$game_map.setup_player_initial_position if $game_map.dungeon?

end

 

def distance(event)

min = $game_player.distance_xy_from(event.x, event.y)

return min unless $game_player.followers.visible

$game_player.followers.visible_folloers.each do |character|

dist = character.distance_xy_from(event.x, event.y)

if dist < min

min = dist

end

end

return min

end

 

end

 

class Game_Character

 

def distance_xy_from(x, y)

sx = distance_x_from(x)

sy = distance_y_from(y)

return [sx.abs, sy.abs].max

end

 

end

 

 

Sorry for making this such a hassle! I think I sort of hacked my way through the code without much thought to anything but my own use when I fiddled with it... I should be more careful about that!

Changed the event control script. It finally generates a dungeon without error but there's 2 problems. 1st, it doesn't place any of my events around. They even have the ! at the end of their event name. 2nd, that no visability unless in the same room crap. It did handle placement of enemies but they wouldn't appear until it was like 2 tiles away, in a large room. Do you think you can figure out how to fix the events not showing up & the visability problem? I'm looking forward to seeing this fully functional, & every fix you make gets us one step closer to a universal random dungeon generator that just about anyone can plug in & use, so I appreciate all your work on this, since no one else wants to take this task on, so thank you.

Edited by Animebryan

Share this post


Link to post
Share on other sites

Changed the event control script. It finally generates a dungeon without error but there's 2 problems. 1st, it doesn't place any of my events around. They even have the ! at the end of their event name. 2nd, that no visability unless in the same room crap. It did handle placement of enemies but they wouldn't appear until it was like 2 tiles away, in a large room. Do you think you can figure out how to fix the events not showing up & the visability problem? I'm looking forward to seeing this fully functional, & every fix you make gets us one step closer to a universal random dungeon generator that just about anyone can plug in & use, so I appreciate all your work on this, since no one else wants to take this task on, so thank you.

 

I think I mentioned the visibility thing before... but it's pretty simple to get rid of.

 

Try this:

 

 

#==============================================================================

# - Dungeon Creation 6 (Events) KZ Edit

# @based on version 0.14 12/01/21 RGSS3

# @original author Saba Kan

# @translator kirinelf

#------------------------------------------------------------------------------

# Put all event logic here for easier access and stuff.

#==============================================================================

 

class Room

 

def put_to_random_place(event)

tiles = []

for i in @lx...@hx

for j in @ly...@hy

next if event.collide_with_characters?(i, j)

#next if i == $game_player.x && j == $game_player.y

next unless $game_map.floor?(i, j)

next unless $game_map.spawner_passable?(i, j)

next if @events[[i, j]] != nil

next if @couple_areas.include?([i, j])

tiles.push([i, j])

end

end

return false if tiles.empty?

key = tiles.sample

@events[key] = event

event.moveto(key[0], key[1])

return true

end

 

end

 

class Game_Map

attr_accessor :new_events

 

def setup_player_initial_position

put_to_random_place($game_player) unless floor?($game_player.x, $game_player.y)

end

 

def setup_dungeon_events

@next_enemy_event_id = 10000

@enemy_events = []

@chest_events = []

 

for event in @events.values

if event.event.name.include?("*")

@enemy_events.push(event.event)

self.events[event.id].erase

elsif event.event.name.include?("!")

@chest_events.push(event.event)

self.events[event.id].erase

else

put_to_random_place(event)

end

end

setup_enemy

end

 

def setup_enemy

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] = 0

return if @enemy_events.count == 0

n = @map.encounter_step

n.times do |i|

add_random_enemy

end unless @enemy_events.empty?

(n / (rand(3)+1)).times do |i|

add_random_chest

end unless @chest_events.empty?

end

 

def add_random_enemy

return if @enemy_events.empty?

add_enemy(rand(@enemy_events.count))

end

 

def add_random_chest

return if @chest_events.empty?

add_chest(rand(@chest_events.count))

end

 

def add_enemy(event_id)

enemy_event = @enemy_events[event_id]

event = Game_Event.new(@map_id, enemy_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] += 1

end

 

def add_chest(event_id)

chest_event = @chest_events[event_id]

event = Game_Event.new(@map_id, chest_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

puts("Chest event "+chest_event.id.to_s+" created.")

end

 

alias saba_randomdungeon_update_events update_events

def update_events

saba_randomdungeon_update_events

if @new_events

for key in @new_events.keys

@events[key] = @new_events[key]

put_to_random_place(@events[key])

$game_minimap.add_event(@events[key]) if $game_minimap

end

end

@init_phase = false

end

 

def put_to_random_place(event)

return if event.nil?

if @init_phase

room_list = @room_list.select {|room| room.remain != 0 }

else

room_list = @room_list.select {|room| room.remain != 0 && room != $game_player.room }

end

room_list.shuffle!

loop do

if room_list.empty?

msgbox("Could not place event "+event.id.to_s+"!")

break

end

room = room_list.pop

next if room.nil?

break if room.put_to_random_place(event)

end

end

 

def setup_starting_map_event

event = @events.values.find {|event| event.starting }

event.clear_starting_flag if event

@interpreter.setup(event.list, event.event_id) if event

event

end

 

def room(x, y)

for rect in @rect_list

if rect.room.contains(x, y)

return rect.room

end

end

return nil

end

 

def spawner_passable?(x, y)

return false unless (passable?(x, y, 2) && passable?(x, y + 1, 8)) ||

(passable?(x, y, 4) && passable?(x + 1, y, 6)) ||

(passable?(x, y, 6) && passable?(x - 1, y, 4)) ||

(passable?(x, y, 8) && passable?(x, y - 1, 2))

return true

end

 

end

 

class Spriteset_Map

 

alias saba_dungeon_update update

def update

if $game_map.new_events

$game_map.new_events.values.each do |event|

@character_sprites.push(Sprite_Character.new(@viewport1, event))

end

$game_map.new_events = nil

end

saba_dungeon_update

end

 

end

 

class Game_Event

attr_reader :event

attr_accessor :event_id

attr_reader :erased

 

alias saba_dungeon_initialize initialize

def initialize(map_id, event)

saba_dungeon_initialize(map_id, event)

@event_id = event.id

end

 

def name

@event.name

end

 

alias saba_dungeon_erase erase

def erase

saba_dungeon_erase

return unless enemy?

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] -= 1

end

 

def enemy?

return name.include?("*")

end

 

end

 

class Game_Player

 

attr_accessor :room

 

alias saba_dungeon_moveto moveto

def moveto(x, y)

saba_dungeon_moveto(x, y)

$game_map.setup_player_initial_position if $game_map.dungeon?

end

 

def distance(event)

min = $game_player.distance_xy_from(event.x, event.y)

return min unless $game_player.followers.visible

$game_player.followers.visible_folloers.each do |character|

dist = character.distance_xy_from(event.x, event.y)

if dist < min

min = dist

end

end

return min

end

 

end

 

class Game_Character

 

def distance_xy_from(x, y)

sx = distance_x_from(x)

sy = distance_y_from(y)

return [sx.abs, sy.abs].max

end

 

end

 

 

Also, I added to the original script so that events with a ! in the name are random chest events, which work like enemies in that they randomly populated in much the same way enemy are, only the count of them on the map may be much less (to be exact it's the enemy step count divided by a random number between 1 and 4 right now). So if you want something to always show up, don't have a ! in the name. Everything without either a * (enemy) or ! (random chest) should just be randomly placed somewhere on the map but should always show up.

 

Honestly I coded random chest events so I could make a common random item event and just have the generator copy it the same way enemies are copied.

Edited by KilloZapit

Share this post


Link to post
Share on other sites

hi all just wondering if you lovely crazy coders have a version of "Saba Kan's Random Dungeon Generator 0.14" without the shadow and invisibility thing and a way to toggle the mimimap? I've read through all of the other posts you've had but you've removed most of the other features like the map which I still want to use

Edited by spawnthelemming

Share this post


Link to post
Share on other sites

Well I got rid of the shadow and invisibility thing with this... Here is my current edit of the minimap script if you are interested... toggling shouldn't be so hard to do... I may work on it later.

 

 

#==============================================================================

# - Dungeon Creation 6 (Minimap) KZ Edit

# @based on version 0.14 12/01/21 RGSS3

# @original author Saba Kan

# @translator kirinelf

#------------------------------------------------------------------------------

# Added a bug fix for follower sprites and hidden events.

# Also added some more debug features to test it.

#==============================================================================

module Saba

module Dungeon

PLAYER_COLOR_ID = 9 # Color ID of player on Minimap.

FOLLOWER_COLOR_ID = 1 # Color ID of followers on Minimap.

 

# Show events for the whole map on the minimap.

DEBUG_SHOW_DARK = false

# Show X marks for hidden or deleted events

DEBUG_SHOW_HIDDEN = false

end

end

 

#=========================================================================

# Do not edit anything under this line unless you know what you're doing!

#=========================================================================

 

class << DataManager

#--------------------------------------------------------------------------

# â— å„種ゲームオブジェクトã®ä½œæˆ

#--------------------------------------------------------------------------

alias saba_minimap_create_game_objects create_game_objects

def create_game_objects

saba_minimap_create_game_objects

$game_minimap = Game_MiniMap.new

end

#--------------------------------------------------------------------------

# ◠セーブ内容ã®ä½œæˆ

#--------------------------------------------------------------------------

alias saba_minimap_make_save_contents make_save_contents

def make_save_contents

contents = saba_minimap_make_save_contents

contents[:minimap] = $game_minimap

contents

end

#--------------------------------------------------------------------------

# ◠セーブ内容ã®å±•é–‹

#--------------------------------------------------------------------------

alias saba_minimap_extract_save_contents extract_save_contents

def extract_save_contents(contents)

saba_minimap_extract_save_contents(contents)

$game_minimap = contents[:minimap]

end

end

 

class Game_Map

#--------------------------------------------------------------------------

# ◠セットアップ

# map_id : マップ ID

#--------------------------------------------------------------------------

alias saba_minmap_setup setup

def setup(map_id)

saba_minmap_setup(map_id)

if dungeon?

$game_minimap.setup(self)

end

end

#--------------------------------------------------------------------------

# ◠指定ã®åº§æ¨™ã‚’マッピング

#--------------------------------------------------------------------------

def mapping(x, y)

return unless floor?(x, y)

for rect in @rect_list

if rect.room.contains(x, y)

$game_player.room = rect.room

$game_minimap.mapping_room(rect.room)

return

end

end

$game_player.room = nil

$game_minimap.mapping(x, y)

end

end

 

class Game_MiniMap

BLANK = 0 # 空ãマップ

FLOOR = 1 # 床

WALL = 2 # å£

PASSAGE = 3 # 通路

attr_accessor :changed_area

attr_accessor :cleared

attr_reader :events

#--------------------------------------------------------------------------

# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–

#--------------------------------------------------------------------------

def initialize

@map_data = {}

@events = []

end

#--------------------------------------------------------------------------

# â— ãƒžãƒƒãƒ—æƒ…å ±ã‚’åˆæœŸåŒ–

#--------------------------------------------------------------------------

def setup(map)

clear

for x in 0..map.width

for y in 0..map.height

@map_data[[x, y]] = BLANK

end

end

end

#--------------------------------------------------------------------------

# ◠マッピングã•れã¦ã„ã‚‹ã‹ï¼Ÿ

#--------------------------------------------------------------------------

def mapping?(x, y)

return @map_data[[x, y]] != BLANK

end

def floor_type(x, y)

return @map_data[[x, y]]

end

#--------------------------------------------------------------------------

# ◠部屋をマッピング

#--------------------------------------------------------------------------

def mapping_room(room)

return if room.mapping

room.mapping = true

for x in room.lx...room.hx

for y in room.ly...room.hy

@map_data[[x, y]] = FLOOR

end

end

mapping_edge(room)

@changed_area = Rect.new(room.lx-1, room.ly-1, room.width+1, room.height+1)

end

#--------------------------------------------------------------------------

# ◠部屋ã®å¤–å´ã‚’マッピング

#--------------------------------------------------------------------------

def mapping_edge(room)

for x in (room.lx-1)...(room.hx+1)

mapping_internal(x, room.ly-1)

mapping_internal(x, room.hy)

end

for y in (room.ly)...(room.hy)

mapping_internal(room.lx-1, y)

mapping_internal(room.hx, y)

end

end

#--------------------------------------------------------------------------

# â— é“をマッピング

#--------------------------------------------------------------------------

def mapping(x, y)

mapping_internal(x, y)

mapping_internal(x-1, y)

mapping_internal(x+1, y)

mapping_internal(x, y-1)

mapping_internal(x, y+1)

mapping_internal(x-1, y-1)

mapping_internal(x+1, y-1)

mapping_internal(x-1, y+1)

mapping_internal(x+1, y+1)

@changed_area = Rect.new(x-1, y-1, 3, 3)

end

#--------------------------------------------------------------------------

# â— é“をマッピング

#--------------------------------------------------------------------------

def mapping_internal(x, y)

return if mapping?(x, y)

if $game_map.floor?(x, y)

@map_data[[x, y]] = PASSAGE

else

@map_data[[x, y]] = WALL

end

end

def add_event(event)

@events.push(event)

end

#--------------------------------------------------------------------------

# ◠クリア

#--------------------------------------------------------------------------

def clear

@cleared = true

@map_data = {}

@events = []

end

end

 

class Game_Player

#--------------------------------------------------------------------------

# ◠指定ä½ç½®ã«ç§»å‹•

#--------------------------------------------------------------------------

alias saba_minimap_moveto moveto

def moveto(x, y)

saba_minimap_moveto(x, y)

$game_map.mapping(x, y)

end

#--------------------------------------------------------------------------

# ◠歩数増加

#--------------------------------------------------------------------------

alias saba_minimap_increase_steps increase_steps

def increase_steps

saba_minimap_increase_steps

$game_map.mapping(self.x, self.y)

end

end

 

 

class Sprite_MiniMap < Sprite_Base

#--------------------------------------------------------------------------

# ◠定数

#--------------------------------------------------------------------------

SQUARE_SIZE = 5

FLOOR_COLOR = Color.new(70, 70, 180, 170)

PASSAGE_COLOR = Color.new(160, 80, 160, 170)

WALL_COLOR = Color.new(0, 0, 0, 64)

#--------------------------------------------------------------------------

# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–

# viewport : ビューãƒãƒ¼ãƒˆ

#--------------------------------------------------------------------------

def initialize(viewport)

super(viewport)

viewport.z=150

@windowskin = Cache.system("Window")

@event_sprites = {}

create_bitmap

update_position

redraw_all

@follower_sprites = {}

if $game_player.followers

for follower in $game_player.followers

@follower_sprites[follower] = create_character_sprite(Saba::Dungeon::FOLLOWER_COLOR_ID)

end

end

@player_sprite = create_character_sprite(Saba::Dungeon::PLAYER_COLOR_ID)

 

update

end

#--------------------------------------------------------------------------

# ◠文字色å–å¾—

# n : 文字色番å·ï¼ˆ0..31)

#--------------------------------------------------------------------------

def text_color(n)

@windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)

end

#--------------------------------------------------------------------------

# ◠キャラクター用ビットマップã®ä½œæˆ

#--------------------------------------------------------------------------

def create_character_sprite(color)

if color >= 1000

hole = true

color -= 1000

end

if color >= 100

static = true

color -= 100

end

 

sprite_color = text_color(color)

return Sprite_MiniMap_Character.new(viewport, sprite_color, static, hole)

end

#--------------------------------------------------------------------------

# ◠ビットマップã®ä½œæˆ

#--------------------------------------------------------------------------

def create_bitmap

self.bitmap = Bitmap.new(Graphics.width, Graphics.height)

self.bitmap.font.size = 32

self.bitmap.font.color.set(255, 255, 255)

end

#--------------------------------------------------------------------------

# â— åº§æ¨™ã®æ›´æ–°

#--------------------------------------------------------------------------

def update_position

self.x = (Graphics.width - SQUARE_SIZE * $game_map.width)

self.y = 0

end

#--------------------------------------------------------------------------

# ◠転é€å…ƒãƒ“ãƒƒãƒˆãƒžãƒƒãƒ—ã®æ›´æ–°

#--------------------------------------------------------------------------

def update_bitmap

rect = $game_minimap.changed_area

return unless rect

$game_minimap.changed_area = nil

for x in rect.x..(rect.width + rect.x)

for y in rect.y..(rect.height + rect.y)

case $game_minimap.floor_type(x, y)

when Game_MiniMap::FLOOR then

color = FLOOR_COLOR

when Game_MiniMap::WALL then

color = WALL_COLOR

when Game_MiniMap::PASSAGE then

color = PASSAGE_COLOR

else

next

end

self.bitmap.fill_rect(x*SQUARE_SIZE, y*SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, color)

end

end

end

 

def redraw_all

self.bitmap.clear

for x in 0..$game_map.width

for y in 0..$game_map.height

case $game_minimap.floor_type(x, y)

when Game_MiniMap::FLOOR then

color = FLOOR_COLOR

when Game_MiniMap::PASSAGE then

color = PASSAGE_COLOR

when Game_MiniMap::WALL then

color = WALL_COLOR

else

next

end

self.bitmap.fill_rect(x*SQUARE_SIZE, y*SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE, color)

end

end

end

#--------------------------------------------------------------------------

# ◠フレーム更新

#--------------------------------------------------------------------------

def update

super

clear if $game_minimap.cleared

update_bitmap if $game_minimap.changed_area

update_visibility

update_player

update_events

end

#--------------------------------------------------------------------------

# â— å¯è¦–çŠ¶æ…‹ã®æ›´æ–°

#--------------------------------------------------------------------------

def update_visibility

#self.visible = $game_timer.working?

end

#--------------------------------------------------------------------------

# â— ãƒ—ãƒ¬ã‚¤ãƒ¤ãƒ¼ã®æ›´æ–°

#--------------------------------------------------------------------------

def update_player

@player_sprite.x = self.x + $game_player.x * SQUARE_SIZE

@player_sprite.y = self.y + $game_player.y * SQUARE_SIZE

 

for follower in $game_player.followers

sprite = @follower_sprites[follower]

sprite.erased = !follower.visible?

sprite.visible = Saba::Dungeon::DEBUG_SHOW_HIDDEN ? true : follower.visible?

sprite.x = self.x + follower.x * SQUARE_SIZE

sprite.y = self.y + follower.y * SQUARE_SIZE

end

end

#--------------------------------------------------------------------------

# â— å…¨ã‚¤ãƒ™ãƒ³ãƒˆã®æ›´æ–°

#--------------------------------------------------------------------------

def update_events

for event in $game_map.events.values

eraseme = event.erased || (event.character_name == "" && event.tile_id == 0)

sprite = @event_sprites[event.event_id]

 

if Saba::Dungeon::DEBUG_SHOW_HIDDEN

sprite.erased = eraseme if sprite

elsif eraseme

if sprite

sprite.dispose

@event_sprites.delete(event.event_id)

end

$game_map.events.delete(event.event_id) if event.erased

next

end

 

update_event(event)

end

end

#--------------------------------------------------------------------------

# â— ã‚¤ãƒ™ãƒ³ãƒˆã®æ›´æ–°

#--------------------------------------------------------------------------

def update_event(event)

if @event_sprites[event.event_id]

sprite = @event_sprites[event.event_id]

else

sprite = create_character_sprite(event.name.to_i)

@event_sprites[event.event_id] = sprite

end

if sprite.static

sprite.visible = $game_minimap.mapping?(event.x, event.y)

else

sprite.visible = false

if $game_player.room

sprite.visible = $game_player.room.contains(event.x, event.y)

end

sprite.visible |= $game_player.distance(event) == 1

end

if Saba::Dungeon::DEBUG_SHOW_DARK

sprite.opacity = sprite.visible ? 255 : 128

sprite.visible = true

end

sprite.x = self.x + event.x * SQUARE_SIZE

sprite.y = self.y + event.y * SQUARE_SIZE

end

 

def next_enemy_sprite

unless @spare_enemy_sprites.empty?

return @spare_enemy_sprites.pop

else

return create_character_sprite(true)

end

end

#--------------------------------------------------------------------------

# ◠クリア

#--------------------------------------------------------------------------

def clear

self.bitmap.clear

update_position

@event_sprites.values.each {|s| s.dispose }

@event_sprites = {}

$game_minimap.cleared = false

end

#--------------------------------------------------------------------------

# ◠解放

#--------------------------------------------------------------------------

def dispose

self.bitmap.dispose

@player_sprite.bitmap.dispose

@player_sprite.dispose

for sprite in @event_sprites.values

sprite.dispose

end

for sprite in @follower_sprites.values

sprite.dispose

end

super

end

 

def visible=(value)

return if visible == value

super

@player_sprite.visible = value

for sprite in @follower_sprites.values

sprite.visible = value

end

for sprite in @event_sprites.values

sprite.visible = value

end

end

end

 

class Sprite_MiniMap_Character < Sprite_Base

attr_reader :static

attr_reader :erased

#--------------------------------------------------------------------------

# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–

# viewport : ビューãƒãƒ¼ãƒˆ

#--------------------------------------------------------------------------

def initialize(viewport, color, static, hole)

super(viewport)

@alive = true

@erased = false

@color = color

@static = static

@hole = hole

@state = 0

if @color

create_bitmap

update

else

self.visible = false

end

end

#--------------------------------------------------------------------------

# ◠ビットマップã®ä½œæˆ

#--------------------------------------------------------------------------

def create_bitmap

return if @color.nil?

size = Sprite_MiniMap::SQUARE_SIZE

self.bitmap = Bitmap.new(size, size)

if @erased

for i in 0..size

self.bitmap.set_pixel(i, i, @color)

end

for i in 0..size

self.bitmap.set_pixel(size-i, i, @color)

end

elsif @hole

self.bitmap.fill_rect(0, 0, size, 1, @color)

self.bitmap.fill_rect(0, size-1, size, 1, @color)

self.bitmap.fill_rect(0, 1, 1, size-2, @color)

self.bitmap.fill_rect(size-1, 1, 1, size-2, @color)

else

self.bitmap.fill_rect(0, 0, size, size, @color)

end

end

#--------------------------------------------------------------------------

# ◠解放

#--------------------------------------------------------------------------

def dispose

self.bitmap.dispose if self.bitmap

super

end

 

def erased=(value)

if value != @erased

@erased = value

self.bitmap.dispose if self.bitmap

create_bitmap

end

end

 

end

 

class Spriteset_Map

attr_reader :character_sprites

#--------------------------------------------------------------------------

# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–

#--------------------------------------------------------------------------

alias saba_minimap_initialize initialize

def initialize

saba_minimap_initialize

 

@mini_map = Sprite_MiniMap.new(@viewport2)

if $game_map.dungeon?

update

else

@mini_map.visible = false

end

end

#--------------------------------------------------------------------------

# ◠解放

#--------------------------------------------------------------------------

alias saba_minimap_dispose dispose

def dispose

saba_minimap_dispose

@mini_map.dispose if @mini_map

end

#--------------------------------------------------------------------------

# ◠フレーム更新

#--------------------------------------------------------------------------

alias saba_minimap_update update

def update

saba_minimap_update

return unless @mini_map

if $game_map.dungeon?

@mini_map.visible = true

@mini_map.update

else

@mini_map.visible = false

end

end

#--------------------------------------------------------------------------

# ◠クリア

#--------------------------------------------------------------------------

def clear_minimap

@mini_map.clear

end

end

 

 

Really I didn't remove that much (and added or fixed quite a bit) I might move things around a bit more. I have like 8 scripts in total (and 4 common events) just related to dungeons I am fiddling with, though most are rather minor silly things.

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Changed the event control script. It finally generates a dungeon without error but there's 2 problems. 1st, it doesn't place any of my events around. They even have the ! at the end of their event name. 2nd, that no visability unless in the same room crap. It did handle placement of enemies but they wouldn't appear until it was like 2 tiles away, in a large room. Do you think you can figure out how to fix the events not showing up & the visability problem? I'm looking forward to seeing this fully functional, & every fix you make gets us one step closer to a universal random dungeon generator that just about anyone can plug in & use, so I appreciate all your work on this, since no one else wants to take this task on, so thank you.

 

I think I mentioned the visibility thing before... but it's pretty simple to get rid of.

 

Try this:

 

 

#==============================================================================

# - Dungeon Creation 6 (Events) KZ Edit

# @based on version 0.14 12/01/21 RGSS3

# @original author Saba Kan

# @translator kirinelf

#------------------------------------------------------------------------------

# Put all event logic here for easier access and stuff.

#==============================================================================

 

class Room

 

def put_to_random_place(event)

tiles = []

for i in @lx...@hx

for j in @ly...@hy

next if event.collide_with_characters?(i, j)

#next if i == $game_player.x && j == $game_player.y

next unless $game_map.floor?(i, j)

next unless $game_map.spawner_passable?(i, j)

next if @events[[i, j]] != nil

next if @couple_areas.include?([i, j])

tiles.push([i, j])

end

end

return false if tiles.empty?

key = tiles.sample

@events[key] = event

event.moveto(key[0], key[1])

return true

end

 

end

 

class Game_Map

attr_accessor :new_events

 

def setup_player_initial_position

put_to_random_place($game_player) unless floor?($game_player.x, $game_player.y)

end

 

def setup_dungeon_events

@next_enemy_event_id = 10000

@enemy_events = []

@chest_events = []

 

for event in @events.values

if event.event.name.include?("*")

@enemy_events.push(event.event)

self.events[event.id].erase

elsif event.event.name.include?("!")

@chest_events.push(event.event)

self.events[event.id].erase

else

put_to_random_place(event)

end

end

setup_enemy

end

 

def setup_enemy

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] = 0

return if @enemy_events.count == 0

n = @map.encounter_step

n.times do |i|

add_random_enemy

end unless @enemy_events.empty?

(n / (rand(3)+1)).times do |i|

add_random_chest

end unless @chest_events.empty?

end

 

def add_random_enemy

return if @enemy_events.empty?

add_enemy(rand(@enemy_events.count))

end

 

def add_random_chest

return if @chest_events.empty?

add_chest(rand(@chest_events.count))

end

 

def add_enemy(event_id)

enemy_event = @enemy_events[event_id]

event = Game_Event.new(@map_id, enemy_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] += 1

end

 

def add_chest(event_id)

chest_event = @chest_events[event_id]

event = Game_Event.new(@map_id, chest_event)

 

@new_events = {} unless @new_events

@new_events[@next_enemy_event_id] = event

 

event.event_id = @next_enemy_event_id

@next_enemy_event_id += 1

puts("Chest event "+chest_event.id.to_s+" created.")

end

 

alias saba_randomdungeon_update_events update_events

def update_events

saba_randomdungeon_update_events

if @new_events

for key in @new_events.keys

@events[key] = @new_events[key]

put_to_random_place(@events[key])

$game_minimap.add_event(@events[key]) if $game_minimap

end

end

@init_phase = false

end

 

def put_to_random_place(event)

return if event.nil?

if @init_phase

room_list = @room_list.select {|room| room.remain != 0 }

else

room_list = @room_list.select {|room| room.remain != 0 && room != $game_player.room }

end

room_list.shuffle!

loop do

if room_list.empty?

msgbox("Could not place event "+event.id.to_s+"!")

break

end

room = room_list.pop

next if room.nil?

break if room.put_to_random_place(event)

end

end

 

def setup_starting_map_event

event = @events.values.find {|event| event.starting }

event.clear_starting_flag if event

@interpreter.setup(event.list, event.event_id) if event

event

end

 

def room(x, y)

for rect in @rect_list

if rect.room.contains(x, y)

return rect.room

end

end

return nil

end

 

def spawner_passable?(x, y)

return false unless (passable?(x, y, 2) && passable?(x, y + 1, 8)) ||

(passable?(x, y, 4) && passable?(x + 1, y, 6)) ||

(passable?(x, y, 6) && passable?(x - 1, y, 4)) ||

(passable?(x, y, 8) && passable?(x, y - 1, 2))

return true

end

 

end

 

class Spriteset_Map

 

alias saba_dungeon_update update

def update

if $game_map.new_events

$game_map.new_events.values.each do |event|

@character_sprites.push(Sprite_Character.new(@viewport1, event))

end

$game_map.new_events = nil

end

saba_dungeon_update

end

 

end

 

class Game_Event

attr_reader :event

attr_accessor :event_id

attr_reader :erased

 

alias saba_dungeon_initialize initialize

def initialize(map_id, event)

saba_dungeon_initialize(map_id, event)

@event_id = event.id

end

 

def name

@event.name

end

 

alias saba_dungeon_erase erase

def erase

saba_dungeon_erase

return unless enemy?

$game_variables[saba::Dungeon::ENEMY_COUNT_VARIABLE] -= 1

end

 

def enemy?

return name.include?("*")

end

 

end

 

class Game_Player

 

attr_accessor :room

 

alias saba_dungeon_moveto moveto

def moveto(x, y)

saba_dungeon_moveto(x, y)

$game_map.setup_player_initial_position if $game_map.dungeon?

end

 

def distance(event)

min = $game_player.distance_xy_from(event.x, event.y)

return min unless $game_player.followers.visible

$game_player.followers.visible_folloers.each do |character|

dist = character.distance_xy_from(event.x, event.y)

if dist < min

min = dist

end

end

return min

end

 

end

 

class Game_Character

 

def distance_xy_from(x, y)

sx = distance_x_from(x)

sy = distance_y_from(y)

return [sx.abs, sy.abs].max

end

 

end

 

 

Also, I added to the original script so that events with a ! in the name are random chest events, which work like enemies in that they randomly populated in much the same way enemy are, only the count of them on the map may be much less (to be exact it's the enemy step count divided by a random number between 1 and 4 right now). So if you want something to always show up, don't have a ! in the name. Everything without either a * (enemy) or ! (random chest) should just be randomly placed somewhere on the map but should always show up.

 

Honestly I coded random chest events so I could make a common random item event and just have the generator copy it the same way enemies are copied.

Changed the script & the visibility problem was solved. The chests & other stuff finally appear, but sometimes the chests get crammed together in small rooms & sometimes even forms a wall that blocks you off. I sense a slight flaw in where the random chests get placed. It would be nice if the number of chests was restricted based on the room size, like only 1 or 2 in 3x3 to 5x5 rooms. Also I notice 2 pre-existing problems occur. One is it won't let you leave some tiles spots blank. Works fine when you place a tile in each spot, but if you leave the ceiling & wall tiles blank it won't even place the floor tiles & gives errors for all the enemy & chest events. It also screws up even when you do place tile in all the spots. It either places the wrong tile or it ignores the wall tiles & lets you walk on ceiling tiles even though the passability setting shows an X for that tile.

 

These problems were already present in Saba kan's script so it's not your fault, but I was hoping you could look into it to see if you could find a solution for it, otherwise the random dungeon generator is far from perfect, yet alone functional. Sorry for the repeated requests & I appreciate the help. Also, I would post screenshots for specifics but the site won't let me upload an image greater than 49.56K, which is not enough for even a single pic.

Share this post


Link to post
Share on other sites

For the chests I recommend making them vanish after they are opened. I did actually make a script to place random pillars around actually, and making sure a room was never impassible by simply never allowing them to spawn around the edge of the room. It doesn't strike me as the best solution for chests though.

 

And yeah the script is rather inflexible when it comes to walls and floors and stuff. Partly I think it's because of autotile stuff, the script uses fixed offsets for walls and stuff. Also remember that you need to hold down shift or something to disable autotiles when placing what tiles the dungeon uses, or else it will mess up. If I knew more about how autotiles worked, I would probably just make a more general script that would just smooth every tile on every layer, which would allow me to rewrite the tile placement code to be much much less restrictive.

Share this post


Link to post
Share on other sites

AAAAAAAAAHH I used your versions of the 3 scripts and now there are millions of monsters AAAAAH what do I doooo? what does the monster generation rely on to generate more monsters now? in the old script it used the maps steps average but I don't know what to change

 

edit: ooooops nevermind i figured it out it was because i still had the event to generate new monsters from the old system

Edited by spawnthelemming

Share this post


Link to post
Share on other sites

It still uses the map step. Also with my turnbased movement (can hardly be called a battle system) a monster's movement speed is based on their walking speed and step frequency relative to your own. You give them 2x speed, they get two steps to your one. It also works in reverse. If a monster's movement speed is half yours they only get one movement for every two of yours. Though if you just want to speed up the animation, when you dash, they dash too. I use yanfly's system option script which allows an auto dash.

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Well, it's not something that is obvious, and the old turn based movement system didn't do that. :3 I needed to do a bit of fiddling to get it to work right too. :3 Honestly my turn based movement system is probably not the best to have a battle system based on because it moves everything at the same time and waits until events are done moving, meaning attacks and things would have to be done between rounds (ether at the start or end of one), which probably isn't too bad really.

 

Also: I have switch one activate turn based movement (can be pretty easily changed neer the top if you rather use another switch or something), and I added a "pass" button (the :A input, I think that is space?)

Edited by KilloZapit

Share this post


Link to post
Share on other sites
:D well it seems fine so far a bit joggy every few turns but still works fine ooooooo the pass button seems to be on shift which i think is sprint isnt it? oh one more thing how do I (safely) make monsters auto spawn?

Share this post


Link to post
Share on other sites

yeah, sometimes it has to wait a bit between turns for all the events to catch up, especially if there are some double speed events nearby. Hehe I guess it is shift. To be honest I forgot :3

 

As for making monsters auto spawn safely, you need to make sure it checks to make sure the enemy count variable is less then or equal to zero in a conditional branch before running the $game_map.add_random_enemy script. I would also add a wait command to the event. No need for it to check every single frame. :3 I am not sure why it wouldn't work if you do that.

Share this post


Link to post
Share on other sites

For the chests I recommend making them vanish after they are opened. I did actually make a script to place random pillars around actually, and making sure a room was never impassible by simply never allowing them to spawn around the edge of the room. It doesn't strike me as the best solution for chests though.

 

And yeah the script is rather inflexible when it comes to walls and floors and stuff. Partly I think it's because of autotile stuff, the script uses fixed offsets for walls and stuff. Also remember that you need to hold down shift or something to disable autotiles when placing what tiles the dungeon uses, or else it will mess up. If I knew more about how autotiles worked, I would probably just make a more general script that would just smooth every tile on every layer, which would allow me to rewrite the tile placement code to be much much less restrictive.

 

Yeah the autotiles fail miserablely. I tried using the red carpet tiles for the floor & it instead used the red charred tiles. If the generator won't utilize autotiles then this could be a problem. Some of the themes in my dungeon use autotiles like the red carpet tiles or shallow water tiles. If this doesn't work I fear the worst case scenario; making a minimum of 30 to 50 pre-generated rooms per theme, & since there's 20 themes, that around 600 to 1000 maps & I'm sure the limit of maps is 999. That's too much just for 1 dungeon & my world map is split into 9 sections, each one 500x500, which means I plan on making a long game with plenty of maps including towns & dungeons. That's why having a random dungeon generator is important for me. I would only need 2 rooms per theme going back & forth until my floor variable is high enough then move on to the next pair of rooms. 2 rooms times 20 themes is only 40 maps I have to make, much easier. As for the chests, I've never considered making them dissappear, but I might consider it now, but I think I'll just have less chest to generate & see if that helps.

Share this post


Link to post
Share on other sites

Autotiles are built into the editor not the game engine, so it's not like you can just call a method to place them. On top of that I have no idea what tile numbers are used for them. I guess I could do some experiments on it.

Share this post


Link to post
Share on other sites

I don't see why not... just don't use the turn based movement script and set up the events right, I guess...

Share this post


Link to post
Share on other sites

ok this is an amazing setup ..really it is.

 

but i am having a problem ,in like 3 out of 5 test runs when i enter into the first floor area im outside of  the playable area , it generates the map in a way that it puts me outside of the walkable area ?

 

any ideal how to fix this ? 

 

**ok i just ran it again made it past the first floor and now it happened on the second floor area also here is a image of it 

 

post-20718-0-64669800-1381037405_thumb.png

Edited by cazziuz

Share this post


Link to post
Share on other sites

Does it work right without the battle system by any chance? I really should post a better full version of this sometime, I think I have done a ton of stuff on it since I posted anything here.

Share this post


Link to post
Share on other sites

Yeah it works with out the battle system , is there any way to make it work with a battle system ?  im trying to use falcaos Liquid pearl v2 since i am familiar with that one , but it it will work with a different one i am willing to try and learn how to use  it ,lol. and this is just my opinion on this , but please if you have a newer version than what is posted here , then please do post it :) personally i love what you have done with it as of the posting here.

 

-Cazziuz

Share this post


Link to post
Share on other sites

If it works without the battle system I can only assume the battle system counts it's player x and y in pixels rather then tiles. I could be wrong though. Seems like it would be hard to fix if that is the case, as there is a lot of internal changes that would have to be made. I think I will release a new version sometime soon maybe, but I really should clean it up and make a widdle demo thing first given the insane amount of weird features I added.

Share this post


Link to post
Share on other sites

ok, thank you for your help ,and i will be waiting patiently,lol for the little demo :) 

 

again thanks for your help 

 

-Cazziuz

Share this post


Link to post
Share on other sites

I finished up a widdle demo and posted it in my blog here. It may or may not be helpful to you, because there are a lot of scripts involved. It's probobly more useful for coders and people who want to fiddle with it really. Makes much prettier levels though I think :3

Share this post


Link to post
Share on other sites

first let me say thank you for uploading the demo :) it is an amazing script set :):) :)

 

second just so you know , i keep getting errors when i am in the maps , so far it has happened 3 times here are some images from the errors:

 

post-20718-0-90958400-1381169966_thumb.png

post-20718-0-13541700-1381169996_thumb.png

post-20718-0-59814000-1381170004_thumb.png

 

please note i am not complaining i just wanted to let you know about the errors.

 

again thank you for your time and error on these scripts :):)

 

-Cazziuz

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted