Complex user-defined types

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 771
Joined: Wed May 05, 2010 12:16 pm

Complex user-defined types

Post by Rado1 » Thu Jul 29, 2010 9:18 pm

Would be nice to have the type representing models and model instances (clones of models). For instance, to have a variable keeping a reference to model instance or an array of model instance references. Of course, it should be possible to access values of model instances from expression language (ZExpression).

One possibility is to define just one common type representing any model instance independently on model. Another possibility is to have a different type for each model defined.

Is there any way to find instantiated models and access their properties in the current ZGE?

Another improvement would be to support also structures. E.g. in the form of new component "DefineStructure" having "DefineField" (or existing DefineVariable component) as tree elements (sub-components). Variables in the expression language as well as DefineVariable components should use structural types. Accessing of structure fields from expressions: <variable>.<field>.<field>...

User avatar
Kjell
Posts: 1721
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Thu Jul 29, 2010 9:41 pm

Yea,

Both ( especially the first ) are features that would be warmly welcomed.

The most convenient way to access clones right now is by writing all properties you need to a 2D Array. Give each clone a unique identifier OnSpawn and use that as index.

K

User avatar
Rado1
Posts: 771
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Fri Jul 30, 2010 9:16 am

Kjell wrote:The most convenient way to access clones right now is by writing all properties you need to a 2D Array. Give each clone a unique identifier OnSpawn and use that as index.
That's exactly the "technique" I'm using now, however it makes the code cumbersome and static size of arrays is also quite a limiting factor.

User avatar
Kjell
Posts: 1721
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Fri Jul 30, 2010 11:00 am

:)

It's not ideal, but you can ease the pain by writing some functions to read / write / sort / etc the array. The static size isn't all that bad ( just set them to the maximum size you want to support ), it's pretty rare you need separate arrays to be large in different parts of a game ( re-using memory ). If worse comes to worst you can always use a single general purpose array to write all of your data to ( ASM style ) :wink:

K

User avatar
VilleK
Site Admin
Posts: 2052
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Fri Jul 30, 2010 11:16 am

I've said it before but I'm amazed with the clever techniques you guys come up with to circumvent the shortcomings in ZGE :)
I wish I could wave a magic wand to improve the type system instantaneously but it will take a lot of work. However nothing is impossible, a few years ago I would not have thought I'd ever add string support (or even "int"-support) so hopefully these kind of features will appear too.

Post Reply