Ruby/RGSSx questions that don't deserve their own thread

Look at my edited post above.
@drdhoom i tried both of your attempts and both said undefined method

@kockaadmiralac intrestingly yours also lost the method and wanted new in the scenemanager
Because you didn't put "self" in your method at Setup module. 

def splash_start?Should be

Code:
def self.splash_start?
now yours are throwing new for nil in scenemanager
Can you please define what 'new for nil in SceneManager' means?

We need an exact description of the error and the line where it happened.
Why don't you just follow the standard procedure and do $scene = Scene_Splash.new?


Then you can do $scene.splash_start? ? do this : do that
scenemanager 22

undefined method 'new' for nil:NILCLASS

@shaz i normally would but i want it to be a part of my core script so for the poeple that dont wish to use the splash screen can turn it off.
and? That's not a reason to not do what I said.
@worldwakestd


The real question would be...


Why would you need a module method for that at all?


Just make a constant for it, so people can change that to true/false if they want and check for that module constant.


You don't need a method for doing a setting in a module.


Especially because your module method (splash_start?) just sets a local variable, but won't return anything.


= means setting a value.


== means checking a value.


And why would you make a new class in a module? That will just make it longer to type with no real function.


Don't over-complicate simple scripts or you will end up over-complicating them even more, it's a paradox. 😀


This line:

then id ++ 1Would throw an error for multiple reasons.
It should be += if you want to add something to a variable.


The other reason is the scope of the variable...


id = A local variable. Once the method is over, it will be cleared out as well.


@id = An instance variable. This is what you need to make if you plan to use the variable in multiple methods of the same class.


This means that your 'make_splash_logo' will throw an error (and a few other lines too), unidentified local variable or method 'id', or unidentified method [] for nil class, one of these, forgot which one would trigger.


If you make if/else/elsif conditions with line breaks, you don't need the 'then' at each line's start, you can delete those.


These are the errors I noticed with a quick glance.


Also, please use code tags when you post a piece of code, much easier to read that way.
ok im on here to much, ha such a noob.

anyways I can't seem to find the piece that is throwing this error:

Spoiler
Script" line 409: SyntaxError ...unexpected keyword_end, expecting ':'

end
this is the lines of my script that is mentioned:

Spoiler
    #--------------------------------------------------------------------------
    # Overwrite method; Get First Scene Class
    #--------------------------------------------------------------------------
    def self.first_scene_class
    if WWSTDCoreSetting::Activate_Splash_Screen ?
      $BTEST ? Scene_Battle : WWSTD_Scene_Splash
      : $BTEST ? SceneManager.goto(Scene_Title)
    end
  end
and if you need the whole script(its my first core):

Spoiler
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#             WorldWakeSTD core xxa001
#             Version: 1.1
#             Author: WorldWakeSTD(dp3_tutorial#54 rip↓)
#              link =




#             Date: October 2, 2013
#              Edit Date: October 16, 2015
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#
#    This Core Script adds extra classes and additions to existing classes for
#    use by future WorldWakeSTD scripts and/or any other scripter who
#    finds these additions useful.
#
#   New Additions Include:
#     Module:     WWSTDCoreSetting:           A Module which houses the settings of the Classes
#      » Setting:  Splash Screen Settings      settings block for WWSTD_Scene_Splash Class
#     Module:      WWSTDCore:                  A Module which houses the Classes
#      » Class:    ScreenFilledSprite:            A Sprite which automatically fits to screen.
#     » Class:    TimeTracker:                   A Class Which Keeps Track of Real-Time once Activated.
#     » Edited:   Window_MenuCommand:            Now Allows for quicker menu option creation.
#      » Class:      WWSTD_Scene_Splash:          A class for displaying images befor the title scene.
#      » Class:      WWSTDWindow_Master_xxa001   A class for creating custom windows.
#     Module:     GameEvents:                    A Module to Contain Code for interaction with GameEvents.
#      » Method:   get_event_first_comment:      
#      » Method:      get_event_all_comments:      
#      » Method:      first_scene_class:          an edit to the SceneManager method for the splash screen
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


