Scripting ideas

Scripting ideas


Ever had that idea which you were too lazy or too busy to do? Maybe you worked on it and then for some reason gave it up?
The idea behind this thread is partly to capture both ideas and possible knowledge and work by scripters before they leave this community, partly to inspire scripters and give them ideas.
If you have worked on the ideas and then abandoned it feel free to provide the work you have already done and/or thoughts you have had about it.

List of ideas:

You do not have to be a scripter to post ideas you have, but...
This is NOT a request thread
Content Hidden Show
I think this is obvious, but let me spell it out anyways by an example.
Say you have this super cool idea for this awesome CMS and you for some reason think that posting it here will get a scripter to create it for you.
While that is a possibility it's much more likely that the scripter creates it for his or her own game. By posting the idea in this thread you have given the scripter permission to use it, but you are in no position to require.
Of course it's also possible that it won't be touched.


Terms and Conditions
Content Hidden Show
By posting in this topic you agree that any ideas and any material* you present in this topic becomes public domain. (If it's not possible in your jurisdiction then you give everyone reading this topic the right to use, modify, and publish your resources and ideas as if it was public domain)
Material is here considered to the raw text and the actual images referenced by [img]-tags.
Not having read the terms and conditions does not make exempt you from them.

Note that if you give links then only the links under the terms and not what they link to. It's only the data in this topic and images where use [img] tags.
Note also that the terms are naturally void if you do not have permission to grant the necessary rights.

On a final note you give me permission to alter and use your post in my own posts. It's already covered elsewhere, but I'll just say it again so you know it. I may alter and move around the posts to make this thread more inviting :3
I intend to keep this topic clean.


*hugs*
- Zeriab
Here is an idea I just had. It's about detecting if a point, say mouse point is inside a number of polygons.
You could for example use this if you had a mouse script and a world map and then highlight the relevant sections.
I have some thoughts on it such as what is the action if polygons overlap. Can we ensure that polygons do not overlap? Perhaps a configuration utility which checks for any overlaps among any number of polygons.
Will creating the smallest possible box around the polygons help in speed up the detection algorithm? (Maybe you can more quickly discard a number of polygons as being uninteresting)

*hugs*
Here's another scripting idea I have which basically is a project I have abandoned. I dunno really why I have abandoned it. I'll just leave it up to any other scripts to take it up and complete it. Eventers will love you if you complete it :3
What I am talking about is my Switch and Variable swapper which can be useful for eventers since they don't have to take as much care about choosing ids which hopefully won't be in use in other projects.

Here is the my project which anyone is free to use, modify and copy in any way they want: http://www.mediafire.com/download.php?ykqz45ztwz4
Commercial and non-commercial use alike is allowed. (Dunno why it would be commercial, but I allow it none-the-less)

The code is ugly and I think the prospect of a rewrite was what made me drop it now when I think about it.
That'd be awesome if someone created a proper projectile library, completely independent of any script, so it could be used for any kind of game, from a shoot'em up to an abs, or whatever.
You'd be able to set up the type of trajectories, and graphics they use, etc... maybe using the database animations, and display it for the graphics and simply having to move them.
Dancing script, you know how like you got dance offs and shit. Like alright so you wanna make a dance battle game in rmxp (so cool i hope someone does it!) :P make a dance script, using the arrows you dance your character around and like using different buttons you can make your character dance with different moves like use their hands and shit which will like acumulate points and ya know. Just had that idea jus now lol

EDIT: yep, that's just given me a killer idea for a game, i am so doing this! won't be able to script it, but ey!
With the world map polygon idea, maybe it only allows you to mouse-over the Large 'AREANAME!' text in each section, as words are unlikely to overlap, it wouldn't need to have in place an overlap.

If in the case large areas would have smaller areas within, maybe a sub-map for areas show up :)

I think in the case where parts of the map are selectable, maybe the map should be a base image, where each of the areas is a separate image which 'lights up' as the mouse is over the place name?

Possibly, icons could be shown on this supposed map showing places of interest, these could be shown or not shown depending on script-based switches / variables.
First of all, nice thread... even though I got a bunch of unrealized ideas, I don't plan on sharing too much of them... not only because of the huge legal section at the top of this thread that enables Zery to sell all our ideas... >:)

Either way, regarding your cursor highlighting script: the problem with seperate images for highlighted areas would be that they'd have to be placed correctly. That'd involve scripting, and I think standalone scripts are more welcome here as scripting tools ;)
So, an admittedly space-eating, but effective method would be using an image for the area definition: same color means same area. That'd make area detection hell-a-easy (get_pixel), as well as easily enable unconnected areas being considered a single area (think islands that belong to the mainland, but aren't directly connected).
Thinking this further (involving scripting again, though), this would be made extremely versatile by adding a vector engine, similar to vector graphic programs: almost no storage space needed, and scaleable. Because I mainly see the use of an area-definition tool in map appliances such as monster area definition or hazardous gas stuff, instead of eye-candy-ish map usage ^^
(and yes, I am aware this is kind of different from the original idea :p )
"Enter description on Save Game"
Allows you to type or select (using the name selection window) a description when you save. The description then displays on saved games.

It's on my list of "shit to do", it's just near the bottom of the list. But I think people would use it if it existed.

Be Well
Brewmeister wrote:
"Enter description on Save Game"
Allows you to type or select (using the name selection window) a description when you save. The description then displays on saved games.

It's on my list of "shit to do", it's just near the bottom of the list. But I think people would use it if it existed.

Be Well


Actually that's a really good idea, I've been trying to do something like that for a while, I just don't know how to do it (With name inputting)
More like a custom script, since the default Scene_Name is heavily stupid, considering you can't use the keyboard. Also, while we're at player friendlyness, remember to make that save description thing an OPTION, not a necessity - asking people to input a description every time they save would be even more annoying than that stupid "Do you really want to save?" question. Well, that basically forces the scripter to set a pre-defined text string as description (aka "Chapter 1 // The Lover's Shack", aka chapter marker and location hint) the player can build upon.
I imagine that to be quite useful really... and rather easy to pull off as well...
Hmm I wonder if...

With an implemented autosave system, whenever it's called in the editor, a line of code could be called like (Yes, this will be bad);

autosave(slot, message)

So for example, this could be done in an event;

Teleport to forest
Call script; autosave(1, "Dark Forest - Area 1")

So once the player is teleported to the forest, it autosaves in slot 1 and names it as above.

I mean, I've tried doing autosaves with events but it just doesn't work, it's easy to force the savescreen on someone whenever you like, but they should be given the freedom to turn autosaving on and off...

Maybe it's something worth considering.
Thanks for giving so many good ideas <3

@Blue:
I didn't mean that you should post your unrealized ideas, but rather your abandoned ideas.
It's true that I and everyone else may be able to profit from these ideas. The disclaimer is to illustrate that any ideas here are free to use for everyone. Scripters can use them without worry.

