Element Data

From Multi Theft Auto: Wiki
Revision as of 21:43, 28 April 2006 by EAi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Elements currently can store arbitrary data values. It is proposed that these values are also read from the XML map file's attributes, when the map is loaded. This would have the impact that XML event handlers would be also become element data values, but somewhat confusingly to users, editing this data would not change the actual code. It may be advisable that event handlers are loaded from this element data, rather than from the raw XML data. This would in theory allow self-writing code, for example, you could use setElementData to write some code, then call addEvent to add an event of that name. Perhaps it would be useful to make it so that element data is tied to events, so that if you change the element data for an event, the code is reloaded into the VM and overwrites the existing (hidden) function. This would probably be relatively trivial to implement.