Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: When Loading Entities thorough scripting how to you determin order?  (Read 3191 times)

0 Members and 1 Guest are viewing this topic.

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 351
    • View Profile
    • Jyujinkai's WME Development Blog

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?
« Last Edit: January 04, 2009, 09:14:00 AM by Jyujinkai »
Logged
<Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
<Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: When Loading Entities thorough scripting how to you determin order?
« Reply #1 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 351
    • View Profile
    • Jyujinkai's WME Development Blog
Re: When Loading Entities thorough scripting how to you determin order?
« Reply #2 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?
Logged
<Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
<Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: When Loading Entities thorough scripting how to you determin order?
« Reply #3 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 351
    • View Profile
    • Jyujinkai's WME Development Blog
Re: When Loading Entities thorough scripting how to you determin order?
« Reply #4 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

    • I have a sceen with 3 buttons.
      • Button 1 - Loads Sprite1
      • Button 2 - Loads Sprite2
      • Button 3 - Loads Sprite3
    • Player can click these in any order they want.
    • Each Sprite Loads ONTOP of actor (so actror walks behind them)
    • Sprite 3 loads UNDER Sprite 2 and Sprite 2 UNDER Sprite 1.
      • So if they overlap 1 is onto of 2 and 2 is ontop of 3 and they are all ontop of teh actor
    [/list]
    « Last Edit: January 04, 2009, 05:49:11 PM by Jyujinkai »
    Logged
    <Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
    <Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

    Jyujinkai

    • Global Moderator
    • Frequent poster
    • *
    • Karma: 1
    • Offline Offline
    • Posts: 351
      • View Profile
      • Jyujinkai's WME Development Blog
    Re: When Loading Entities thorough scripting how to you determin order?
    « Reply #5 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.
    Logged
    <Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
    <Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

    Mnemonic

    • WME developer
    • Administrator
    • Addicted to WME forum
    • *
    • Karma: 41
    • Offline Offline
    • Gender: Male
    • Posts: 5683
      • View Profile
      • Dead:Code Site
    Re: When Loading Entities thorough scripting how to you determin order?
    « Reply #6 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.
    Logged
    Yes, I do have a twitter account
    Please don't send me technical questions in private messages, use the forum. ::wave
     

    Page created in 0.032 seconds with 24 queries.