Chaos Project

RPG Maker => General Discussion => Topic started by: Ryex on May 10, 2009, 09:48:57 pm

Title: Options YOU want on a CMS's options screen.
Post by: Ryex on May 10, 2009, 09:48:57 pm
All right as it stands right now school has finally let up enough that i can get back to work on ms script, but before I continue I need to come up with a list of options that are going to be on the menu.

so far the list of options that WILL be included are:

*BGM volume
*SFX volume
*Font
*Window skin

Options that are up for inclusion IF people want this

* dividing the Window skin option in two and making it so you can select the default window skin and the menu window skin individually
* open for suggestions

Now DON'T post here telling me that it is my CMS and to do what i want I'm VERY indecisive and if it is left to me I will likely procratanate to the end of time.
PLEASE post confirming the current options, asking for new ones, OR ask for one NOT to be included.

you input is greatly appreciated

~Ryex
Title: Re: Options YOU want on a CMS's options screen.
Post by: Starrodkirby86 on May 10, 2009, 10:56:11 pm
Some of the best options can be customizable options that will be painless towards an Option script.

Such examples can be a Letter-by-Letter message speed, Message color, Dash, etc. (Which I'm mostly basing off from Final Fantasy's GBA versions)

This is if you want to make this public.

If you're making it private, you're still able to do that up there. Some of the best options are truly integrated into the game and aren't just universal plug-in and you're done.

I don't know any other suggestions to put at the moment.
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 10, 2009, 11:30:14 pm
this will be a public script I'm just trying to think of universal options that could be useful in game :P
Title: Re: Options YOU want on a CMS's options screen.
Post by: OracleGames on May 11, 2009, 04:53:40 am
some games have difficulty settings you can change during the game
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 11, 2009, 07:33:41 am
Quote from: OracleGames on May 11, 2009, 04:53:40 am
some games have difficulty settings you can change during the game



But in an RPG, that can be used to just tone down the difficulty in the hard parts and set it to hard in the easier parts. That's cheating >_<
Title: Re: Options YOU want on a CMS's options screen.
Post by: Blizzard on May 11, 2009, 08:08:08 am
I think that font and windowskin options shouldn't be included. I only used it in CP because the graphical style is not consistent anyway. With the proper font and skin you can breath in some live and atmosphere into a game so the player shouldn't actually be able to change that.
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 13, 2009, 06:03:28 pm
Oh, yeah: Plug-In API, so that other people can add options easy. Nothing too complex, maybe just an array of Procs to be launched when a user selects an option from the menu. ie

class RyexCMS
  PLUGINS = []
  class PlugIn < Proc
  def initialize( name )
    super()
    @name = name
  end
end


Then add an option for each and have PLUGINS[<id>].call when that option is selected.
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 14, 2009, 11:13:31 pm
Um WcW? while it sounds like a great idea I not sure how that would work... like you select an option from the menu and it calls
RyexCMS::PLUGINS[<plugin id>].< method name>
? your going to add a little more about what you mean i'm not a Blizzard yet
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 15, 2009, 04:43:48 pm
I'm talking about Ruby's built-in Proc class, which is basically an object-oriented method (more like a conventional function, I guess.)

To create a Proc:

myProc = Proc.new do
  # do stuff
end

and then, to call it:

myProc.call

if you want arguments:

Foo = Proc.new do |bar|
  print bar # just an example
end

call it with arguments:

Foo.call 'abc'
Foo.call 'test'
Foo.call 'bar' # all of these just print the string :P


So, my idea was to make a subclass of Proc, called "PlugIn" or something, which also stores data on what type of plug-in it is. However, it turns out that you can't subclass Proc. So, instead, we should make a class that just has procs:

class PlugIn
  # make @name, @reqs, and @action
  # read/write-able
  attr_accessor :name, :reqs, :action

  def initialize( name = '', reqs = nil )
    # @name is the name which will show up in the menu,
    # @reqs is the Proc that will be called to see if the option should
    # be activated (optional),
    # and @action is the proc that will be called when
    # the option is selected.
    @name, @reqs, @action = name, reqs, Proc.new
  end

  def call(*args)
    @action.call(args)
  end

  def check(*args)
    @reqs.all(args)
  end
end


Make an array of those; then, when someone wants to make a plug-in, they will just make a script like this:

if $RyexCMS
  RyexCMS::PLUGINS.push(RyexCMS::Plugin.new('My New Option') do
    # do stuff
  end
else
  print "You do realize that you have an add-on installed for a CMS you don't, right?"
end
Title: Re: Options YOU want on a CMS's options screen.
Post by: Blizzard on May 15, 2009, 05:54:21 pm
Way to waste memory. I hope your window won't have too many options then. I'd hate to see RMXP use actually 10 processes or something like that.
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 15, 2009, 06:29:51 pm
...what the crap are you talking about? Ten processes? Are you thinking of Threads, Blizz? 0_0
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 15, 2009, 09:53:54 pm
oh i get it so...

if $RyexCMS
  RyexCMS::PLUGINS.push(RyexCMS::Plugin.new('shop') do
    $Scene = Scene_Shop.new
  end
end

would add a Proc that would call Scene_shop to the Plugins array

and...

for i in 0...RyexCMS::PLUGINS.size
  self.contents.draw_text(<x>, <y> + 32*i, <width>, <height>, RyexCMS::PLUGINS[i].name)
end


would print the name of all the plugins
and...


for i in 0...RyexCMS::PLUGINS.size+2
  case @option_window.index
  when i
    if i == 0
      #change BGM volume
    elsif i == 1
      #change SFX volume
    else
      if RyexCMS::PLUGINS[i-2].check(<args>)
        RyexCMS::PLUGINS[i-2].call(<args>)
      end
    end
  end
end

would call the first plugin in the RyexCMS::PLUGINS array if the third option in the menu was selected and call the second plugin's Proc if the forth option was selected ECT.

right?

the idea is awesome i'll give it some thought.

Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 15, 2009, 09:58:21 pm
Yes, you get it! Just two things, though:

1) NEVER use "for i in x..y". It's SLOW AS CRAP. For arrays, use "array.each do .. end", or to do something a certain amount of times, "<n>.times do ... end". So the code would be:

RyexCMS::PLUGINS.each do |plugin|
  self.contents.draw(...., plugin.name)
end


2) To call the option, I would just check to see if the <index> of your menu is greater than what is in it by default, and if it is, just call

