New to Ruby, Need Help with Simple Script

Hello all I just picked up some ruby tutorials a few days ago and I thought of a way I could apply it to RPG Maker but I need a bit of help.

A lot of the things in the tutorial deal with virtual dogs and cats however I would like to apply these things to a in game virtual sheep.

I'm not really sure how to do it though. I felt like if I were shown how to do it once I could apply all the other things I learned to my sheep.

Basically what I would like to do is create a common script where all my sheep are declared a variable. And create a method to force my sheep to move randomly. I'm not 100% sure I phrased that right but I think you get what I mean. I want to be able to apply attributes both to individual sheep as well as all sheep.

Class Sheep
    def initialize
    

sheep = $game_map.events[sheep1, sheep2, sheep3, sheep4, sheep5, sheep6, sheep7]
I wouldn't make a Sheep class, nor is that a proper way to reference an array.  I am not even entirely sure what your trying to do.  Are you trying to get them to move randomly with a single method?
If you open the database, go to the second tab " Classes" 

In the bottom left is "change maximum" , allot yourself one extra space

Name it "Sheep"

Save

-----------------------------------------------------------

Agreeing with Zetu.. I'm not sure what you are trying to get out of a script. It isn't needed at all.
If you open the database, go to the second tab " Classes" 

In the bottom left is "change maximum" , allot yourself one extra space

Name it "Sheep"

Save
 A ruby class (or any class in a programming language) has absolutely nothing to do with actor classes from an RPG 😉

@ajilejay: different types of variables require different forms of declarations.

I think you're trying to create an array where the elements can have additional values assigned to them?

In that case (as one way, there are probably better ways) you need to define an array as an instance of that class first, and it should not be initialised by the entire event data structure, but just given the ID of the events to each element of the array.

However I think it would be best if you temporarely stop trying to script it and tell us what you want to do first. There are several existing scripts that might be used instead if we know what you're trying to do (PKK8' self data suite for example)
I'm not actually trying to produce something in game for gameplay purposes. This is strictly to help me learn ruby better via RPG Maker. I want to apply my lessons to a sheep in game because I feel like it is more visual and clear to see the results in game than in command prompt.

 I would like to apply my lessons to things in the game. I feel like I could do this with a script and a event with a graphic of a sheep. What I wanted demonstrated for me was being able to manipulate a group of sheep both as a group and individually. Specifically I would like to know how to make them move randomly as a group as well as individually with a script. I feel like if I had an example to reference I could take it from there. I could apply my future and past ruby lessons to in game applications. I would greatly appreciate it!
 
All I want to do is apply this to a actual sheep in game. I just want a example to draw reference from... PLEASE SOMEONE HELP

class Dog
def set_name( aName )
@myname = aName
end
def get_name
return @myname
end
def talk
return 'woof!'
end
end

mydog = Dog.new
mydog.set_name( 'Fido' )
p(mydog.get_name)
p(mydog.talk)

Original thread: https://forums.rpgmakerweb.com/threads/new-to-ruby-need-help-with-simple-script.15473/