Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Scripting]The unbeatable .note, Hail .note! Hails!
-dah0rst-
post Nov 29 2010, 11:23 AM
Post #1


Level 11
Group Icon

Group: Revolutionary
Posts: 174
Type: Scripter
RM Skill: Advanced




Note: To use this tutorial, you should have a minimum experience in using RPG VX Scripts and should know how to access them. But also if you don't understand it- this tutorial could still teach you what's possible on VX!

A question often asked in this forum is: why VX instead of XP? The object.note may be the answer!

But what means .note?
All objects in the standart RPG Library have own methods and variables. For example, the 'Weapon' Object has the variables 'name', 'atk' or the array 'element_set' (which tells you what elements the weapon has). But there is also a array not used in the original VX script- and that's 'note'. You wondered what the note box on the database for weapons, states and so on means? Here you have it.

But what gives this useless .note to me?
The note box is just a field were you can save your own variables- for example you want to do a forge system (were you combine some items into a new one), but you don't want to create a gigantic list of all your items and what items you need to forge them.
For example, i just wrote the names of the items you need for making it into the note box of the item:

I know it doesn't look nice- just an example!






Also, you could use the note box for alternative attributes, like 'armor penetration' or 'life steal percentage' as an integer (means a number like 1,7 or 40)- or for any other shit- the possibilities are unlimited! (and that's why it makes VX so good).
Also you could add extra infos to enemies- like more items to steal or drop. Or a text when you use a scan spell/ ability on them (like: The devil rat uses its teeth to deal damage. Beware of the poisonous bite!) Or even special features like Reflec ability and so on. Do you now get how cool .note is?

So- but how do we access this little .info bastard?
It's very easy- .info is an array of strings saved in the weapon/ state/ armor/ enemy/ ... data. Array of strings means, it's a container with variables in it- like ["reflec ability","Lifesteal:",7,"Regeneration rate:",20]



To get the array, just write this in your script (depending on what object type it is- here it's an enemy):
note=$data_enemies[enemy_id].note

Now you have all the information in your 'note' array stored. To get a specific thing, like the lifesteal rate (which is on place 3 on our array) do this:
lifesteal_rate=note[3]
You see- it's very easy. But using this principle, you have to watch on which place you write- and press space between every piece of information!

But isn't this a bit abstract?
It may be- but there are other ways:
You could also search for a special piece of text, like i did with my forge script. For example, we could search for special abilities the rat has- 'reflec ability' for example...

To do so, use this:
note=$data_enemies[rat_id].note
if note.include?("reflec ability")
reflec_ability=true
else
reflec_ability=false
end

This is just a very small spectrum of how .note could be used- for any questions, feedback and suggestions let me know- I will update this tutorial as good as I can (but I have to know what information you need wink.gif )


__________________________
You want Next Gen graphic algorithms in RPG VX? Ask the horst :P


But don't expect this in real time ;)
Go to the top of the page
 
+Quote Post
   
-dah0rst-
post Dec 4 2010, 02:09 PM
Post #2


Level 11
Group Icon

Group: Revolutionary
Posts: 174
Type: Scripter
RM Skill: Advanced




Update:

Something I forgot to make handling variables even more easier and writing even scripts into items/ characters:

You can also write variable definitions into the note, reading them out via the "eval" command.
For example:

What is written into my weapon's .note:
Firespear:

$recipe=["Hunting Spear","Firestone"]
$lifesteal=5
$minimum_level=8
$weapon_type="Spear"

I can read this out via codes like this:

def recipe (item)
$recipe=[] #creates a placeholder global variable- also deletes the old one
eval(item.note) #converts the text in .info into script
return $recipe #returns the variable
end

Never mix script with non-script text in the note box!!!


__________________________
You want Next Gen graphic algorithms in RPG VX? Ask the horst :P


But don't expect this in real time ;)
Go to the top of the page
 
+Quote Post
   
onidsouza
post Jan 20 2011, 07:07 PM
Post #3


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




Oh, well, you can mix both, just define a certain order, or a especial character/phrase to separate on from another. And then you can use eval() at one part of the note, and still process simple information given ^^

you just need a pre-defined separator, for example a line written: %script% , so everything after that line will be processed with the Eval() command =D


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
Philip
post Feb 8 2011, 10:00 AM
Post #4


Nura (The Jade Ring)
Group Icon

Group: Revolutionary
Posts: 325
Type: Developer
RM Skill: Masterful




Hm... very interesting. I'll have to give it a try and see how it works. I too was one of the people that wondered what the stupid notebox was for until I started seeing scripts for using it.


__________________________
"If your mind goes blank don't forget to turn off the sound." Unknown Author

Phil


Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 12:18 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker