Zippy-Egoboo Home EgoWiki > Documentation > WhatIsAData ( vs. r1.1) EgoWiki webs:
Main | TWiki | Know | Sandbox
Documentation . { Changes | Index | Search | Go }
 <<O>>  Difference Topic WhatIsAData (r1.1 - 04 May 2004 - ElminI)
Added:
>
>

%META:TOPICINFO{author="ElminI" date="1083707948" format="1.0" version="1.1"}% %META:TOPICPARENT{name="WebHome"}% This was originally a wrapper for void pointers for inclusion in container types (lists and hashes, basically), and now it provides a decent way to type-agnostically pull data out of scripts (esp. for the Lua list interface). To really be useful, an AData type has to have the following:

  • An entry like D_TYPENAME in the enum in luascript/data.h
  • AData converters (define with DECLARE_ADATA_CONVERTERS macro, implement in luascript/data.c with the macro there (can't remember the name, sorry))
  • Lua stack operations (define with DECLARE_LUA_STACKOPS) (implementation will be supported by a macro as well, but for now just implement the functions in the module's implementation file).
  • A conversion function like ModName_ConvertType() -- follow the pattern in stuff like AI_ConvertRange from charscript.c
  • Support in luadata.c in each of the generalized stack operations (Lua_IsData, Lua_ToData, Lua_PushData). There are macros in there to help.

Not all types in the engine can go back and forth to Lua, and for Particles this is intentional. For other things, it's probably just laziness. I'd like to get as many types as possible equipped with the above items, but please check with me before adding them to a particular type.

-- ElminI - 04 May 2004


Topic WhatIsAData . { View | Diffs | r1.1 | More }
Revision -
Revision r1.1 - 04 May 2004 - 21:59 GMT - ElminI
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding EgoWiki? Send feedback.