Members of App. and others

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
myraneal
Posts: 26
Joined: Tue Apr 08, 2008 8:00 pm

Members of App. and others

Post by myraneal »

Hello everyone,
I have a question but I have this feeling that the answer is on the site somewhere and I just can't find it.
I wanted to know what objects there are under App. (such as App.Time) that are usable in Expressions so that I can make cleaner projects, knowing what could be used.
Also, is there a way to get the position/rotation/scale information of an object that the playermodel collides with, in an expression under onCollide under the playermodel? I hope I'm making at least *some* sense here. Basically I want to access the information of the object that I collided with.

Thanks,
Yılmaz
User avatar
Kjell
Posts: 1881
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Yilmaz,

Due to restrictions in the scripting language you cannot currently access properties of clones by a index / string / pointer directly. My suggestion would be to set up a number of Variables or Models to which you pass variables from the objects themselves ( split them up in collision groups ).

+ App Reference

Good luck,
K
myraneal
Posts: 26
Joined: Tue Apr 08, 2008 8:00 pm

Post by myraneal »

Thanks Kjell. I guess my follow-up question would be how the game logic goes through each of the onUpdate,onCollision etc. states and in which order. The reason I'm asking this is I don't know at which point the engine decides to compute the next position of the object by looking at the current velocity. This prevents me from knowing when during the game loop to store the previous and the current position of an object, and whether this reflects the frame that has been drawn or the one about to be drawn.

Even though time to time ZGameEditor is confusing to me, I do find that it is extremely easy to make simple games with instead of using the C4 engine for example. Thanks for this great application VilleK.

-Yilmaz
User avatar
Kjell
Posts: 1881
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Yilmaz,

That's a good question actually, and as far as I know currently not documented. The general order is OnLoaded / OnStart / OnSpawn ( once ) > OnUpdate > OnCollision > OnRender. But there are some other aspects that are useful paying attention to.

- Velocity offsets of models occur when OnUpdate has been completed.
- Execution order of models is dependant on collision group ( ascending ).
- Execution order of models within the same collision group is dependant on Spawn order.
- Render related properties such as CameraPosition / ClearColor etc. have to be updated before OnRender to be taken in consideration in the current pass.

Regards,
Kjell
Post Reply