Help - Search - Members - Calendar
Full Version: [SOLVED]Quick (hopefully) question about arrays
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
munkis
Basically what I'm trying to figure out is how to make something happen in a script when the status of an element (any element) in an array changes.
Jens of Zanicuud
What do you mean with "the status of an element"?

Anyway, if you wanna check if an array was modified, then:

class Script

def initialize(element_array)

@old_array = element_array.clone
...
end


def update
...
element_array = #the array you wanna check#
if @old_array != element_array
@old_array = element_array.clone
trigger #trigger method
end
...
end

def trigger
#what happens when array changes#
end

end

I hope this is clear enough...
Feel free to ask for support.

Jens
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.