Guest Access
Go to page : 1, 2
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
RGSS stands for:
RUBY GAME SCRIPTING SYSTEM
it is the library of scripts (pages of code)
setup up to be used in reference
when you code functions for RMXP scripts.
RUBY is the programming language
which allows greater flexibility of
development with an interface
using basic data structures
configured by the editor.
as one of my New Year's resolutions
(that I'm going to stick with)
I've been studying to be better at scripting.
Here's the lessons I've studied so far...
(doesn't mean I understand them :-P )
I encourage any of you who are interested
in making your very own scripts to join me.
Just know that it's going to be a timely,
challenging, and brain-twisting process.
RGSS & Ruby Lesson - Chapter 1
LESSON 1 (class, method, initialize, call script)
LESSON 2 (attributes, instance variables, advance call script)
RGSS & Ruby Lesson - Chapter 2
LESSON 3 (constants, global and class constant variables)
LESSON 4 ("conditional statements")
SAMPLE A
I'll continue to add links that I've studied or plan to study
http://ruby-doc.org/docs/ProgrammingRuby/html/ref_c_dir.html
RUBY GAME SCRIPTING SYSTEM
it is the library of scripts (pages of code)
setup up to be used in reference
when you code functions for RMXP scripts.
RUBY is the programming language
which allows greater flexibility of
development with an interface
using basic data structures
configured by the editor.
as one of my New Year's resolutions
(that I'm going to stick with)
I've been studying to be better at scripting.
Here's the lessons I've studied so far...
(doesn't mean I understand them :-P )
I encourage any of you who are interested
in making your very own scripts to join me.
Just know that it's going to be a timely,
challenging, and brain-twisting process.
RGSS & Ruby Lesson - Chapter 1
LESSON 1 (class, method, initialize, call script)
- Spoiler:
- Code:
###########################################################################
############### RMXP + RGSS + RUBY + SCRIPT = Lesson 1 #############
############### Class, initialize method, call script #############
###########################################################################
=begin
Start Scriptin'
by Gameface101
1-14-10
=end
class Message_Button #-------------=[define a new CLASS called "Message_Button"]
#-----------------------------------------=[space for convention / organization]
def initialize #----------------------=[define a new METHOD called "initialize"]
print "PLAY ON!" #---------------------=[EXECUTE CODE when method is called]
end #-----------------------------------=[close the METHOD named "initialize"]
#-----------------------------------------=[space for convention / organization]
end #---------------------------------=[close the CLASS called "Message_Button"]
=begin
Intructions:
to call this class named "Message_Button"
- create an event
- use call script
-
"Message_Button.new"
NOTE:
The method "initialize" is a default method that is executed
when you use the ".new " syntax.
=end
LESSON 2 (attributes, instance variables, advance call script)
- Spoiler:
- Code:
###########################################################################
############### RMXP + RGSS + RUBY + SCRIPT = Lesson 2 #############
########### attributes, instance variables, advance call script ########
###########################################################################
=begin
Start Scriptin'
by Gameface101
1-15-10
=end
class Message_Button2 #-----------=[define a new CLASS called "Message_Button2"]
#-----------------------------------------=[space for convention / organization]
attr_accessor :greeting #--------=[define ATTRIBUTE VALUE for "Message_Button2"]
attr_accessor :name #---=[define a second ATTRIBUTE VALUE for "Message_Button2"]
#--------------------------------------------------------------=[proper spacing]
def initialize(greeting, name)#----------=[define method to recieve ARGUMENTS]
@greeting=greeting #------=[INSTANCE VARIABLE to store data for "greeting"]
@name=name #------------------=[INSTANCE VARIABLE to store data for "name"]
end #----------------------------------=[close the METHOD named "initialize"]
#--------------------------------------------------------------=[proper spacing]
def say #-----------------------------------------------=[define METHOD "say"]
print @greeting + " " + @name #=[print content for greeting, space, and name]
end #----------------------------------------------------=[close METHOD "say"]
#--------------------------------------------------------------=[proper spacing]
end #--------------------------------=[close the CLASS called "Message_Button2"]
=begin
Intructions:
to call this message create an event, use call script
[define oriented object]
message1=Message_Button2.new("greeting1", "name1")
message2=Message_Button2.new("greeting2", "name2")
[to show complete message]
message1.say
message2.say
[to show only name]
print message1.name
print message2.name
[to show only greeting]
print message1.greeting
print message2.greeting
NOTE2:
Simply use the "ATTR_ACCESSOR" syntax to define a new attribute.
=end
RGSS & Ruby Lesson - Chapter 2
LESSON 3 (constants, global and class constant variables)
- Spoiler:
- Code:
################################################################################
############### RMXP + RGSS + RUBY + SCRIPT = Lesson 3 ##################
########### CONSTANTS, GLOBAL and CLASS CONSTANT VARIABLES ##############
################################################################################
=begin
Start Scriptin'
by Gameface101
1-16-10
=end
A_CONSTANT=100 #------------------------=[define a GLOBAL CONSTANT to equal 100]
#--------------------------------------------------------------=[proper spacing]
class Constant_Test_1 #-------------=[define a new CLASS called Constant_Test_1]
ANOTHER_CONSTANT=50 #---------------=[define a new CLASS CONSTANT to equal 50]
#--------------------------------------------------------------=[proper spacing]
def initialize #--------=[define initialize METHOD for CLASS "Constant_Test_1]
print ANOTHER_CONSTANT #----------------------=[print ANOTHER_CONSTANT value]
print A_CONSTANT #----------------------------------=[print A_CONSTANT value]
end #-----------------------------------------------=[close initialize method]
#--------------------------------------------------------------=[proper spacing]
end #---------------------------------------=[close the CLASS "Constant_Test_1"]
#--------------------------------------------------------------=[proper spacing]
class Constant_Test_2 #-------------=[define a new CLASS called Constant_Test_2]
#--------------------------------------------------------------=[proper spacing]
def initialize #--------=[define initialize METHOD for CLASS "Constant_Test_2]
print Constant_Test_1::ANOTHER_CONSTANT #-----------------=[see notes below]
print A_CONSTANT #---------------------------------=[print A_CONSTANT value]
end #-----------------------------------------------=[close initialize method]
#--------------------------------------------------------------=[proper spacing]
end #---------------------------------------=[close the CLASS "Constant_Test_2"]
#--------------------------------------------------------------=[proper spacing]
class Constant_Test_3 #-------------=[define a new CLASS called Constant_Test_3]
A_CONSTANT+=1 #---------=[define CLASS CONSTANT - A_CONSTANT to equal +1 more]
#--------------------------------------------------------------=[proper spacing]
def initialize #-------=[define initialize METHOD for CLASS "Constant_Test_3"]
print A_CONSTANT #---------------------------------=[print A_CONSTANT value]
end #-----------------------------------------------=[close initialize method]
#--------------------------------------------------------------=[proper spacing]
end #---------------------------------------=[close the CLASS "Constant_Test_3"]
=begin
Instructions:
to call each CLASS , create an event and use the following call script
[print ANOTHER_CONSTANT then A_CONSTANT]
Constant_Test_1.new
[print ANOTHER_CONSTANT from another class and A_CONSTANT]
Constant_Test_2.new
[print A_CONSTANT + 1]
Constant_Test_3.new
NOTES:
line 25 = print CLASS CONSTANT "ANOTHER_CONSTANT" from CLASS "Constant_Test_1"]
A "CONSTANT" is a 'container' that contains a certain value.
They are to be in ALL CAPS and not within any method.
=end
LESSON 4 ("conditional statements")
SAMPLE A
- Spoiler:
- Code:
###########################################################################
############### RMXP + RGSS + RUBY + SCRIPT = Lesson 4 #############
################## IF STATEMENYS CONDITIONAL BRANCH ###############
###########################################################################
=begin
Start Scriptin'
by Gameface101
1-18-10
=end
#SAMPLE A
class If_Stat_1 #-----------00000----=[define new CLASS called "If_Statement_1"]
@@a_class_variable=10 #----------------=[set class variable value to equal 10]
#--------------------------------------------------------------=[proper spacing]
def initialize #-----------------------------------=[define METHOD initialize]
@@a_class_variable+=1 #--------------------------=[+1 to "a_class_variable"]
a_local_variable=13 #------------=[set "a_local_variable" value to equal 13]
#--------------------------------------------------------------=[proper spacing]
if @@a_class_variable==a_local_variable #--[condition statement - see notes]
print "MATCH!" #-------------------=[show message button with " message "]
else #------------------=[if condition above is not true then process below]
print "Nope, wrong number" #------------=[message button with " message "]
end #-----------------------------------------=[close conditional statement]
#--------------------------------------------------------------=[proper spacing]
end #---------------------------------------------=[close METHOD "initialize"]
#--------------------------------------------------------------=[proper spacing]
end #--------------------------------------------=[close CLASS "If_Statement_1"]
=begin
Instructions:
create and event and use call script command
[ will = 11]
If_Stat_1.new
[ equals 12]
If_Stat_1.new
[equals 13 MATCH!]
If_Stat_1.new
[equals 14]
If_Stat_1.new
[to reset]
???
NOTES:
line 19 - "if" "a_class_variable" is equal to "a_local_variable (then line 20)
=end
I'll continue to add links that I've studied or plan to study
http://ruby-doc.org/docs/ProgrammingRuby/html/ref_c_dir.html
Administrator
Show Signature
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
BluE
profile
yes. It seems that this resolution did work out for you.
C.O.R.N.
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
Also it helps to keep the manual near by.
Programers Guide
Programers Guide
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
BluE
profile
^ ^ I've tried before but I just never have the patience to actually do it..
C.O.R.N.
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
To me its exciting and fun cause you challenge your self to do something and then the feeling when you complete is great.
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
BluE
profile
I get that feeling when I make;/edit images...
C.O.R.N.
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
I get it with events more then i do with scripting but its starting to change, every one finds something that makes them happy.
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
nah, im not that good (yet), im learning the basics still.
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
Go to page : 1, 2