MQ2Data Technical Reference (definitions, explanations)

General announcements relating to the modularized MacroQuest2 system.

Moderator: MacroQuest Developers

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

MQ2Data Technical Reference (definitions, explanations)

Post by Lax » Sat Apr 10, 2004 4:07 pm

MQ2Data uses a hefty chunk of terms to describe things that you may not have heard of or completely understand. So, here's some information to help you along.

Objects
Objects are "something"s. I have a desk I'll call "MyDesk", it is a something and therefore an object.

Types
Types describe an object. Every object is one type. Some objects can be described by multiple types. I have a desk we're calling "MyDesk", it is an object of type "desk". "desk MyDesk" represents the object and the type to you. If I say "desk MyDesk" it means an object called "MyDesk" of type "desk".

Members
Another word for "Members" might be "Properties", things that are property (owned by, contained by, etc) of objects of that type. For example, the "desk" type of object might have a property called "Screws". The "Screws" property itself might be represented like this: We have a member of desk called "int Screws". "int" is a type of object which means WHOLE NUMBER, and "Screws" is the name of the object. To demonstrate an object named Screws that is a member of the "desk" type, we may also say "int desk.Screws".

Top-Level Objects
A "Top-Level Object" is any kind of object that you can "Start" with. "desk MyDesk" is a potential top-level object. It's called top-level because there is nothing before it. It is not a member of any object. It is just an object. Therefore if there was "person Me", you could not do "Me.MyDesk" or "MyDesk.Me" and furthermore if there was "desk person.Desk", "Me.Desk" has nothing to do with "MyDesk". Top-Level Objects are different than types.

Another way of looking at top-level objects is to pretend there is an object that has a member for all top-level objects... call it "Root". "Root.Me" "Root.MyDesk". Every "top-level object" is a member of this root object. "Root.Me.Desk" is an object of type "desk", and is independent of "Root.MyDesk", which is also an object of type "desk". Now take out the "Root." part since it's before every top-level object to make it shorter.

Inheritance
Inheritance is a way to get less specific about what "type" of object you are looking at. The way this works is you have two types, like "desk" and "woodendesk". All wooden desks are desks, but not all desks are wooden desks. So now we have "woodendesk ThisDesk". Remember that "desk" we said has a member called "Screws" of type "int". "woodendesk" IS a desk, so it automatically gets a member called "Screws". Therefore, "ThisDesk.Screws", even though it is a wooden desk and not just "desk", is valid.

Now more specifically to MQ2Data
There is a TYPE called "int" and a TOP LEVEL OBJECT called "Int". These are NOT the same thing, nor is any TLO the same as a type with the same name. If you have a macro variable or some text you want to use as an "int" type, you cant just do ${123.Hex}, because MQ2Data doesnt know what 123 is.. it doesn't have an object. You need to use a top-level object to convert that to an object. ${Int[123].Hex} makes an "int" object out of "123", which you can use to access any "int" members. If you don't need the members you dont need to use ${Int[]} around your number.

You can get as many members on the same line as you want, and just because something used [] doesnt mean it stops there. For example, many people might assume based on MQ2Parm that in order to compare an argument of a string using string.Arg[] to something else, you use ${String[${String[whatever].Arg[1]}].Equal[other string]}. However, Arg[n] as described in the reference gives you a string object, the same as String[text] is giving you a string object. All you want is a member of that string, that compares it to another string. ${String[whatever].Arg[1].Equal[other string]}.. that's it. When you have an object that you need a member of, just tack on a . and type in the member name. Continue until you get the result you're looking for. Similarly, some folks are doing things like ${Int[${Math.Calc[whatever]}]}. Math.Calc gives you a float object, of which "Int" is a member that gets you the whole number portion. Therefore, ${Math.Calc[whatever].Int} is better.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0