#===============================================================================
#------------------- core setting module ---------------------------------------
#===============================================================================
module WWSTDCoreSetting
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# **splash Screen Settings**
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#-----------------start----------------]

Activate_Splash_Screen = true
TRANSITION_SPEED_OUT = 3 # Speed images fade out if more than 1.
TRANSITION_SPEED_IN = 30 # Speed images fade in if more than 1.
DURATION = 120 # Time in frames (60f = 1sec) to wait before continue
SPLASH_IMAGES = [
"Graphics/Pictures/enterbrain.png", # Images shown in splash screen.
"Graphics/Pictures/WarStormGames.png"

]
#~~~~~~~~~~~~~~~~~end~~~~~~~~~~~~~~~~~~~]

end

#===============================================================================
#------------------- end core setting module -----------------------------------
#===============================================================================

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!!!!!!!!!!!!!!!!!!! Do Not Touch!! unless you !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#!!!!!!!!!!!!!!!!!!!  know what you are doing  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------- start dp3 mass rip ----------------------------------------
#===============================================================================

#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
($WorldWakeSTD_scripts ||= {})[:WWSTDCore] = true
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
# **  New module:   Class Container
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Class ScreenFilledSprite
# Class TimeTracker
# Class Window_MenuCommand
# Sprite is accessed.
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
module WWSTDCore
#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
# **  New Class:   Screen Filled Sprite
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Creates a sprite which automatically fills the screen and can be disposed
# without needing to dispose of the included bitmap.
# Everything beyond initialisation is still accessed the way a normal
# Sprite is accessed.
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
class ScreenFilledSprite < Sprite
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Object Initialisation
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Filename:   Filename of the Sprite Image, includes path if necessary.
# Visible:    Will be visible? : true by default
# Z:          The Z Value of this sprite on initialisation : 1 by default
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize(filename, visible = true, z = 1)
super()
self.bitmap   = Bitmap.new(filename)
self.x        = 0
self.y        = 0
self.z        = z
self.zoom_x   = (Graphics.width.to_f / self.bitmap.width)
self.zoom_y   = (Graphics.height.to_f / self.bitmap.height)
self.visible  = visible
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Dispose
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def dispose()
self.bitmap.dispose()       unless self.bitmap.disposed?
super()
end
end

#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
# **  New Class:   Time Tracker
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Once initialised, this class keeps track of time in seconds.
# All instances of the TimeTracker class are updated automatically if you
# have chosen to allow themselves to be added to the list (true by default).
#
# Once initialised, simply call the ' time_up? ' method to see if the time
# is up for this TimeTracker.
# Call ' dispose ' once finished.
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
class TimeTracker
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# *+ Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :current_frame  # Current Frame the Tracker is on: Use to Reset Tracker.
attr_reader :seconds        # Seconds until TimeUp: Change to Increase/Decrease the Wait Time.
attr_reader :scenetype      # Scenetype: If not nil, this TimeTracker will only Update if SceneManager is in that Specified Scene.
 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# *- Private Static Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@timetracker_list = []     # Static Variable List/Array containing active instances of TimeTrackers
 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Object Initialisation
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Time:             How long (in seconds) until this TimeTracker has been successful
# Scene Class:      Which Scene Can this TimeTracker be updated in : nil by default, which means it can always be updated no matter what scene it is.
# Add Self To List: Add Self to the Automatic Update List? : true by default. If not true, you need to update the TimeTracker manually
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize(time, scene_class = nil, add_self_to_list = true)
@current_frame  = 0.0
@seconds        = time.to_f
@scenetype      = scene_class
    