RyexCMS::PLUGINS[<index - HOW MANY OPTIONS ARE THERE BY DEFUALT>].call


Also, you can add in more options to the PlugIn class so that plugins can do other things, too. It's all up to your imagination ;)
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 15, 2009, 10:03:36 pm
awesome I learned something new!  :P

oh and shouldn't it be

RyexCMS::PLUGINS.each do |plugin|
  self.contents.draw(...., RyexCMS::PLUGINS[plugin].name)
end

instead of

RyexCMS::PLUGINS.each do |plugin|
  self.contents.draw(...., plugin.name)
end


PS: I've made over 500 posts!  :P
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 15, 2009, 10:26:53 pm
No, in that instance, the actual object is passed to the block, not the index -- yet another useful feature ;)
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 15, 2009, 10:44:48 pm
oh lol i forgot the difference between each and each_index
I could use...

RyexCMS::PLUGINS.each_index { |plugin|
  self.contents.draw(...., RyexCMS::PLUGINS[plugin].name)
}

but what would be the point when

RyexCMS::PLUGINS.each { |plugin|
  self.contents.draw(...., plugin.name)
}

is less code and probably uses less memory :P
Title: Re: Options YOU want on a CMS's options screen.
Post by: Blizzard on May 16, 2009, 04:12:14 am
Quote from: Biker WcW on May 15, 2009, 06:29:51 pm
...what the crap are you talking about? Ten processes? Are you thinking of Threads, Blizz? 0_0


You are using Proc, not Thread. Yes, processes. Most probably invisible to the user, but still a stupid idea if you don't need it IMO. I also think the Proc use for a battle command in the RTP scripts is retarded. But there's not much I can do about it.
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 16, 2009, 08:54:00 am
The use of procs in the default engine does suck, but Procs require around as much memory as a method, so aliasing another script's methods will produce similar results. And heck, I did a quick benchmark (synthetic of course) on Procs yesterday, and an array of 1000 objects similar to what I told Ryex to use only consumer a little over 1mb. Assuming that the average user only uses around 10, that's almost nothing.

However, in a true game design environment, that would be horrible, horrible practice, I concur, but in RMXP it's not that big of a deal.
Title: Re: Options YOU want on a CMS's options screen.
Post by: Blizzard on May 16, 2009, 09:15:09 am
Yes, let's all do horrible practice in RMXP. Oh wait, we already have an SDK.
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 16, 2009, 12:28:47 pm
Quote from: Rival Blizzard on May 16, 2009, 09:15:09 am
Yes, let's all do horrible practice in RMXP. Oh wait, we already have an SDK.


lol
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 17, 2009, 10:11:36 pm

module RyexCFG

  PLUGINS = []
  class PlugIn
    # read/write-able
    attr_accessor :name, :action, :description

    def initialize(name = '', desc = '')
      # @name is the name which will show up in the menu,
      # @reqs is the Proc that will be called to see if the option should
      # be activated (optional),
      # and @action is the proc that will be called when
      # the option is selected.
      @name, @action, @description = name, Proc.new, desc
    end

    def call
      p 'this works'
      @action.call
    end
  end
 
end


dect = 'Opens the shop window'
RyexCFG::PLUGINS.push(RyexCFG::PlugIn.new('shop', dect) do
    $Scene = Scene_Shop.new
  end
  )


when I use
RyexCFG::PLUGINS[0].call

"this works" pops up but
@action.call

ends up doing nothing and Scene_Shop is not called
any ideas?

Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 18, 2009, 07:46:13 am
Well, for one, you capitalized $scene (making it $Scene). Other than that, it looks like it should be working.
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 18, 2009, 01:41:39 pm
changing it to $scene does nothing even a
p 'hello' does nothing
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 18, 2009, 02:05:41 pm
Hmm... that's odd. All of that code works in IRB on Ruby 1.86. Weird 0_o

See if this works:

$test_var = false
myProc = Proc.new do
  print "Wow. Something is screwy in RMXP.\n"
  $test_var = true
end
myProc.call
print "Wow, something is EXTRA screwy in RMXP.\n" unless $test_var
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 18, 2009, 08:03:30 pm
I got it working... stupid mistake on my part...
Title: Re: Options YOU want on a CMS's options screen.
Post by: fugibo on May 18, 2009, 08:16:17 pm
Mind sharing? :(
Title: Re: Options YOU want on a CMS's options screen.
Post by: Ryex on May 18, 2009, 08:24:25 pm
lol how should I say this the way I had the code set up it never Called the Proc it just appeared to so the above code was good but how I put it into my menu was not...