Group: Member
Posts: 31
Type: Writer
RM Skill: Masterful
So I'm working on learning RGSS2, and already know a bit, but I want to start learning to do some practical stuff. I was wondering if someone could point me towards a tutorial or something that would help me learn how to do the following:
- Create arrays for events and items. - Use those arrays to control events (Like making an array for an abs system enemy that I can load to multiple events to manage stats and behaviors, or collision with the hero or other events (like projectiles) or even make things like switch or pressure plate puzzles.)
Any help would be appreciated, as I've had a hell of a time finding anything about how to do this sort of thing and there's only so much I can do with events (Believe me, I pushed the boundaries of eventing trying to do things like this...). Thanks in advance to anyone who can help.
Also, a few questions about scripting events:
1) What is the code to have an event check it's own properties? It's usually something like self.*, or me.*
2) What is the code to find direction of an event?
This post has been edited by Cirka88: Dec 7 2011, 01:19 PM
Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed
Arrays for characters and event's are already managed. They're: $game_map.events - which contains an array of all events on the current map (based on the event's ID), and: $data_items - which is a hash of all events as seen in the database I believe, 0 corresponding to the first item, 1 - second, etc. I suggest you take a look at the help file and learn the functions of an array. Though really, I'd say you're in over your head if you hope to make an ABS anytime soon - no offense.
answers: 1) Close, self.* would return an instance of the interpreter, that being said, you /should/ be able to do something like: get_character(0)ORself.get_character(0) to get an instance of the event running the script snippet. It will be in a Game_Event format. (I cannot say this is 100% correct, I haven't tested it)
2)$game_map.events[EVENTID].direction - event ID being the ID of the event on the current map, 'direction' will either be 0, 2, 4, or 6 depending on the direction. (I believe up, right, down, left respectively; though I can't be sure) If you want to use it on self but don't know 'self's ID (which you should, you're putting the code in the event you're using..) you should be able to use: (get_character(0)).direction or (self.get_character(0)).direction
__________________________
Got 30 minutes? Then you've enough time to play this awesome game: - potentially promising project page - thanks holder
Group: Member
Posts: 31
Type: Writer
RM Skill: Masterful
Honestly, I know just how much I sound like I'm in over my head (No offense taken). However, the problem I having with learning RGSS2 is only syntax, really (There are so many little things that the help files and google can't tell me, unfortunately). I've programmed before, and I have pretty much mastered every corner of eventing (Which is just a collection of code snippets you piece together) so the theory of how to do things is simple to me. Unfortunately eventing has it's limits, and even the things I can do with events would be made 100 times easier by being able to script them. I'm the polar opposite of a cargo cult programmer, I understand how things work and how to do things, but only in terms of psuedo code...
However, I don't think I'm so skilled I could just jump in and start eventing abs'. I'm just trying to learn some practical scripting knowledge. All the tutorials I can find are either too basic or too advanced.
As for your answers, I did know that there were those arrays already there, but I want to make my own arrays to manage things (Ex, if I did make an ABS, I would want an array to handle instances of the same enemy on a map (Ex Bat01, Bat02, etc.)). And I'll give the other two answers a try and see if they work.
Thanks for the help.
This post has been edited by Cirka88: Dec 7 2011, 03:04 PM
Group: Member
Posts: 31
Type: Writer
RM Skill: Masterful
So I finally (with some help from a friend) found a decent series of tutorials for RGSS2. GubiD has a great series of video tutorials on Youtube for learning RGSS2. If anyone else is looking to start programming RGSS2 and is looking for more than beginner tutorials, just search for GubiD ruby tutorials on Youtube.