@@timetracker_list.push(self) if add_self_to_list
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Dispose
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def dispose()
@@timetracker_list.reject! { |tracker| tracker == self }
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update()
@current_frame += 1.0
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Reset
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def reset()
@current_frame = 0.0
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Get Current Time (in seconds)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def get_current_time()
return (@current_frame / Graphics.frame_rate)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Is Time Up?
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def time_up?()
return (get_current_time() > @seconds)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Get TimeTracker List
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def self.get_timetracker_list()
return @@timetracker_list
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Update TimeTrackers
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def self.update_timetrackers()
@@timetracker_list.each do |tracker|
if tracker.scenetype
if SceneManager.scene_is?(tracker.scenetype)
tracker.update()
end
else
tracker.update()
end
end
end
end

class Scene_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Aliased Method:   Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias WWSTD_WWSTDCore_scenebase_update_xxa001                          update
def update(*args)
WWSTD_WWTSDCore_scenebase_update_xxa001(*args)
WWSTDCore::TimeTracker.update_timetrackers()
end
end
#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
# **  Edited Classes:   Scene Menu Quick Option Creation
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This edit allows for quick Scene Menu Command Creation.
# alias ' WWSTD_WWSTDcore_get_original_commands ' and follow the instructions
# of that method.
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
class Window_MenuCommand < Window_Command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Aliased Listings
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias WWSTD_WWSTDcore_addorigcomnd_xxa001               add_original_commands
alias WWSTD_WWSTDcore_activate_xxa001                   activate
 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * New Method:   Get Original Commands
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   hash = alias
#   hash[ "label" ] = {
#     :enabled    => true/false,
#     :method_ref => method🙂method_name),
#   }
#   return hash
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def WWSTD_WWSTDcore_get_original_commands()
return {}
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Aliased Method: For Adding Original Commands
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def add_original_commands(*args)
WWSTD_WWSTDcore_addorigcomnd_xxa001(*args) # Call Original Method
    
original_commands = WWSTD_WWSTDcore_get_original_commands()
original_commands.each_key do |key|
add_command(key, key.to_sym, original_commands[key][:enabled])
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Aliased Method: Activate
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def activate(*args)
WWSTD_WWSTDcore_activate_xxa001(*args) # Call Original Command
    
original_commands = WWSTD_WWSTDcore_get_original_commands()
original_commands.each_key do |key|
set_handler(key.to_sym, original_commands[key][:method_ref])
end
end
end

#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
# **  New Classes:   Splash Screen Creation
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This displays the images at the beginning of the game.
# in order to change the images and duration they appear
# go to the CoreSettings section above and find the section
# called **Splash Screen Settings**.
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
class WWSTD_Scene_Splash < Scene_Base
#--------------------------------------------------------------------------
# Start Processing
#--------------------------------------------------------------------------
def start
super
@count = 0
@id = 0
@image_changer = false
@opacity = :fade_in
create_image(@id)
end
#--------------------------------------------------------------------------
# Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_image
end
#--------------------------------------------------------------------------
# Create Sprite
#--------------------------------------------------------------------------
def create_image(image)
@sprite = Sprite.new
@sprite.opacity = 0 if @id > 0
@sprite.bitmap = Bitmap.new(WWSTDCoreSetting::SPLASH_IMAGESHow to upload the image to the forums
Now that you have you have an image on your computer you'd like to show us, how can you get it to show up on the forums? Firstly, you need to find an image hosting site, photobucket.com or imageshack.us are popular ones. If you have another image uploading website, great - use that one! Either way, upload it to the site, and then get the direct link. Don't get the resized link, or the thumbnail link, but the direct URL. You'll know you have the direct URL if the URL ends with the file extension you saved your image in (which will hopefully be .png).

Once you have this direct URL to your image, simply use the IMG tags in your forum post and paste the URL in between them. If this image is big, please leave the image in spoiler tags.


IMG tags:
image.png
)
center_sprite(@sprite)
end
#--------------------------------------------------------------------------
# Free Sprite
#--------------------------------------------------------------------------
def dispose_image
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# Move Sprite to Screen Center
#--------------------------------------------------------------------------
def center_sprite(sprite)
sprite.ox = sprite.bitmap.width / 2
sprite.oy = sprite.bitmap.height / 2
sprite.x = Graphics.width / 2
sprite.y = Graphics.height / 2
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
super
@count += 1 unless @image_changer
if @count >= WWSTDCoreSetting:😀URATION
@id += 1 unless @image_changer
if @id >= WWSTDCoreSetting::SPLASH_IMAGES.length
fadeout_all
SceneManager.goto(Scene_Title)
else
unless @image_changer
@opacity = :fade_out
@count = 0
@image_changer = true
end
end
end
change_image if @image_changer
end
#--------------------------------------------------------------------------
# Opacity Fade
#--------------------------------------------------------------------------
def change_image
if @sprite.opacity <= 0
[dispose_image,
create_image(@id)]
@opacity = :fade_in
end
case @opacity
when :fade_out; @sprite.opacity -= WWSTDCoreSetting::TRANSITION_SPEED_OUT
when :fade_in; @sprite.opacity += WWSTDCoreSetting::TRANSITION_SPEED_IN
end
@image_changer = false if @opacity == :fade_in && @sprite.opacity >= 255
end