*hugs*
- Zeriab
A NPC Dialog script where topics to talk about can be added and removed dynamically.
That'd be pretty damn sweet.
There is something that a lot of people is waiting for : A battle system with collectible cards .
Like magic the gathering , yu-gi-oh , pokemon , wakfu , bakugan or others ...
But i know that this is very difficult . i think i will try ... one day .

Some scripts i made but never used :

A script to sort a party ! many posibilities (by ATK , level , name ...) . useful for big parties .
Content Hidden Show
  1. #==============================================================================
  2. # ** Game_Party
  3. #------------------------------------------------------------------------------
  4. #  This class handles the party. It includes information on amount of gold
  5. # and items. The instance of this class is referenced by $game_party.
  6. #==============================================================================
  7.  
  8. class Game_Party < Game_Unit
  9.  
  10.   #actor_id => valeur
  11.   # la valeur peux représenter ce que vous voulez !!!
  12.     Actor_Value = {
  13.       1 => -4,
  14.       2 => 3,
  15.       4 => -6,
  16.       5 => 3,
  17.       6 => -8,
  18.       7 => 5
  19.       }
  20.      
  21.       # la valeur par défaut pour les acteurs qui ne sont pas dans la liste
  22.       Actor_default_value = 0
  23.  
  24.   def avalue(actor_id)
  25.  #   Valuetab = Actor_Value[@actor_id]
  26.     return Actor_default_value if Actor_Value[@actor_id] == nil
  27.     return Actor_Value[@actor_id]
  28.   end
  29.  
  30.   #--------------------------------------------------------------------------
  31.   # * Sort actors by the table value
  32.   #--------------------------------------------------------------------------
  33.   def sort_value
  34.     result = []
  35.     for i in [email hidden] - 1
  36.       mini = nil
  37.       for j in [email hidden] - 1
  38.          mini = j if mini == nil and not result.include?(@actors[j])
  39.          if mini != nil then
  40.            if avalue(@actors[mini]) <= avalue(@actors[j]) and not result.include?(@actors[j]) then
  41.             mini = j
  42.           end
  43.         end
  44.       end
  45.        result.push(@actors[mini])
  46.      end
  47.      @actors = result
  48.       $game_player.refresh
  49.   end
  50.  
  51.     #--------------------------------------------------------------------------
  52.   # * Sort actors by the table value
  53.   #--------------------------------------------------------------------------
  54.   def sort_value_asc
  55.     result = []
  56.     for i in [email hidden] - 1
  57.       mini = nil
  58.       for j in [email hidden] - 1
  59.          mini = j if mini == nil and not result.include?(@actors[j])
  60.          if mini != nil then
  61.            if avalue(@actors[mini]) >= avalue(@actors[j]) and not result.include?(@actors[j]) then
  62.             mini = j
  63.           end
  64.         end
  65.       end
  66.        result.push(@actors[mini])
  67.      end
  68.      @actors = result
  69.       $game_player.refresh
  70.   end
  71.  
  72.    
  73. #--------------------------------------------------------------------------
  74.   # * Sort actors by alpha
  75.   #--------------------------------------------------------------------------
  76.   def sort_alpha
  77.     result = []
  78.     for i in [email hidden] - 1
  79.       mini = nil
  80.       for j in [email hidden] - 1
  81.          mini = j if mini == nil and not result.include?(@actors[j])
  82.          if mini != nil then
  83.            if $game_actors[@actors[mini]].name <= $game_actors[@actors[j]].name and not result.include?(@actors[j]) then
  84.             mini = j
  85.           end
  86.         end
  87.       end
  88.        result.push(@actors[mini])
  89.      end
  90.      @actors = result
  91.       $game_player.refresh
  92.   end
  93. #--------------------------------------------------------------------------
  94.   # * Sort actors by level
  95.   #--------------------------------------------------------------------------
  96.   def sort_level
  97.     result = []
  98.     for i in [email hidden] - 1
  99.       mini = nil
  100.       for j in [email hidden] - 1
  101.          mini = j if mini == nil and not result.include?(@actors[j])
  102.          if mini != nil then
  103.            if $game_actors[@actors[mini]].level <= $game_actors[@actors[j]].level and not result.include?(@actors[j]) then
  104.             mini = j
  105.           end
  106.         end
  107.       end
  108.        result.push(@actors[mini])
  109.      end
  110.      @actors = result
  111.       $game_player.refresh
  112.   end
  113. #--------------------------------------------------------------------------
  114.   # * Sort actors by ATK
  115.   #--------------------------------------------------------------------------
  116.   def sort_atk
  117.     result = []
  118.     for i in [email hidden] - 1
  119.       mini = nil
  120.       for j in [email hidden] - 1
  121.          mini = j if mini == nil and not result.include?(@actors[j])
  122.          if mini != nil then
  123.            if $game_actors[@actors[mini]].atk <= $game_actors[@actors[j]].atk and not result.include?(@actors[j]) then
  124.             mini = j
  125.           end
  126.         end
  127.       end
  128.        result.push(@actors[mini])
  129.      end
  130.      @actors = result
  131.       $game_player.refresh
  132.   end
  133. #--------------------------------------------------------------------------
  134.   # * Sort actors by hp
  135.   #--------------------------------------------------------------------------
  136.   def sort_hp
  137.     result = []
  138.     for i in [email hidden] - 1
  139.       mini = nil
  140.       for j in [email hidden] - 1
  141.          mini = j if mini == nil and not result.include?(@actors[j])
  142.          if mini != nil then
  143.            if $game_actors[@actors[mini]].hp <= $game_actors[@actors[j]].hp and not result.include?(@actors[j]) then
  144.             mini = j
  145.           end
  146.         end
  147.       end
  148.        result.push(@actors[mini])
  149.      end
  150.      @actors = result
  151.       $game_player.refresh
  152.   end
  153. #--------------------------------------------------------------------------
  154.   # * Sort actors by mp
  155.   #--------------------------------------------------------------------------
  156.   def sort_mp
  157.     result = []
  158.     for i in [email hidden] - 1
  159.       mini = nil
  160.       for j in [email hidden] - 1
  161.          mini = j if mini == nil and not result.include?(@actors[j])
  162.          if mini != nil then
  163.            if $game_actors[@actors[mini]].mp <= $game_actors[@actors[j]].mp and not result.include?(@actors[j]) then
  164.             mini = j
  165.           end
  166.         end
  167.       end
  168.        result.push(@actors[mini])
  169.      end
  170.      @actors = result
  171.       $game_player.refresh
  172.   end
  173.  
  174.   #--------------------------------------------------------------------------
  175.   # * Sort actors by spi
  176.   #--------------------------------------------------------------------------
  177.   def sort_spi
  178.     result = []
  179.     for i in [email hidden] - 1
  180.       mini = nil
  181.       for j in [email hidden] - 1
  182.          mini = j if mini == nil and not result.include?(@actors[j])
  183.          if mini != nil then
  184.            if $game_actors[@actors[mini]].spi <= $game_actors[@actors[j]].spi and not result.include?(@actors[j]) then
  185.             mini = j
  186.           end
  187.         end
  188.       end
  189.        result.push(@actors[mini])
  190.      end
  191.      @actors = result
  192.       $game_player.refresh
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # * Sort actors by spi
  196.   #--------------------------------------------------------------------------
  197.  def swap(actor1,actor2)
  198.     result = []
  199.     for i in [email hidden] - 1
  200.       result.push(@actors[actor2]) if i == actor1
  201.       result.push(@actors[actor1]) if i == actor2
  202.       result.push(@actors[i]) if i != actor2 and i != actor1
  203.      end
  204.      @actors = result
  205.       $game_player.refresh
  206.   end
  207.  
  208.   end
