Jump to content
  • entries
    63
  • comments
    523
  • views
    64,610

Super Dungeon Demo Thing

Kayzee

6,766 views

I decided to release a small demo/base/thing for my modifications of Saba Kan's random dungeon scripts. Attached here is a very striped down demo, but hopefully some people will find it useful as a base or something.

 

dungeondemo.zip

 

Included are seven different maps that hopefully show off some examples of different types of levels. Look in the map properties notes for some of the different options. There is only one type of enemy and a dummy chest item for examples in each map for now, and some maps have traps. There are things I wrote that I didn't include here like dungeon enemy level scaling and randomly choosing items for the chest just to simplify stuff.

 

(Made some basic documentation here.)

 

Edit: Updated to make traps work right, and added the blank tileset for dummy map.

 

Edit 2: Few more bugs due to left over code fixed.

 

Edit 3: Added code to randomize rect devision more, and to subdevide blocks more. Updated the sample dungeons to reflect this (mostly Dark Place, it's insanly cramped and maze like now). Also traps shouldn't spawn on top of other traps anymore, and the entity placement may be faster.

 

Edit 4: Fixed a big bug related to room lights not being disposed and makeing games not save right.

 

Edit 5: Added code to make paths across map edges for wraping maps.

 

Edit 6: Small fix for using this with the new version of my Cache Back script.

 

Edit 7: Fixed shops and added the missing script to fix the debug shop work.



56 Comments


Recommended Comments



Haii KZ

After fiddling with this for a while, I've gotta ask. Did you write a tutorial for it?  xD

I can't figure out what the bracketed numbers are for in the Map Names, and I don't understand the importance of *s and !s in event naming....    xO

Share this comment


Link to comment

The braketed numbers were for level scaling buuut I didn't include that feature in my demo cause it relays on a enemy level script, so just ingnore that. * and ! are for enemy and chest events (also $ for traps) which spawn at diffrent rates and such. Also if you want to be confused look at the various notes in the map properties. I have so many extended random properties I load from them. :D

 

Yeah, documentation is gonna be a bitch whenever I get around to it. That's one reason why it's only on my blog and not anywhere on the fourm. Maybe I will make my next blog post about some documentation or notes.

Share this comment


Link to comment

In saba's version I am using pearl and it made an error in the Game Interpreter that caused me to lose my Self-Switches. I think it deals with the names of enemies starting with < . Does your's have this problem?

Share this comment


Link to comment

 

I am not sure what error you mean, never used pearl myself so I couldn't help much with that. You mean events starting with "<"? I am not sure it would matter, but if your going to use randomly spawned events like the random dungeon script does, self switches would probably not work right for them. Unless you mean all self-switch data gets erased. Why do you start event names with < anyway? Events kinda need special names to work right with this. Been thinking of moving the data you put in the name to comment tags instead though.

Share this comment


Link to comment

Right now, it would appear that the random dungeon generator only copies the first page of each event. Would it be possible to have it copy the entire event, so that multi-page events can be used in dungeons?

Share this comment


Link to comment

Right now, it would appear that the random dungeon generator only copies the first page of each event. Would it be possible to have it copy the entire event, so that multi-page events can be used in dungeons?

Multi-page events work, the only thing I know for sure that dosn't is self-switches because events are given new event numbers, so if your using self switches to select a event's page then that will fail.

 

If you need a better way to change a individual event's page, I tend to use this little script:

 

 

class Game_Event < Game_Character
  
  # make some private members readable
  attr_reader :erased

end

class Game_Event < Game_Character
  
  def real_id
    return (defined? self.event_id) ? self.event_id : self.id
  end
  
  alias_method :find_proper_page_set_base, :find_proper_page
  def find_proper_page
    return find_proper_page_set_base unless @force_page
    return conditions_met?(@force_page) ? @force_page : nil
  end
  
  def get_event_page(page_id, event_id, map_id)
    if map_id == $game_map.map_id
      map = $game_map
    else
      map = load_data(sprintf("Data/Map%03d.rvdata2", map_id))
      if map.nil?
        puts "Map:" + map_id.to_s + " isn't a callable map."
        return nil
      end
    end
    event = map.events[event_id]
    event = event.event if event.is_a?(Game_Event)
    if event.nil?
      puts "Event:" + event_id.to_s + " isn't a callable event."
      return nil
    end
    page = event.pages[page_id-1]
    if page.nil?
      puts "Page:" + page_id.to_s + " isn't a callable page."
      return nil
    end
    return page
  end
  
  def set_page(page_id, event_id = real_id, map_id = $game_map.map_id)
    return if @erased
    if page_id == 0 || page_id.nil?
      @force_page = nil
      refresh
      return
    end
    page = get_event_page(page_id, event_id, map_id)
    return unless page
    @force_page = page
    refresh
  end
  
  def call_page(page_id = nil, event_id = real_id, map_id = @map_id)
    return if @erased
    if page_id == 0 || page_id.nil?
      page = @page
    else
      page = get_event_page(page_id, event_id, map_id)
    end
    return unless page
    @call_depth ||= 0
    child = Game_Interpreter.new(@call_depth += 1)
    child.setup(page.list, real_id)
    child.run
    @call_depth = 0
  end
  
end

 

 

then I can use it in a script block in an event like this:

 

$game_map.events[@event_id].set_page(1)

Share this comment


Link to comment

Oh, that's interesting. I'll give that a try. Thanks.

 

Awesome job on the changes you made to the generator, btw.

Making it modular has made it soooo much easier to use.

Share this comment


Link to comment

Thankies! I like making things as modular as possible so it's easier to find problems and swap out stuff you don't want. I guess the downside is though that it's harder o tell what you need to copy over if you wanna add it to a project. Even the main script is divided into at least three scripts and requires the "Note Field Hash" script.

Share this comment


Link to comment

Hey there, Just started a fresh project, I'm attempting to transfer and or spawn on the generated map. Only to be given an error in script line 415.

Script: [insert script name here] line 415: NameError Occurred.

Undefined local variable or method 'note_field' for #<GameMap:0x82f1f54

The line itself I'm not sure but think is an array for Max_Splits.

Any idea's? 

Share this comment


Link to comment

The demo includes a required script called 'Note Field Hash' that I use for reading lots of data from the map's notes. Really I don't recommend you start a fresh project and transfer the scripts because a lot of the scripts are kinda interdependent that way... You can get rid of quite a few of the scripts but it isn't as easy to use as a plug in and play system... that's one reason why I didn't release it in the completed scripts forum.

Share this comment


Link to comment

So I've been fiddling with both this and the original version for a while now and I can't get either of them to work with any ABS system, do you know of an ABS system that works with this and if so how to set it up?

Share this comment


Link to comment

Sorry I don't use ABS scripts so I wouldn't know. There may be some other people that might help though, it seems like it's popular to use my dungeon scripts with an ABS script for some reason.

Share this comment


Link to comment

Sorry I don't use ABS scripts so I wouldn't know. There may be some other people that might help though, it seems like it's popular to use my dungeon scripts with an ABS script for some reason.

Yeah it makes it into a roguelike system, if anyone knows how to do it tell me.

Share this comment


Link to comment

Ah, so it looks like it's a problem with the enemy event names being in <>, pretty much every ABS system does that with some variation of <enemy: 02> or whatever the ID of the enemy is, do you have any idea of how that error could be fixed?

 

Edit: There are a bunch of other issues too, that I cant figure out the cause of. But this seems to be one of the big ones.

Share this comment


Link to comment

Really? First I heard of that problem. Why would ABS scripts need event names in that format? Unfortunately, Saba Kan's dungeon script uses event names for special things.

 

As a side note, I am really unsure how a "Action Battle System" that is real time and usually uses pixel based movement is at all the same thing as a classic Roguelike turn based and grid based battle system, other then maybe that they are both on map, but if you say so. It should be noted I already more or less have a roguelike battle system in the demo already, I just can't figure out for the life of me how to do attacks right. I have tried, but for some reason they always mess up the turn order. I really have to redesign the whoile movement system someday, but don't expect that to happen any time soon.

Share this comment


Link to comment

Oh, By the way. i love this script and I have already made a game from it (only letting friends and such play at the moment). Personally, I feel that a non ABS system is much more rogue-like, and the entering a battle when encountering an enemy is interesting. That being said, that are many other uses for random dungeons, so, having the ABS compatibility is key. Also, from what I understand, this is a relatively new thing, so i feel there'll be more to come later on down the road.

Share this comment


Link to comment

I actually have a script that turns a ABS into a turn based system (It's similar to the turn based movement script but it also does attacks) Also XAS is not pixel based, I'm not a fan of pixel based systems as much to be honest. the ABS systems do names that way for a similar reason that the dungeon generator does it, it tells it which events are enemies and in the case of an ABS it tells it what ID the enemy is so the script knows it's stats and also it's animations (such as it's death animation which is part of the comments of the enemy in the database.) However it also seems to have incompatibility issues beyond that, because even if I don't create any ABS enemies and just leave everything the same other then adding the scripts, it will throw an error when I enter any of the dungeons.

Share this comment


Link to comment

Oh I see! I would like to see that... I guess I could try and fiddle with it a bit, but right now I don't have RPG Maker VX ace set up on my computer. I am sure people have used some ABS before though.

Share this comment


Link to comment

Here's a link to the english translation of XAS: http://www.rpgmakervxace.net/topic/18602-xas-abs-english-script-fully-translated/

in case you get a chance to have a look, or if anyone else wants to have a look. The script that makes it turn based is this:

 

 

 

module Kal
module TurnMove
# Enable or disable turn movement.
ENABLE = true
# If you want to use a switch to enable turn movement.
SWITCH = nil
# Only events that have the following comment string as a comment
# on their first page are affected. Set to nil or false if you don't
# want to use this option.
COMMENT = "turn-move"
end
end

class Game_Event


alias_method :update_self_movement_turnmove_kal, :update_self_movement
def update_self_movement
return if is_turnmove_kal? && !$game_player.moving?
update_self_movement_turnmove_kal
end


def is_turnmove_kal?
return false unless Kal::TurnMove::ENABLE
switch = Kal::TurnMove::SWITCH
return false if switch && !$game_switches[switch]
comment = Kal::TurnMove::COMMENT
return false if comment && !has_comment_turnmove_kal?
true
end


def has_comment_turnmove_kal?
comments = @event.pages.first.list.select do |command|
command.code == 108 || command.code == 408
end
comments.any? { |c| c.parameters.first.include?(Kal::TurnMove::COMMENT) }
end
end

 

 

 

To be honest I'm not sure how it works, but somehow that makes the event movement and attacking turn based. I assume it has something to do with the way XAS handles the enemy attacks.

Share this comment


Link to comment

Yeah I am pretty sure I had that turnmove script before, and it's crap. It doesn't synchronize the player movement or have a way of having different movement rates, or anything. The turnbased movement script I use in my dungeon demo is much much better.

Share this comment


Link to comment

×