Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Jyujinkai on January 04, 2009, 07:34:26 AM

Title: When Loading Entities thorough scripting how to you determin order?
Post by: Jyujinkai on January 04, 2009, 07:34:26 AM
If i am loading entities with a script somthign like this....

Code: WME Script
  1. LoadB = Game.LoadEntity("entity\B\B.entity");
  2. LoadB.X = 500;
  3. LoadB.Y = 400;

How do you determin the order they are drawn on screen. The script loaded entites seam to load behind the 3D actor.

I assume it has somthing to do with Layer.InsertEntity ... but i am not sure how to use it?
Title: Re: When Loading Entities thorough scripting how to you determin order?
Post by: Mnemonic on January 04, 2009, 09:33:08 AM
Actors and free entities (i.e. those which are not part of the static scene layout defined in SceneEdit) are sorted by their Y position.
Title: Re: When Loading Entities thorough scripting how to you determin order?
Post by: Jyujinkai on January 04, 2009, 10:14:41 AM
Actors and free entities (i.e. those which are not part of the static scene layout defined in SceneEdit) are sorted by their Y position.

So can you manualy sort them ... with layers or wat not?
Title: Re: When Loading Entities thorough scripting how to you determin order?
Post by: Mnemonic on January 04, 2009, 10:25:25 AM
Depends on what you want to do. Entities are supposed to be part of the scene, so they automatically sort so that they fit naturally into the scene.
As I suggested in the other thread, if you want to display some controls on top of everything, perhaps you should use a window and real user interface, not entities.
Title: Re: When Loading Entities thorough scripting how to you determin order?
Post by: Jyujinkai on January 04, 2009, 05:40:35 PM
Depends on what you want to do.

Um... I just want to be able to click on somthing and have the game load a sprite so they apear on top of the actor.

Example

[/list]
Title: Re: When Loading Entities thorough scripting how to you determin order?
Post by: Jyujinkai on January 05, 2009, 09:46:52 AM
So your sayign i should set everythign up in scene edit with layers and all that and use the turn on and off functions to make them visable .... and have them all off at start.. instead of having them load with a dynamic entity thing.
Title: Re: When Loading Entities thorough scripting how to you determin order?
Post by: Mnemonic on January 05, 2009, 12:10:48 PM
I don't know, it depends on situation. If you don't need to create them on the fly and you don't want them to move together with the actor, than this is definitely easier.
But it's also possible with free entities. The key here is to move the hot-spot of the sprite used for your entities. By placing the hotspot below the actual image, the entity will appear to be floating above surface. It really would help to know what effect you're trying to achieve.