Expand to see the code.


By default , the actor displayed on the map is the first one of your party .
If you want to change that :
Content Hidden Show
  1. #==============================================================================
  2. # ** Game_Player
  3. #------------------------------------------------------------------------------
  4. #  after a sort of the party , we want the main actor displayed on map remains the same one
  5. #  variable MAIN_ACTOR is the id of this actor
  6. #==============================================================================
  7.  
  8. class Game_Player < Game_Character
  9.  
  10.     MAIN_ACTOR = 1
  11.  
  12.   #--------------------------------------------------------------------------
  13.   # * Refresh
  14.   #--------------------------------------------------------------------------
  15.   def refresh
  16.     if $game_party.members.size == 0
  17.       @character_name = ""
  18.       @character_index = 0
  19.     else
  20.       actor = $game_actors[MAIN_ACTOR]   # Get front actor
  21.       @character_name = actor.character_name
  22.       @character_index = actor.character_index
  23.     end
  24.   end
  25. end
Expand to see the code.
The collectible cards thing isn't all that hard at the bases... regular card algorythms (shuffling, drawing, discarding), as well as zones would be rather easy. The a bit more difficult part is the actual action processing... that'd be incredibly depending on the created game and therefore not very suitable for a pre-made script, since whoever uses it would have to be able to script on a more-than-average level theirselves.

Well, there also is that program called Magic Workstation, which allows incredible card management features, yet no rules whatsoever, which is a downside as far as MTG goes, but on the other hand, you can play YuGiOh, Pokemon or whatever card game with that since you decide all rules on the go (depends on the attention of both players at all times, but it's pretty cool in terms of playing against people you can't always meet offline, or just don't have cards at all).
Just saying since it's not only an awesome program, but also illustrates quite nice how turns are handled in MTG, for those who won't read the manual ;)



