Extensions Value Traits

Value Traits correspond to the Alterable ValuesAlterable Strings, and Flags action and expression menus.  The MMFI is able to determine at runtime without additional help whether an object supports these traits, and will expose the corresponding fields and methods if it does.

Flags, strings, and values are all tables that can be directly indexed to get or set a value.  Strings and values can also be indexed by their names, if you have defined names for them in the object's properties panel.

Value Fields

These fields can be read from or written to directly

boolean[] flags Array of object's internal flags (1 - 32)
string[] strings

Array of object's alterable strings (1 - 10)

number[] values Array of object's alterable values (1 - 26)

Example

-- Assume we have a table of objects indexed by ID
object = mmf.objects[1]
 
-- Read some values
local flag = object.flags[1]
local str = object.strings[2]
local val = object.values[mmf.ALT_C]
 
-- Some of our values also have names
str = object.strings['description']
val = object.values['health']
 
-- Update some values
object.flags[2] = true
object.strings[2] = "Some string"
object.values['health'] = 100


See also:
     Object API, Display Traits, Common Traits, Movement Traits, Animation Traits

Copyright 2010 Justin Aquadro