Uninitialized Constant

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
Sorry about the flood of code related questions last for the night I promise;

okay I'm using theo's script slightly edited:

My edited version

module Theo  module AfterIMG    class << self      attr_accessor :Dash_AfterImage      attr_accessor :opac      attr_accessor :rate    end          @Dash_AfterImage = false      @opac = 10      @rate = 5  endend# =============================================================================# Akhir dari konfig# =============================================================================class Game_CharacterBase  attr_accessor :afterimage  attr_accessor :afterimage_opac  attr_accessor :afterimage_rate   alias theo_afterimg_public_members init_public_members  def init_public_members    theo_afterimg_public_members    init_afterimage  end   def init_afterimage    @afterimage = false    @afterimage_opac = Theo::AfterIMG::opac    @afterimage_rate = Theo::AfterIMG::rate  end endclass Game_Player < Game_Character   def afterimage    super || (moving? && (Theo::AfterIMG::Dash_AfterImage ? dash? : false))  end endclass Game_Event   def afterimage    super && near_the_screen?  end   alias theo_afterimage_setup_page setup_page  def setup_page(new_page)    theo_afterimage_setup_page(new_page)    init_afterimage    setup_afterimage if @page  end   def setup_afterimage    @list.each do |list|            code = list.code      next if code != 108 && code != 408      case list.parameters[0]      when /<afterimage>/i        @afterimage = true      when /<(?:aft opact|AFT_OPACT):\s*(\d+)\s*>/        @afterimage_opac = $1.to_i      when /<(?:aft rate|AFT_rate):\s*(\d+)\s*>/        @afterimage_rate = $1.to_i      end    end  end endclass Sprite_Character < Sprite_Base   def afterimage    return @character.afterimage  end   def on_after_cloning(cloned)    cloned.char = character  end   def clone_class    Sprite_AfterImage  end   def updating_afterimages?    return true  end   alias theo_afterimage_char_update update  def update    theo_afterimage_char_update    update_afterimage_info  end   def update_afterimage_info    @afterimage_opac = @character.afterimage_opac    @afterimage_rate = @character.afterimage_rate  end endclass Sprite_AfterImage < Sprite  def char=(char)    @char = char    @rx = char.real_x    @ry = char.real_y    @shift_y = char.shift_y    @jump_height = char.jump_height    set_map_display_value  end   def set_map_display_value    @display_x = $game_map.display_x    @display_y = $game_map.display_y  end   def screen_x    $game_map.adjust_x(@rx) * 32 + 16  end   def screen_y    $game_map.adjust_y(@ry) * 32 + 32 - @shift_y - @jump_height  end   def diff_display_x    @display_x - $game_map.display_x  end   def diff_display_y    @display_y - $game_map.display_y  end   def x_case    screen_x + diff_display_x  end   def y_case    screen_y + diff_display_y  end   def update    super    self.x = x_case    self.y = y_case  end end

Original (In indonesian, I used google translate)

# =============================================================================# TheoAllen - AfterImage# Version : 1.0# Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com# (This script documentation is written in informal indonesian language)# -----------------------------------------------------------------------------# Requires :# >> Theo - Clone Image (Basic Modules)# =============================================================================($imported ||= {})[:Theo_AfterImage] = true# =============================================================================# Change Logs:# -----------------------------------------------------------------------------# 2013.10.22 - Finished script# ==============================================================================begin ----------------------------------------------------------------------------- Perkenalan : Script ini nambahin effect "after image". Apa itu after image? Semacem efek ninggalin bekas gambar kalo bergerak. ----------------------------------------------------------------------------- Cara penggunaan : Pasang script ini dibawah material namu diatas main Gunakan comment pada event untuk menentukan event tersebut ada afterimagenya atawa kaga seperti ini <afterimage> <aft opact: n> <aft rate: n> Keterangan : <afterimage> Tag ini menandakan bahwa event (dengan page saat) itu menggunakan afterimage <aft opact: n> Pergantian opacity tiap frame. Ganti n dengan angka. Semakin tinggi nilainya, semakin cepat pula efek afterimage ilang <aft rate: n> Jarak antara after image satu dengan yang lain. Semakin gede, semakin jauh pula jaraknya ----------------------------------------------------------------------------- Script call : Kamu juga bisa aktivasi afterimage melalui script call dari set move route. Caranya gini. Buka event > Set Move Route > Script : self.afterimage = true / false self.afterimage_opac = angka self.afterimage_rate = angka ^ Script call ini kegunaannya sama kek diatas ----------------------------------------------------------------------------- Terms of use : Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau dipake buat komersil, jangan lupa, gw dibagi gratisannya. =end# =============================================================================# Sedikit Konfig# =============================================================================module Theo module AfterIMG Default_Opacity = 10 # Nilai default untuk pergantian opacity Default_Rate = 5 # Nilai default untuk jarak antar gambar Dash_AfterImage = true # Jika true, maka saat kamu dashing akan keluar # effect afterimage endend# =============================================================================# Akhir dari konfig# =============================================================================class Game_CharacterBase attr_accessor :afterimage attr_accessor :afterimage_opac attr_accessor :afterimage_rate alias theo_afterimg_public_members init_public_members def init_public_members theo_afterimg_public_members init_afterimage end def init_afterimage @afterimage = false @afterimage_opac = Theo::AfterIMG::Default_Opacity @afterimage_rate = Theo::AfterIMG::Default_Rate end endclass Game_Player < Game_Character def afterimage super || (moving? && (Theo::AfterIMG::Dash_AfterImage ? dash? : false)) end endclass Game_Event def afterimage super && near_the_screen? end alias theo_afterimage_setup_page setup_page def setup_page(new_page) theo_afterimage_setup_page(new_page) init_afterimage setup_afterimage if @page end def setup_afterimage @list.each do |list| code = list.code next if code != 108 && code != 408 case list.parameters[0] when /<afterimage>/i @afterimage = true when /<(?:aft opact|AFT_OPACT):\s*(\d+)\s*>/ @afterimage_opac = $1.to_i when /<(?:aft rate|AFT_rate):\s*(\d+)\s*>/ @afterimage_rate = $1.to_i end end end endclass Sprite_Character < Sprite_Base def afterimage return @character.afterimage end def on_after_cloning(cloned) cloned.char = character end def clone_class Sprite_AfterImage end def updating_afterimages? return true end alias theo_afterimage_char_update update def update theo_afterimage_char_update update_afterimage_info end def update_afterimage_info @afterimage_opac = @character.afterimage_opac @afterimage_rate = @character.afterimage_rate end endclass Sprite_AfterImage < Sprite def char=(char) @char = char @rx = char.real_x @ry = char.real_y @shift_y = char.shift_y @jump_height = char.jump_height set_map_display_value end def set_map_display_value @display_x = $game_map.display_x @display_y = $game_map.display_y end def screen_x $game_map.adjust_x(@rx) * 32 + 16 end def screen_y $game_map.adjust_y(@ry) * 32 + 32 - @shift_y - @jump_height end def diff_display_x @display_x - $game_map.display_x end def diff_display_y @display_y - $game_map.display_y end def x_case screen_x + diff_display_x end def y_case screen_y + diff_display_y end def update super self.x = x_case self.y = y_case end end

Can someone tell me why i'm getting this error



When loading this:

AfterIMG.Dash_AfterImage = truein the event box.
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
it's mean a constant like  CONSTAN = something 

is not called prorepelly or it's not recognize by the system so you might provoked a bug by editing it
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
I'm not understanding...

How can I fix this?
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
not modify the core attr_accessor at all...you changed lines everywhere this why it's bug....if you wanted to translate it just translatre comment not the  code

class << self attr_accessor :Dash_AfterImage attr_accessor :opac attr_accessor :rate end that's one of the cause who make everything bug

and I am sure you provoked few other bug just by begin to change everything by modify everything when you not know wich part serve to wich part ....

modify script like that when you not have the knowledge in script is a really bad idea you will just make your game crash for nothing

and the part the system show a error is here : 

Code:
module Theo  module AfterIMG        Default_Opacity = 10  # Nilai default untuk pergantian opacity    Default_Rate    = 5   # Nilai default untuk jarak antar gambar        Dash_AfterImage = true # Jika true, maka saat kamu dashing akan keluar                           # effect afterimage      endend# ====
 
Last edited by a moderator:

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
Ok, maybe I wasn't quite clear on what I was doing... I did only translate the comments

I changed the script around to this

module Theo module AfterIMG class << self attr_accessor :Dash_AfterImage attr_accessor :opac attr_accessor :rate end @Dash_AfterImage = false @opac = 10 @rate = 5 endendbecause I was trying to be able to access the Dash_AfterImage variable from the event command box...

NOT to just play with the code...

I have some knowledge in scripting, I was not just playing with the code I was actually trying to do something, My fault though, I was not clear enough.
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
you wanted to access it via the event command box...you mean the script call?
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
use the non edited version of the script and past this snipset below the script :

class Game_CharacterBase attr_accessor :afterimage attr_accessor :afterimage_opac attr_accessor :afterimage_rate alias theo_afterimg_public_members init_public_members def init_public_members theo_afterimg_public_members init_afterimage end def afterimage return @afterimage end def afterimage_opac return @afterimage_opac end def afterimage_rate return @afterimage_rate end def init_afterimage @afterimage = false @afterimage_opac = Theo::AfterIMG::Default_Opacity @afterimage_rate = Theo::AfterIMG::Default_Rate end endthen use this script call :

Game_CharacterBase.afterimage = true¸Game_CharacterBase.afterimage_opac = 10Game_CharacterBase.afterimage_rate = 3it's should work but I am not sure
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
You changed the constants to instance variables, so you have to change all those

Code:
Theo::AfterIMG::<...>
to
Code:
Theo::AfterIMG.<...>
Also, in your call you are missing the topmost module "Theo", that's why he tries to find "AfterIMG" in Game_Interpreter and fails.
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
use the non edited version of the script and past this snipset below the script :

class Game_CharacterBase attr_accessor :afterimage attr_accessor :afterimage_opac attr_accessor :afterimage_rate alias theo_afterimg_public_members init_public_members def init_public_members theo_afterimg_public_members init_afterimage end def afterimage return @afterimage end def afterimage_opac return @afterimage_opac end def afterimage_rate return @afterimage_rate end def init_afterimage @afterimage = false @afterimage_opac = Theo::AfterIMG::Default_Opacity @afterimage_rate = Theo::AfterIMG::Default_Rate end endthen use this script call :

Game_CharacterBase.afterimage = true¸Game_CharacterBase.afterimage_opac = 10Game_CharacterBase.afterimage_rate = 3it's should work but I am not sure
The variable i'm trying to access is Dash_AfterImage

You changed the constants to instance variables, so you have to change all those

Theo::AfterIMG::<...>to
Code:
Theo::AfterIMG.<...>
Also, in your call you are missing the topmost module "Theo", that's why he tries to find "AfterIMG" in Game_Interpreter and fails.
How should I write my call?
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Theo::AfterIMG.Dash_AfterImage = true
 

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
572
Reaction score
145
First Language
Engilsh
Primarily Uses
RMMV
It worked! Thank you very much.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top