ValueType

Container for unknown ValueTypes.

Methods

ValueType.new(type_definition)

self:call(name, args...)

Calls the method name of the value's type, with the value as this. The return value depends on the method's return type.

The full function prototype can be passed as name, as with REManagedObject:call.

Changes the method makes to the value are written back into this ValueType.

Methods the type inherits from System.Object or System.Enum, such as GetType and ToString, can be called as well.

self:get_field(name)

self:set_field(name, value)

Note that this does not change anything in-game. ValueType is just a local copy.

You'll need to pass the ValueType somewhere that would make use of the changed data.

self:address()

self:get_type_definition()

self.type

self.data

std::vector<uint8_t>

Dangerous Methods

Only use these if necessary!

self:read_byte(offset)

self:read_short(offset)

self:read_dword(offset)

self:read_qword(offset)

self:read_float(offset)

self:read_double(offset)

self:write_byte(offset, value)

self:write_short(offset, value)

self:write_dword(offset, value)

self:write_qword(offset, value)

self:write_float(offset, value)

self:write_double(offset, value)

offset is in bytes from the start of the ValueType's data. The whole value must lie inside the data: a read that does not fit returns 0, and a write that does not fit is dropped.