To contribute something myself: A buddy of mine thought the FFV job system would be cool to have remade. My personal idea long before that was more of a skill system with equipable skills that have to match with other skills in order to be able to be equipped (i.e. 'Swordsmanship' won't work with 'Aerial Attacks'). Obviously, levelling up these skills would be a nice touch to it.
I think an adventure game script would be awesome. Not point and click style really, just more of an item interaction system.

I coded one myself but it was my first script so the code probably sucks and it was a bit of a pain in the arse to use. I pretty much forgotten what I knew of Ruby so I won't be adding to it. I never made it like an actual adventure game because adding mouse support would of been hard and I like it how it is.
Image
It could definitely do with being rewritten and made slightly more user friendly on the editing side of things.

If anyway wants to use it how it is or for any other reason, here it is:
Content Hidden Show
  1.  
  2. #==============================================================================
  3. # ** Advent
  4. #------------------------------------------------------------------------------
  5. # mtgmaster
  6. # 0.01
  7. # 28/01/2008
  8. #==============================================================================
  9.  
  10. #==============================================================================
  11. # ** Window_Advent
  12. #------------------------------------------------------------------------------
  13. #  Create the HUD
  14. #==============================================================================
  15. class Window_Advent < Window_Selectable
  16.   #--------------------------------------------------------------------------
  17.   # * Object Initialization
  18.   #--------------------------------------------------------------------------
  19.   def initialize
  20.     super(-32, 420, 690, 107)
  21.     self.contents = Bitmap.new(690, 107)
  22.     self.opacity = 0
  23.     refresh
  24.   end
  25.   #--------------------------------------------------------------------------
  26.  
  27.   #--------------------------------------------------------------------------
  28.   # * Refresh
  29.   #--------------------------------------------------------------------------
  30.   def refresh
  31.     self.contents.clear
  32.     ###self.contents.fill_rect(0, 0, 999, 999, Color.new(0,0,0,200))
  33.     bitmap = RPG::Cache.picture("hudbg.png")
  34.     self.contents.blt(16, 0, bitmap, Rect.new(0, 0, 999, 999), 170)
  35.    
  36.     # Draw the icons
  37.     xn = 42
  38.     itemid = 1
  39.     textx = 35
  40.     self.contents.font.size = 10
  41.     for i in 1...$data_items.size
  42.       if $game_party.item_number(i) > 0
  43.         opacity = 100
  44.         item = $data_items[i]
  45.         # If item in hud is the same as being selected to hold
  46.         if $scene.hold == itemid
  47.           opacity = 255
  48.           $holding = item.id
  49.         end
  50.         bitmap = RPG::Cache.icon(item.icon_name)
  51.         self.contents.font.color = Color.new(255,255,255, opacity)
  52.         self.contents.blt(xn, 10, bitmap, Rect.new(0, 0, 24, 24), opacity)
  53.         self.contents.draw_text(textx, 6, 10, 10, itemid.to_s)
  54.         xn += 48
  55.         itemid += 1
  56.       textx += 48
  57.       end
  58.     end
  59.  
  60.   end
  61.   #--------------------------------------------------------------------------
  62.  
  63.   #--------------------------------------------------------------------------
  64.   # * Update
  65.   #--------------------------------------------------------------------------
  66.   def update
  67.     super
  68.     refresh
  69.   end
  70.   #--------------------------------------------------------------------------
  71. end  
  72.  
  73. #==============================================================================
  74. # ** Scene_Map
  75. #------------------------------------------------------------------------------
  76. #  Add the HUD and check for input
  77. #==============================================================================
  78. class Scene_Map
  79.   alias_method :scene_map_main, :main
  80.   alias_method :scene_map_update, :update
  81.   attr_accessor :hold
  82.   attr_accessor :adv_window
  83.   #--------------------------------------------------------------------------
  84.   # * Main
  85.   #--------------------------------------------------------------------------
  86.   def main
  87.     @adv_window = Window_Advent.new
  88.     @adv_window.visible = true
  89.     @adv_window.z = 9999
  90.     scene_map_main
  91.   end
  92.   #--------------------------------------------------------------------------
  93.  
  94.   #--------------------------------------------------------------------------
  95.   # * Update
  96.   #--------------------------------------------------------------------------
  97.   def update
  98.     @adv_window.update
  99.     # Item selection
  100.     if Kboard.keyboard($R_Key_1)
  101.       hold_item(1)
  102.     elsif Kboard.keyboard($R_Key_2)
  103.       hold_item(2)
  104.     elsif Kboard.keyboard($R_Key_3)
  105.       hold_item(3)
  106.     elsif Kboard.keyboard($R_Key_4)
  107.       hold_item(4)
  108.     elsif Kboard.keyboard($R_Key_5)
  109.       hold_item(5)
  110.     elsif Kboard.keyboard($R_Key_6)
  111.       hold_item(6)
  112.     elsif Kboard.keyboard($R_Key_7)
  113.       hold_item(7)
  114.     elsif Kboard.keyboard($R_Key_8)
  115.       hold_item(8)
  116.     elsif Kboard.keyboard($R_Key_9)
  117.       hold_item(9)
  118.     end
  119.     # Hide HUD
  120.     if Kboard.keyboard($R_Key_0)
  121.       @adv_window.visible ? @adv_window.visible = false : @adv_window.visible = true
  122.     end
  123.     # View item (V)
  124.     if Kboard.keyboard($R_Key_L)
  125.       view_item($holding)
  126.     end
  127.     # Menu Hotkeys
  128.     if Kboard.keyboard($R_Key_O)
  129.       $scene = Scene_Journal.new
  130.     end
  131.     scene_map_update
  132.   end
  133.   #--------------------------------------------------------------------------  
  134.  
  135.   #--------------------------------------------------------------------------
  136.   # * view_item
  137.   #--------------------------------------------------------------------------
  138.   def view_item(itemid)
  139.     if $holding == nil
  140.       $game_system.se_play($data_system.cancel_se)
  141.       return false
  142.     end
  143.       $game_system.ums_mode = FIT_WINDOW_TO_TEXT
  144.       $game_system.comic_enabled = true
  145.       $game_temp.message_text = '\e[0]' + $data_items[itemid].description.to_s
  146.   end
  147.   #--------------------------------------------------------------------------  
  148.  
  149.   #--------------------------------------------------------------------------
  150.   # * hold_item
  151.   #--------------------------------------------------------------------------  
  152.   def hold_item(item_id)
  153.     unless $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing
  154.       if @hold == item_id
  155.         @hold = 0
  156.         $holding = nil
  157.       else
  158.         @hold = item_id
  159.       end
  160.     end
  161.   end
  162.   #--------------------------------------------------------------------------  
  163. end
  164.  
  165. #==============================================================================
  166. # ** Game_Player
  167. #------------------------------------------------------------------------------
  168. #  Adds the ability to change event interaction when holding an item
  169. #==============================================================================
  170. class Game_Player < Game_Character
  171.   #--------------------------------------------------------------------------
  172.   # * Front Event Starting Determinant
  173.   #--------------------------------------------------------------------------
  174.   def check_event_trigger_there(triggers)
  175.     result = false
  176.     # If event is running
  177.     if $game_system.map_interpreter.running?
  178.       return result
  179.     end
  180.     # Calculate front event coordinates
  181.     new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
  182.     new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
  183.     # All event loops
  184.     for event in $game_map.events.values
  185.       # If event coordinates and triggers are consistent
  186.       if event.x == new_x and event.y == new_y and
  187.          triggers.include?(event.trigger)
  188.         # If starting determinant is front event (other than jumping)
  189.         if not event.jumping? and not event.over_trigger?
  190.           #--------------------------------------------------
  191.           # If you're holding an item
  192.           if $holding
  193.             comment = SDK.event_comment_input(event, 1, "Holding").to_s.split('|')
  194.             item_id = comment[0].to_i
  195.             command = comment[1].to_s.split(':')
  196.               switch_id = command[1].to_i
  197.               command_ = command[0].to_s
  198.             # If the item you're holding and the item_id of the event comment match
  199.             if $holding == item_id
  200.               case command_
  201.                 # Switch
  202.                 when "s"
  203.                   $game_switches[switch_id] = true
  204.                 # Self Switch
  205.                 when "ss"
  206.                   switch_id = switch_id.to_s.split('.')
  207.                   p switch_id[0]
  208.                   #key = [$game_map.map_id, event.id, switch_id[0].to_s]
  209.                   #$game_self_switches[key] = (switch_id[1].to_i == 0)
  210.                 # Common event
  211.                 when "c"
  212.                   $game_temp.common_event_id = switch_id
  213.               end
  214.               $game_map.need_refresh = true
  215.             else
  216.               $game_system.se_play($data_system.cancel_se)
  217.               return false
  218.             end
  219.           else
  220.             event.start
  221.           end
  222.           #--------------------------------------------------
  223.          result = true
  224.         end
  225.       end
  226.     end
  227.     # If fitting event is not found
  228.     if result == false
  229.       # If front tile is a counter
  230.       if $game_map.counter?(new_x, new_y)
  231.         # Calculate 1 tile inside coordinates
  232.         new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
  233.         new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
  234.         # All event loops
  235.         for event in $game_map.events.values
  236.           # If event coordinates and triggers are consistent
  237.           if event.x == new_x and event.y == new_y and
  238.              triggers.include?(event.trigger)
  239.             # If starting determinant is front event (other than jumping)
  240.             if not event.jumping? and not event.over_trigger?
  241.               event.start
  242.               result = true
  243.             end
  244.           end
  245.         end
  246.       end
  247.     end
  248.     return result
  249.   end
  250.   #--------------------------------------------------------------------------  
  251. end
  252.  
  253. class Game_Character
  254.   attr_accessor :move_speed
  255. end
Expand to see the code.

It uses actual items, any items you have will show up in the GUI and can be used. To use it add these comments to the event.
Comment: Holding
Comment: 1|s:1
The last comment controls item and switching. It's used like this:
[ID of the item you need to be holding] | [s for switch, ss for self switch, c common event] : [ id of the switch/common event to be triggered]
Probably too complicated, could do with simplifying.
Just press the corresponding number on your keyboard to select(hold) or deselect an item. When you have the item selected and press space with the event, the switch or common event is triggered.
Press 0 to hide the GUI.
L makes your character look at the item and shows its description set in the DB.
Might I selflessly point anyone trying to improve that adventure script to my Database Flag Reader (link in my signature), which would highly simplify and enhance any interaction processing.

Also, I really like the number key-controlled item selection... pretty good idea as a mouse replacement, even though it doesn't support more than 10 items, I assume... maybe 9. The actual window seems like it should be more apparent, but that might destroy the atmosphere in darker areas/games like the one on the screenshot... hm, maybe it could be improved a tad.
As far as coding goes, it's not a perfectly clean style ( '###' ? :crazy: ), but it's well-commented. You're right as in you could simplify it though...

All in all, nice concept that's well worth to be followed by someone!
I like how I'm probably necrodoubleposting now, but guess what - given the topic's purpose, I don't give a fuck!

Updating the idea of a vector-based handling class, allowing multiple other classes to benefit from it, for example Bitmap drawing or general position checking.

Several fancy methods, inconclusive list:

Vector object
.new(vertices) # defines a vector from an array of two- or three-dimensional vertices (i.e. [[13, 2], [12, 67]], measured in pixels, not tiles!)
.unset! # drops a vector
.add_vertex(index, point) # adds a vertex at position index within the array, at the given coordinates from a two- or three-dimensional array
.remove_vertex(index) # drops the vertex and position index
.twodimensional # converts all vertices into two-dimensional arrays by dropping the last element within every array of every vertex
.twodimensional!
.threedimensional # converts all vertices into three-dimensional arrays by addion 0 as the last element to every array of every vertex
.threedimensional!
.rotate(point of origin, degrees) # turns the vector around point of origin (two-dimensional array) by degree degrees
.rotate!(point of origin, degrees)
.flip(point of origin, direction) # flips the vector over an axis given by the point of origin and a direction, measured in degrees
.flip!(point of origin, direction)
.create(aSprite) # creates a vector outlining a given sprite, ignoring transparent pixels obviously
.merge(aVector) # merges two vectors, dropping overlapping vertices, returns false if vectors don't overlap
.substract(aVector) # subtracts a given vector from the current one, returns false if vectors don't overlap
.enclose?(point/aVector) # checks if given two- or three-dimensional point, or vector is within the vector

...and certainly way cooler stuff than that, but I figure you'd want the basics covered first, eh?


While the thread rules don't imply it, I'd still ask whoever might attempt this to publicise it, since this could really spawn some really interesting systems on their own. And well, even if you won't, at least notify people about the process ;)
I'd like to do it myself, but despite being an awful scripter :down: I just don't know any math... or Math, for that matter ;)
well about the vector class, you could simply re use the one provided by ruby, given in a rb file. it also has a matrix class. just look in the lib/ruby folders.
I have seen a request that i found very interesting :

An auto-battle option !

There will be a scene called from the menu . For each actor , you can authorize use of items/skills ... For Healing also .
And in battle where the game asks "Battle or Retreat" , you will have another option : "Auto-Battle" and the actors fights alone .

This can be useful for a lot of people . I think i will work on it ... one day .
While that is a pretty common thing in RPGs, and therefore not really unknown (even though it's regularly praised as an awesome feature in whatever new RPG...), I think dubealex did it some time ago... though I'm not too sure on that, but yeah - someone did it, I think. Might look at that for reference before creating your own (which, in case alex did it, would be definately worth it, considering his scripting style... ^^" )
so about 2 and a half weeks ago i came here looking for an idea, i choose the world map script. its works perfect atm(tho seph is helping me change up my data structure to work faster/easier) but there is one feature i havent been able to get to work quite the way i wanted so i thought id come here and ask for ideas. that feature being the sub sections. how would you guys do it?
While having no idea what you're talking about at all, it kind of seems to be something along the lines of what we talked about up there with the Vector stuff: Seperating the scene in several, easily predefined areas by using vertices (corner points, connecting to the next one in line, forming a vector).
Without that, the most apparent way to me seems to be using images, however, that can hardly be what you're looking for.

Either way, this isn't a place to ask for ideas, but rather to submit your own for people to execute. Therefore, if you're having further questions about it, please open up a seperate topic in Script Support or Requests (depends).
I've been thinking about a layer-mask script.
The goal is to help mapping. It'll eliminate the need to create new cliff tiles sunk in grass/ rocks in water, etc. There will be 'mask tiles' and 'mask auto-tile' (by utilizing Terrain Tags) which hide the layer below them.
I may do it myself, if I have the time.
Also, I wonder whether to make it work with transparency-- making the layer below 50% visible. The same effect can be achieved by using events, so such a feature will have little use, aside from 50% visible water auto-tile for cliff bottom..
For the save name mods, check out this script that Scriptastic (me and Glitchfinder, mostly) cooked up awhile back:

http://www.glitchkey.com/view_page.php?id=15

It allows you to add a word, as well as icons, to the savegame.
Could easily be modded to do what you are looking for.

Found a few interesting ideas here, I'll have some fun with these when I get some free time.
Someone asks for a battle statistics script .
It could be accessible from the menu . And it will display various figures like how many ennemies encoutered and killed , how many HP healed and lost .... There is a lot of possibilities . You have this in Disgaea for exemple .

With these figures , the player can earn points for some special actions like killing a monster one shot ...

I think i will try to make it for the GTBS . because , yes , i am afraid this must be done for each battle system .
Something I was trying to do, and sortof succeeded in a crude and unworkable way: IRC chat within rmxp. Would love to see it done, though this isn't a request nor a necessity. Would just like to see how one would go about it.

I managed to get it working in Game Maker, worked quite well. I think it would be a cool alternative to Netplay chat, offering more userbase and more moderation controls.
mtgmaster wrote:
I think an adventure game script would be awesome. Not point and click style really, just more of an item interaction system.

I coded one myself but it was my first script so the code probably sucks and it was a bit of a pain in the arse to use. I pretty much forgotten what I knew of Ruby so I won't be adding to it. I never made it like an actual adventure game because adding mouse support would of been hard and I like it how it is.
Image
It could definitely do with being rewritten and made slightly more user friendly on the editing side of things.

If anyway wants to use it how it is or for any other reason, here it is:
Content Hidden Show
  1.  
  2. #==============================================================================
  3. # ** Advent
  4. #------------------------------------------------------------------------------
  5. # mtgmaster
  6. # 0.01
  7. # 28/01/2008
  8. #==============================================================================
  9.  
  10. #==============================================================================
  11. # ** Window_Advent
  12. #------------------------------------------------------------------------------
  13. #  Create the HUD
  14. #==============================================================================
  15. class Window_Advent < Window_Selectable
  16.   #--------------------------------------------------------------------------
  17.   # * Object Initialization
  18.   #--------------------------------------------------------------------------
  19.   def initialize
  20.     super(-32, 420, 690, 107)
  21.     self.contents = Bitmap.new(690, 107)
  22.     self.opacity = 0
  23.     refresh
  24.   end
  25.   #--------------------------------------------------------------------------
  26.  
  27.   #--------------------------------------------------------------------------
  28.   # * Refresh
  29.   #--------------------------------------------------------------------------
  30.   def refresh
  31.     self.contents.clear
  32.     ###self.contents.fill_rect(0, 0, 999, 999, Color.new(0,0,0,200))
  33.     bitmap = RPG::Cache.picture("hudbg.png")
  34.     self.contents.blt(16, 0, bitmap, Rect.new(0, 0, 999, 999), 170)
  35.    
  36.     # Draw the icons
  37.     xn = 42
  38.     itemid = 1
  39.     textx = 35
  40.     self.contents.font.size = 10
  41.     for i in 1...$data_items.size
  42.       if $game_party.item_number(i) > 0
  43.         opacity = 100
  44.         item = $data_items[i]
  45.         # If item in hud is the same as being selected to hold
  46.         if $scene.hold == itemid
  47.           opacity = 255
  48.           $holding = item.id
  49.         end
  50.         bitmap = RPG::Cache.icon(item.icon_name)
  51.         self.contents.font.color = Color.new(255,255,255, opacity)
  52.         self.contents.blt(xn, 10, bitmap, Rect.new(0, 0, 24, 24), opacity)
  53.         self.contents.draw_text(textx, 6, 10, 10, itemid.to_s)
  54.         xn += 48
  55.         itemid += 1
  56.       textx += 48
  57.       end
  58.     end
  59.  
  60.   end
  61.   #--------------------------------------------------------------------------
  62.  
  63.   #--------------------------------------------------------------------------
  64.   # * Update
  65.   #--------------------------------------------------------------------------
  66.   def update
  67.     super
  68.     refresh
  69.   end
  70.   #--------------------------------------------------------------------------
  71. end  
  72.  
  73. #==============================================================================
  74. # ** Scene_Map
  75. #------------------------------------------------------------------------------
  76. #  Add the HUD and check for input
  77. #==============================================================================
  78. class Scene_Map
  79.   alias_method :scene_map_main, :main
  80.   alias_method :scene_map_update, :update
  81.   attr_accessor :hold
  82.   attr_accessor :adv_window
  83.   #--------------------------------------------------------------------------
  84.   # * Main
  85.   #--------------------------------------------------------------------------
  86.   def main
  87.     @adv_window = Window_Advent.new
  88.     @adv_window.visible = true
  89.     @adv_window.z = 9999
  90.     scene_map_main
  91.   end
  92.   #--------------------------------------------------------------------------
  93.  
  94.   #--------------------------------------------------------------------------
  95.   # * Update
  96.   #--------------------------------------------------------------------------
  97.   def update
  98.     @adv_window.update
  99.     # Item selection
  100.     if Kboard.keyboard($R_Key_1)
  101.       hold_item(1)
  102.     elsif Kboard.keyboard($R_Key_2)
  103.       hold_item(2)
  104.     elsif Kboard.keyboard($R_Key_3)
  105.       hold_item(3)
  106.     elsif Kboard.keyboard($R_Key_4)
  107.       hold_item(4)
  108.     elsif Kboard.keyboard($R_Key_5)
  109.       hold_item(5)
  110.     elsif Kboard.keyboard($R_Key_6)
  111.       hold_item(6)
  112.     elsif Kboard.keyboard($R_Key_7)
  113.       hold_item(7)
  114.     elsif Kboard.keyboard($R_Key_8)
  115.       hold_item(8)
  116.     elsif Kboard.keyboard($R_Key_9)
  117.       hold_item(9)
  118.     end
  119.     # Hide HUD
  120.     if Kboard.keyboard($R_Key_0)
  121.       @adv_window.visible ? @adv_window.visible = false : @adv_window.visible = true
  122.     end
  123.     # View item (V)
  124.     if Kboard.keyboard($R_Key_L)
  125.       view_item($holding)
  126.     end
  127.     # Menu Hotkeys
  128.     if Kboard.keyboard($R_Key_O)
  129.       $scene = Scene_Journal.new
  130.     end
  131.     scene_map_update
  132.   end
  133.   #--------------------------------------------------------------------------  
  134.  
  135.   #--------------------------------------------------------------------------
  136.   # * view_item
  137.   #--------------------------------------------------------------------------
  138.   def view_item(itemid)
  139.     if $holding == nil
  140.       $game_system.se_play($data_system.cancel_se)
  141.       return false
  142.     end
  143.       $game_system.ums_mode = FIT_WINDOW_TO_TEXT
  144.       $game_system.comic_enabled = true
  145.       $game_temp.message_text = '\e[0]' + $data_items[itemid].description.to_s
  146.   end
  147.   #--------------------------------------------------------------------------  
  148.  
  149.   #--------------------------------------------------------------------------
  150.   # * hold_item
  151.   #--------------------------------------------------------------------------  
  152.   def hold_item(item_id)
  153.     unless $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing
  154.       if @hold == item_id
  155.         @hold = 0
  156.         $holding = nil
  157.       else
  158.         @hold = item_id
  159.       end
  160.     end
  161.   end
  162.   #--------------------------------------------------------------------------  
  163. end
  164.  
  165. #==============================================================================
  166. # ** Game_Player
  167. #------------------------------------------------------------------------------
  168. #  Adds the ability to change event interaction when holding an item
  169. #==============================================================================
  170. class Game_Player < Game_Character
  171.   #--------------------------------------------------------------------------
  172.   # * Front Event Starting Determinant
  173.   #--------------------------------------------------------------------------
  174.   def check_event_trigger_there(triggers)
  175.     result = false
  176.     # If event is running
  177.     if $game_system.map_interpreter.running?
  178.       return result
  179.     end
  180.     # Calculate front event coordinates
  181.     new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
  182.     new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
  183.     # All event loops
  184.     for event in $game_map.events.values
  185.       # If event coordinates and triggers are consistent
  186.       if event.x == new_x and event.y == new_y and
  187.          triggers.include?(event.trigger)
  188.         # If starting determinant is front event (other than jumping)
  189.         if not event.jumping? and not event.over_trigger?
  190.           #--------------------------------------------------
  191.           # If you're holding an item
  192.           if $holding
  193.             comment = SDK.event_comment_input(event, 1, "Holding").to_s.split('|')
  194.             item_id = comment[0].to_i
  195.             command = comment[1].to_s.split(':')
  196.               switch_id = command[1].to_i
  197.               command_ = command[0].to_s
  198.             # If the item you're holding and the item_id of the event comment match
  199.             if $holding == item_id
  200.               case command_
  201.                 # Switch
  202.                 when "s"
  203.                   $game_switches[switch_id] = true
  204.                 # Self Switch
  205.                 when "ss"
  206.                   switch_id = switch_id.to_s.split('.')
  207.                   p switch_id[0]
  208.                   #key = [$game_map.map_id, event.id, switch_id[0].to_s]
  209.                   #$game_self_switches[key] = (switch_id[1].to_i == 0)
  210.                 # Common event
  211.                 when "c"
  212.                   $game_temp.common_event_id = switch_id
  213.               end
  214.               $game_map.need_refresh = true
  215.             else
  216.               $game_system.se_play($data_system.cancel_se)
  217.               return false
  218.             end
  219.           else
  220.             event.start
  221.           end
  222.           #--------------------------------------------------
  223.          result = true
  224.         end
  225.       end
  226.     end
  227.     # If fitting event is not found
  228.     if result == false
  229.       # If front tile is a counter
  230.       if $game_map.counter?(new_x, new_y)
  231.         # Calculate 1 tile inside coordinates
  232.         new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
  233.         new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
  234.         # All event loops
  235.         for event in $game_map.events.values
  236.           # If event coordinates and triggers are consistent
  237.           if event.x == new_x and event.y == new_y and
  238.              triggers.include?(event.trigger)
  239.             # If starting determinant is front event (other than jumping)
  240.             if not event.jumping? and not event.over_trigger?
  241.               event.start
  242.               result = true
  243.             end
  244.           end
  245.         end
  246.       end
  247.     end
  248.     return result
  249.   end
  250.   #--------------------------------------------------------------------------  
  251. end
  252.  
  253. class Game_Character
  254.   attr_accessor :move_speed
  255. end
Expand to see the code.

It uses actual items, any items you have will show up in the GUI and can be used. To use it add these comments to the event.
Comment: Holding
Comment: 1|s:1
The last comment controls item and switching. It's used like this:
[ID of the item you need to be holding] | [s for switch, ss for self switch, c common event] : [ id of the switch/common event to be triggered]
Probably too complicated, could do with simplifying.
Just press the corresponding number on your keyboard to select(hold) or deselect an item. When you have the item selected and press space with the event, the switch or common event is triggered.
Press 0 to hide the GUI.
L makes your character look at the item and shows its description set in the DB.

I will be doing something like this for one of my games, i had a similar idea. But also with a adventure skills that can be used in map . I dont know if i will use some with my actual short system, but i use i will code it
Mode7 for battle backgrounds, basically.. when you get into a battle, the game zooms in and the ground shifts and what not and the um..NPCs and everything go invisible and the monsters and players apear as if it's the battle back.. and everything else apears..
Basically like they do in The 7th Saga for battles on the SNES.
here is a video.. mute it if the guy talking gets on your nerves, it's the only vid i could find showing the battles..
http://www.youtube.com/watch?v=l5A8R_Clr7Q

I just thought it might be cool, plus people are already working with mode 7 even scripters, so maybe someone might like this idea and try and make it work.
I have less time and interest so i release scripts ideas that other scripters may terminate.

Improved Show Pictures Command
This script idea was to have these habilities:
-Lock the picture
-Make a fog/panorama continuos movement for pictures
-The option to set the z of game pictures through a depth atribute, so you can set it an a plenty of key locations: under chipset, under characters, under fog, up messages.

I also pots my learnins to solve this:

Z values
-WinMsg 9998
-WinInputNum 9999
Per sobre de msg: 10000
@viewport2.z = 200
@viewport3.z = 5000
-Event always on top 999
# Make panorama plane
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
# Make fog plane
@fog = Plane.new(@viewport1)
@fog.z = 3000

The problem here is viewports. The z in viewports seems to be used to differentiate between the objects that used that viewport, so, if you give it a z = 10000 it wont work because these z only makes to show on the top of its viewport.

Note that the key class is spriteset map. I have modified well the sprite picutr, i think.

Then to make this scripts you have to know about viewports and modify that system. I also dont know if viewports give some other beneficits so you will have to create your mdified version.

Finally, i think this is a very good idea. It will be nice that somebody terminates this. Also, my code use some Anonymous Scripters code so if you take it give it credits too,xDDDDDDDDDDDDDD.

  1.  
  2. #==============================================================================
  3. # ** Game_Picture
  4. #------------------------------------------------------------------------------
  5. #  This class handles the picture. It's used within the Game_Screen class
  6. #  ($game_screen).
  7. #==============================================================================
  8.      
  9. class Game_Picture
  10.   #--------------------------------------------------------------------------
  11.   # * Public Instance Variables
  12.   #--------------------------------------------------------------------------
  13.   attr_accessor   :anchor                    # rotation angle
  14.   attr_accessor   :depth
  15.   #--------------------------------------------------------------------------
  16.   # * Alias Methods
  17.   #--------------------------------------------------------------------------
  18.   alias glitch_anchor_pic_game_picture_initialize initialize
  19.   #--------------------------------------------------------------------------
  20.   # * Object Initialization
  21.   #     number : picture number
  22.   #--------------------------------------------------------------------------
  23.   def initialize(number)
  24.     @anchor = false
  25.     @depth = 0
  26.     glitch_anchor_pic_game_picture_initialize(number)
  27.   end
  28.  
  29.   def set_depth (code)
  30.     if code == :under_chipset
  31.      
  32.     elsif code == :under_fog
  33.    
  34.     elsif code == :above_message
  35.      
  36.     end
  37.    
  38.   end
  39.  
  40. end  
  41. #==============================================================================
  42. # ** Sprite_Picture
  43. #------------------------------------------------------------------------------
  44. #  This sprite is used to display the picture.It observes the Game_Character
  45. #  class and automatically changes sprite conditions.
  46. #==============================================================================
  47.  
  48. class Sprite_Picture < Sprite
  49.   #--------------------------------------------------------------------------
  50.   # * Alias Methods
  51.   #--------------------------------------------------------------------------
  52.   alias glitch_anchor_pic_sprite_picture_update update
  53.   #--------------------------------------------------------------------------
  54.   # * Frame Update
  55.   #--------------------------------------------------------------------------
  56.   def update
  57.     glitch_anchor_pic_sprite_picture_update
  58.     if @picture.anchor == true
  59.       self.ox = $game_map.display_x / 4
  60.       self.oy = $game_map.display_y / 4
  61.     end
  62.     self.z = @picture.depth
  63.    
  64.   end
  65.  
  66.  
  67.  
  68.  
  69. end
  70.  
  71.  
  72.  
  73. #==============================================================================
  74. # ** Interpreter (part 1)
  75. #------------------------------------------------------------------------------
  76. #  This interpreter runs event commands. This class is used within the
  77. #  Game_System class and the Game_Event class.
  78. #==============================================================================
  79.  
  80. class Interpreter
  81.   def pic_depth(num, code)
  82.     $game_screen.pictures[num].set_depth(code)
  83.   end
  84. end
Expand to see the code.


Improved key input command

The idea was to make a command like 2003 one, and also, whatever you think in adding to it for eventers. So:

-A wait for trigger key option.
-Selection the valids keys for each key input command.

This is the code i already created, the idea was to have a defined
array of default keys to use in all input calls, and then that you can modify this list in two ways:

-new: creates a totally new set of temporal keys used for that call
-add: add keys to the default list
example:
def_used_keys('add', ['z', 'x', 'up'].

-special mark 'all'. These key mark makes that all are used in a temporal or default context.

Using this you may have the more basic actived, and then add someone if you need.


  1. class Interpreter
  2.   alias wep_interpreter_init initialize
  3.    def initialize(depth = 0, main = false)
  4.     @key_wait = false           # control internal way
  5.     @used_keys = Wep::Default_used_keys.split  # list of used keys setted with default
  6.     @type = 0  # it saves the type of input
  7.     wep_interpreter_init
  8.   end
  9.   #--------------------------------------------------------------------------
  10.   # * Button Input
  11.   #--------------------------------------------------------------------------
  12.   def input_button
  13.     # Determine pressed button
  14.     n = 0
  15.     for i in 1..18
  16.       if Input.trigger?(i) and @used_keys.include?(Input.trigger?(i))
  17.         n = i
  18.       end
  19.     end
  20.     # If button was pressed
  21.     if n > 0
  22.       # Change value of variables
  23.       $game_variables[@button_input_variable_id] = n
  24.       $game_map.need_refresh = true
  25.       # End button input
  26.       @button_input_variable_id = 0
  27.     # Reset values
  28.     if @type == 1 or @type == 2
  29.       @used_keys.clear
  30.       @used_keys=Wep::Default_used_keys
  31.       @type = 0
  32.     end
  33.     end
  34.   end
  35.  
  36.   #--------------------------------------------------------------------------
  37.   # * Button Input Processing
  38.   #--------------------------------------------------------------------------
  39.   def command_105
  40.    
  41.     # Set variable ID for button input
  42.     @button_input_variable_id = @parameters[0]
  43.     # Advance index
  44.     @index += 1
  45.     # End
  46.     return false
  47.   end
  48.  
  49.   #--------------------------------------------------------------------------
  50.   # * Def Used Keys
  51.   #--------------------------------------------------------------------------
  52.   def def_used_keys(type='add', keys)
  53.     # Check for type
  54.     if type == 'add'
  55.       @used_keys+=keys
  56.       @type = 1
  57.     elsif type == 'new'
  58.       @used_keys=keys
  59.       @type = 2
  60.     end
  61.   end
  62.  
  63.   #--------------------------------------------------------------------------
  64.   # * Is Used Key?
  65.   # determine if a key is used
  66.   #--------------------------------------------------------------------------
  67.   def is_used_key?(num)
  68.     # If used keys have a all mark, allways true
  69.     if @used_keys.include?('all')
  70.       return true
  71.     end
  72.     # If not, search for it
  73.     for key in @used_keys
  74.       return true if convert_user_key(key) == num
  75.     end
  76.     # Return false if not valid
  77.     return false
  78.   end
  79.  
  80.   #--------------------------------------------------------------------------
  81.   # * Convert user key
  82.   # this method have to be used to make convertion key-Input constants
  83.   #--------------------------------------------------------------------------  
  84.   def convert_user_key(key)
  85.     case key
  86.      when 'a'; return Input::A
  87.      when 'b'; return Input::B
  88.      when 'c'; return Input::C
  89.     end
  90.   end
  91.  
  92.   def wait_key
  93.    
  94.   end
  95.  
  96. end
  97.  
  98.  
  99. module Wep
  100.   Default_used_keys = ('a', 'b', 'c')
  101. end
Expand to see the code.


Note that will be better to use symbols here because they are easy to type and process and this is not using really the text in strings.

Script command language

The ideas to try to create some sort of scripting 'language' for the call script command that maks the things more easy and quick. For that i planned to use:

-Use of sortcuts to the game information
-Use of event commands with scripts
-Create new functions for this system


We can make everything, and its very quick to do. Here a example:

def cure_all
for actor in $game_party.actors
actor.recover_all
end
end

This is the easy way of doing it.

def cure(id=0)
if id == 0
for actor in $game_party.actors
actor.recover_all
end
else
$game_actors[id].recover_all
end
end

I think that knowing that all database ids start with 1, will be nice to treat a 0 like a "for all". And maybe make this the default values.

Also i think that will be nice to make that each method have a shorter one:
cure- c o cu
cure_all -cu_a

def gold=(value)
$game_party.gold += value
end

def gold
return $game_party.gold
end

Maybe when setting variables values we can make that a value of 0 sets it to 0. If not, to reduce the gold to 0 you have to call gold=-99999.
Another idea is if the use of = in method names is correct or not. Its more slow,that for sure.

A example call script.

gold=500 # This add 500 gold
(a 1).name = 'Wilfred' # (a 1) is like $game_actors[1]
for a in actors # actors is an alias of $game_party.actors
a.hp+=20
end
get_number(1) # This is like a input number command.

In the same way that cure and cure all:


def hp_mod(hp, id=0)
if id == 0
for actor in $game_party.actors
actor+=hp
end
else
$game_actors[id]+=hp
end

end
That can be aliased like mhp or hp. The problem here may be if you want
to make that trully all actors get the bonus. Maybe make that with a id=-1?
Also a nice idea for ids arguments will be to be arrays...

Note that idea was attacked because it lacked new things and was poorly readable. Anyway adding a save support for example, is not hard using my improved save as a basis.

Also i think the readibility things matter when someones wants to read what you have created. Who in the hells reads in a full game for normal events like how you have shown a message or something? thats stupid to do and care.

In 2k/2k3 the people looked for events to understand engines. But in everydary eventing readability dont matters for me. I was planning to finnish this but for now i couldnt.

The topic was here:
http://www.hbgames.org/forums/viewtopic.php?f=155&t=72548

  1. class Interpreter
  2.   def gold=(value)
  3.     $game_party.gold += value
  4.   end
  5.  
  6.   def gold
  7.     return $game_party.gold
  8.   end
  9.  
  10.   def g(value)
  11.     $game_party.gold += value
  12.   end
  13.  
  14.   def vg
  15.     return $game_party.gold
  16.   end
  17.  
  18.   def actor(id)
  19.     return $game_actors[id]
  20.   end
  21.   def a(id)
  22.     return $game_actors[id]
  23.   end
  24.  
  25.   def actors
  26.     return $game_actors.party.actors
  27.   end
  28.   def as(id)
  29.     return $game_actors.party.actors
  30.   end
  31.  
  32.   def steps
  33.     return $game_actors.party.steps
  34.   end
  35.   def st
  36.     return $game_actors.party.steps
  37.   end
  38.    
  39.   def cure_all
  40.     for actor in $game_party.actors
  41.       actor.recover_all
  42.     end
  43.   end
  44.  
  45.   def cure(id=0)
  46.     if id == 0
  47.       for actor in $game_party.actors
  48.         actor.recover_all
  49.       end
  50.     else
  51.       $game_actors[id].recover_all
  52.     end
  53.   end  
  54.  
  55.   def variable(id)
  56.     return $game_variables[id]
  57.   end  
  58.   def v(id)
  59.     return $game_variables[id]
  60.   end  
  61.  
  62.   def switch(id)
  63.     return $game_switches[id]
  64.   end  
  65.  
  66.   def sw(id)
  67.     return $game_switches[id]
  68.   end
  69.  
  70.   def get_number(variable, digits=2)
  71.     @parameters[0] = variable
  72.     @parameters[1] = digits
  73.     command_103
  74.   end
  75.  
  76.   def gnum(variable, digits=2)
  77.     @parameters[0] = variable
  78.     @parameters[1] = digits
  79.     command_103
  80.   end
  81.  
  82.   def wait(frames)
  83.     @wait_count = frames * 2
  84.     command_106
  85.   end
  86.  
  87.   def hp_mod(hp, id=0)
  88.     if id == 0
  89.       for actor in $game_party.actors
  90.         actor+=hp
  91.       end
  92.     else
  93.       $game_actors[id]+=hp
  94.     end
  95.  
  96.   end
  97. end
  98.  
  99. class Game_Party
  100.   #--------------------------------------------------------------------------
  101.   # * Public Instance Variables
  102.   #--------------------------------------------------------------------------
  103.   attr_accessor  :actors                   # actors
  104.   attr_accessor  :gold                     # amount of gold
  105.   attr_reader   :steps                    # number of steps
  106.   #--------------------------------------------------------------------------
  107.   # * Object Initialization
  108.   #--------------------------------------------------------------------------
  109.   def initialize
  110.     # Create actor array
  111.     @actors = []
  112.     # Initialize amount of gold and steps
  113.     @gold = 0
  114.     @steps = 0
  115.     # Create amount in possession hash for items, weapons, and armor
  116.     @items = {}
  117.     @weapons = {}
  118.     @armors = {}
  119.   end
  120. end
Expand to see the code.


Note that i didnt plan to support all comands. There are things for the events are far better.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=68256