View unanswered posts | View active topics It is currently Fri Sep 03, 2010 8:58 am

Forum rules


1. You shall not post anything against the global rules of this forum nor against the law of the country you or anyone lives in(that includes Child Porn and things like that).
2. You shall not flame, spam, be 1337 HAXX0rZ or just act like an obnoxious little brat.
3. You shall not act smart(unless you are)
4. You shall not give useless comments, only constructive critisism is allowed here.
5. You shall not upload resources, tutorials or games related to RPG Maker in this section that are not yours without permission and credits.
6. You shall not look at fellow members, mods, admins or Ryon in disrespect. Only look in awe.
7. You shall not post here without proper knowledge of the English language. Double-Check your posts for grammatical errors. Correct grammar and spelling makes it easier to read and understand for everyone.
8. Mindless and/or one-word posts made by post-count hunters will be deleted.
9. You shall not abuse the smileys to an unuasual extent. Only abuse them in small amounts.
10. You shall not advertise your Resources, Games, Tutorials or Topics continually everywhere. This can be labelled as spam and will not be tolerated.
11. If your topic contains any material not suited for minors, add a [NSFW] tag in your topic title.
12. Use the following tags when posting topics:
[TUTORIAL], [QUESTION], [CHIPSET], [CHARSET], [WINDOW SKIN], [GRAPHIC], [RECOURCE], [SCRIPT], [FULL GAME], [FULL GAME WIP], [OTHER]
Tags speak for themselves.
13. When posting a resource, include at least one screenshot. When posting a Full Game, include at least two screenshots. Please refrain from making Full Game WIP topics without being able to show at least two screenshots. Tutorials are nicer with pictures.
14. You shall not correct the grammar in this post. My English is better than yours! If I would be correcting all your mistakes, I'd be busy for a long while.
15. CAPZ LOCK IZ CRUIZE CONTROL FOR COOWL! It's also a one-way ticket to ban land.



Reply to topic  [ 1 post ] 
 [TUTORIAL] Defining Definitions 
Author Message
Level 1
Level 1
User avatar

Joined: Sat Aug 22, 2009 6:53 am
Posts: 142
Location: Arnhem
Post [TUTORIAL] Defining Definitions
RPG Maker Tutorial

Topic: Defining Definitions
Creator: Melchior M. Philips
Version: VX/XP
Coding: Yes
Difficulty: Intermediate

Having a hard time coding in Ruby?
have know idea HOW to code in Ruby?
Well, here's a little basic thing in Ruby Coding: definitions.

As you scroll trough the script editor, you'll notice that it uses alot of definitions.
So how do you define one?

Well, Defining a definition is not much harder than defining a word. In your avarage dictionary, Words are defined using the following Pattern:
Quote:
Word(pronounciation), (verb/noun/whatever), ~(multiple).
1. Definition one.
2. Definition two.
Sayings with the word in it.


Obviously, definitions don't need pronounciations or Multiples(well, not in this tut). Most definitions also have only one definition, and definitions are defined for later use in coding, therefore it doesn't need the saying either.
what it does need however, is an end, so that the code can see you stopped defining this particular definition. to do this, we simply add "end" at the bottom.
now we have this:
Quote:
(Word)
(definition)
end


not too hard is it? well, we're not done yet.
To make sure the code know we're defining a definition, we have to add "def (definition)" at the beginning.
For tutorial purposes, we want this string to display the Hero's name, so let's just call our definition "HeroName".
Quote:
def HeroName
(definition)
end


now for the actual defining of the definition.
if you want it to display the hero's name, simply put "return $data_system.hero.hero0001.name"
so the end result should be:
Quote:
def HeroName
return $data_system.hero.hero0001.name
end


$data_system means that it is a term pre-defined in the database.
.hero means it's in the hero tab.
.hero0001 means it's referring to the first hero
.name returns it's name.
so basically it's:
Quote:
Define: "HeroName"
Definition: the name of the first hero mentioned in the hero tab of the database.
end of definiton


I hope this helped you make sense of definitions.
- Melchior M. "Undefined" Philips

_________________
Lord Melchior's Cult (Leader)
Click the sig for my website
Image


Sat Aug 22, 2009 1:46 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.