#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
# **  New Classes:   Window Master Creator
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This is a solid window class for creating new custom windows.
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
class WWSTDWindow_Master_xxa001 < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * base window Window_Master
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
super(wind_X, wind_Y, wind_Width, wind_Height)  # (x, y, width, height) / max window is width = 544, height = 416
end
end
end
end
#=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
# **  New Module:   GameEvents
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This Module Will interact with GameEvents. For now the only code here is:
#     * Get First Comment in Event Page
#     * Get All Comments in Event Page
#      * Overwrite method; Get First Scene Class
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
module GameEvents
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * New Method: Get Event First Comment
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def self.get_event_first_comment( event_id )
      comments = get_event_all_comments( event_id )
      return comments[0]  unless comments.empty?
      return ""
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * New Method: Get Event All Comments
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def self.get_event_all_comments( event_id )
      comments = []
      event = $game_map.events[ event_id ]
      if event.list
        event.list.each do |command|
          if command.code == 108
            comments.push( command.parameters[0] )
          end
        end
      end
      return comments
    end
    #--------------------------------------------------------------------------
    # Overwrite method; Get First Scene Class
    #--------------------------------------------------------------------------
    def self.first_scene_class
    if WWSTDCoreSetting::Activate_Splash_Screen ?
      $BTEST ? Scene_Battle : WWSTD_Scene_Splash
      : $BTEST ? SceneManager.goto(Scene_Title)
    end
  end
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# ** end of module: GameEvents
#~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
end
if you could test and let me know what i need to add and what line that would be very appreciated.
See my previous post. The correct syntax is like this.

Code:
def self.first_scene_class  if WWSTDCoreSetting::Activate_Splash_Screen    $BTEST ? Scene_Battle : WWSTD_Scene_Splash  else    $BTEST ? Scene_Battle : Scene_Title  endend
ok i did it your way and now i am getting an undefined method error on line 209(the update method for scenebase)

of which i know is right b/c it was pulled from dp3's youtube tut #54 so, could you load it on rm and help find what keeps this from working?
This is probably something that deserves its own thread, if you are trying to make a core script.
If I wanna make a damage forecast (a preview of the estimate damage, with the % of hit and % of crit, maybe here http://puu.sh/kSnhL/ac1cd7949f.jpg next to the name of the target), whats the easiest way to do it ? Since we're in a totally different class or something.
You could make a copy of the make_damage_value method, and instead of the last line being setting the damage result, you'd just return the value, then you'd modify how the data are shown to include it.


This differs depending on where you wanna show it. On your picture, that definitely used a custom script and since we don't know what that is, we can't give an exact answer.
Where exactly it shows the damage/hit/crit preview on that screenshot?


I can see the stats of the enemy, a HP/MP bar (those bars are showing that, right?), and the stats of the current actor (Estelle is an actor, I guess).


That number 10, I don't know what it shows... Maybe that is the damage preview?


Ohh, or maybe that screenshot got no such features yet, you just wanted to show us where do you want to put the extra damage/crit/hit preview features?


Anyway, remember that in the 'make_damage_value' method the entire damage formula is run. Some people use that for operating variables and such too, and those operations will be executed too in the preview calculation too. I remember seeing a question about an error with this issue, and it turned out that the damage preview script the user used caused some variables to increase x2 times than it should.


So, there should be a script out there already for damage preview, but you need to be careful what you enter into your damage formula box if you are using one of them.
You could make a copy of the make_damage_value method, and instead of the last line being setting the damage result, you'd just return the value, then you'd modify how the data are shown to include it.
well the problem is that the make_damage_value method use others methods also only  available in Game_Battler. I'm not sure it's a good idea to copy everything.

Nah i didn't put any preview on the picture, I'm fine with just writing the damage forecast next to "Rat", something like "Rat; dmg forecast: 2(80%), 10(10%)".

 

In the yanfly ace battle engine, it's managed by the update_battler_name. Something like that.

 

Code:
  def refresh_battler_name(battler)    contents.clear    reset_font_settings    change_color(normal_color)    if @enemy_window.active      @text = battler_name(battler)," dmg: ", make_damage_value(battler, SOMEHOW GIVE THE SKILL)    else      @text = battler_name(battler)    end    icons = battler.state_icons + battler.buff_icons    dy = icons.size <= 0 ? line_height / 2 : 0    draw_text(0, dy, contents.width, line_height, @text, 1)    dx = (contents.width - (icons.size * 24)) / 2    draw_actor_icons(battler, dx, line_height, contents.width)  end

But then again if i copy the make_damage_value method I need to somehow give the "item" variable, which I don't know when is it accessible.

 

Well if there's already a script for that, i would be delighted if you had a link of it.
It is fine, you'd be doing the calculations inside Game_Battler anyways.... you're just gonna make a duplicate and edit it for purposes of calculations for showing the predicted damage

so something like

Code:
def make_damage_preview(params)  #same methods  #except do not copy the last part where it sets the actual damage to @result  #instead make it return damageend
I did it way back to show predicted damage on the target window.
I want to slightly modify how hitting/evading works for my VX Ace project. I've found where the script handles calculating whether a physical attack succeeds and then whether a successful attack is evaded, but my brain started melting when I started pondering how to implement the formulas I want. So how would I make this work:

  • Physical attacks have a hardcoded base accuracy of 50%—so if a character's HIT is 0, it's a 50% chance to hit. At 50 HIT and above, it's a 100% chance to hit. (So a character's effective HIT is between 50%-150%.)
  • If an attacking character's totalled accuracy is above 100%, then each point above 100% (so, each point of HIT above 50%) negates 2% (multiplicative, not additive) of the target's EVA.
To give examples of how it'd work in-game against an enemy Gloop with 10% EVA, in case it's confusing (all actors/classes would have 0% HIT by default):

  • Hyde's mighty Lucky Hatchet gives a whopping HIT of zero, giving him a 50% chance to miss his attacks. The Gloop retains 10% evasion chance.
  • Radd's Bugstabber has a HIT of 50%, so he has 100% chance to hit.  He will always succeed his hit roll, but the Gloop still has the 10% evasion chance.
  • Simon's Ouchie Bow has a HIT of 80%, meaning his total accuracy is 130%. Simon's hit rolls will always succeed, and the Gloop suffers -60% to its evasion chance, so it only has a 4% chance to evade.
Hopefully that makes sense. Thanks in advance! =^_^=
Well, I suppose you know a bit of Ruby, so I'll just tell you some basic outlines on how to do that.

If you want the whole script made, maybe you should ask in RGSS3 Script Requests.

So, you should in item_eva method do something like :

def item_eva(user, item)  var = item.physical? ? eva : item.magical? ? mev : 0  return var ? user.hit > 1 ? (var - (user.hit - 1)) : var : 0endAnd method in item_hit should look like :

def item_hit(user, item)  return user.hit + 0.5    # 0.5 should be 50%end
At least I think so.

Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/