Interpreter

Started by Apidcloud, February 17, 2011, 01:18:14 pm

Previous topic - Next topic

Apidcloud

Hey everyone again xD
I was studying some methods from the Interpreter class, but I can't understand what are that @parameteres[0], ...[1] and ...[2], etc <.<

Does someone know any tutorial or something about this class? I really need it (:

Appreciate  :haha:
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

winkio

@parameters are the parameters for each command.  You can think of each command as a method which must be passed a certain set of parameters.  For example, the parameters for something like Add Item would be [int, int], the first number for the ID of the item, the second number for the amount.  What is in the parameters changes for each command according to its function.  I doubt there's a good tutorial anywhere on this, but you can always look at the code for each command (Interpreter 3-7) and figure out what each element in parameters does.

Apidcloud

February 17, 2011, 01:26:56 pm #2 Last Edit: February 17, 2011, 01:36:38 pm by Apidcloud
Well, I thought about that 2, but at 'add_item' there are 3 parameters... (on value variable at the script)
Maybe the last one is the variable?

I say this because at the event  add_item there is the id, the value of the amount and the variable...



value = operate_value(@parameters[1], @parameters[2], @parameters[3])
   # Add / remove the right amount of items
   $game_party.gain_item(@parameters[0], value)
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

winkio

@parameters for the add item command:

[0] - item ID
[1] - operation (0 for increase, 1 for decrease)
[2] - type (0 for constant, 1 for variable)
[3] - operand (number for constant, or variable ID for variable


I was just giving a theoretical example because I didn't have RMXP up.  But if you want to find something, just look through the Interpreter class and figure it out.

Apidcloud

Lol, that sound nice to me xD and has its logic (:

I tried to figure it out, but each of these variables change for each type of events or not? (Now im thinking they are always the same xD)

Thanks a lot ^^
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

Fantasist

They are simply the options you enter for that particular event command in the RMXP interface, and the order would be similar. Of course, the comments should shed some light on what parameters exactly do.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Apidcloud

In my version (portuguese one) there aren't elucidative comments there xD, that's why I've made this topic as well^^


Anyway, I got the main point now (:

Thanks both
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit