public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

[Ace] Can't figure out what I am doing wrong.

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: [Ace] Can't figure out what I am doing wrong.
  • Original author: omoney
  • Original date: June 19, 2012
  • Source thread: https://forums.rpgmakerweb.com/threads/ace-cant-figure-out-what-i-am-doing-wrong.2651/
  • Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support

Summary

My question is why is it that when I call getValue(name) in the code below, that 0 returns when I'm expecting an array. Thanks for reading Spoiler class exampleClass attr_accessor :variableName

Archived First Post

My question is why is it that when I call getValue(name) in the code below, that 0 returns when I'm expecting an array. Thanks for reading

class exampleClass
attr_accessor :variableName

def initialize()
@variableName = {}
end

def someMethod()
@variableName["example"] = [1,2,3,4]
end
end

class Game_Interpreter
alias original_initialize initialize

def initialize(depth = 0)
original_initialize(depth)
$global_variable = exampleClass.new
end

def anotherMethod()
$global_variable.someMethod()
end

def getValue(name)
return $global_variable.variableName[name]
end
end

Code:
Note: I have two events on the map that each activate with action button. The first one calls "anotherMethod" while the second one calls getValue(name). First I talk to the first event than I talk to the second event but getValue(name) returns 0. I am unsure why that is.

More details: http://www.mediafire.com/?zca21o16sutpgxz

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#rgss-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar