ZGameEditor forum Forum Index ZGameEditor forum
The tool for creating 64kb games. ZGE Wiki homepage.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Complex user-defined types

 
Post new topic   Reply to topic    ZGameEditor forum Forum Index -> Feature requests
View previous topic :: View next topic  
Author Message
Rado1



Joined: 05 May 2010
Posts: 20

PostPosted: Thu Jul 29, 2010 9:18 pm    Post subject: Complex user-defined types Reply with quote

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>...
Back to top
View user's profile Send private message
Kjell



Joined: 23 Feb 2008
Posts: 854

PostPosted: Thu Jul 29, 2010 9:41 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Rado1



Joined: 05 May 2010
Posts: 20

PostPosted: Fri Jul 30, 2010 9:16 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Kjell



Joined: 23 Feb 2008
Posts: 854

PostPosted: Fri Jul 30, 2010 11:00 am    Post subject: Reply with quote

Smile

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
Back to top
View user's profile Send private message
VilleK
Site Admin


Joined: 15 Jan 2007
Posts: 962
Location: Stockholm, Sweden

PostPosted: Fri Jul 30, 2010 11:16 am    Post subject: Reply with quote

I've said it before but I'm amazed with the clever techniques you guys come up with to circumvent the shortcomings in ZGE Smile
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.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    ZGameEditor forum Forum Index -> Feature requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group