Please login or register.

Login with username, password and session length
Advanced search  

News:

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

Pages: [1] 2  All

Author Topic: Actor standing behind entity :(  (Read 8395 times)

0 Members and 1 Guest are viewing this topic.

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Actor standing behind entity :(
« on: September 17, 2009, 06:45:38 PM »

Hi there
In WME i am just noobie and of course i got 1 newbie question, so the problem is:
I got a scene,actor,entity and scene background. Everything is fine until i add entity with script:

Code: [Select]
global sth = Scene.LoadEntity("entities\sth\sth.entity");
   sth.SkipTo(483, 287);

i want this entity to be like background - actor is in front and background is behind him, but in my case entity is overlaying actor :( another words, i want to put entity behind the actor.

So do u have any idea how can I fix this ? or how can i sort entities which are added with this script ?

THX and sorry for my english  :)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Actor standing behind entity :(
« Reply #1 on: September 18, 2009, 09:05:42 AM »

I would recommend reading (or re-reading) the scene creation tutorial in the documentation. It goes to great lengths to describe the scene layering principles in WME.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Actor standing behind entity :(
« Reply #2 on: September 18, 2009, 01:20:03 PM »

I would recommend reading (or re-reading) the scene creation tutorial in the documentation. It goes to great lengths to describe the scene layering principles in WME.

Yes i already read this (i hope we are talking about same tutorial:  Scene creation step by step (tutorial) in WME online documentation), but i am not adding entity in Scene editor and i dont have this entity in Scene editor displayed, because i am adding entity "ingame".When actor will talk about something with NPC i want this entity to load (i am using if) ... and it loads..but over the actor...I just have this entity wich i am adding in WME Project Manager under entity folder....
Logged

dream

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 32
    • View Profile
Re: Actor standing behind entity :(
« Reply #3 on: September 18, 2009, 03:23:54 PM »

If you are calling your entity to the scene from the script you have to wrote code like this:

Code: [Select]
var MyEnt = Scene.LoadEntity("entities\MyEnt\MyEnt.entity");
MyEnt.SkipTo(400,400);

actor.SkipTo(400, 400);
actor.Direction = DI_DOWN;
actor.Active = true;

Now entity MyEnt is like a background. So it means that the actor is behind this entity. It is the same principle as you do in in SceneEdit.

Do you understand?:)
Logged

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Actor standing behind entity :(
« Reply #4 on: September 18, 2009, 03:31:04 PM »

If you are calling your entity to the scene from the script you have to wrote code like this:

Code: [Select]
var MyEnt = Scene.LoadEntity("entities\MyEnt\MyEnt.entity");
MyEnt.SkipTo(400,400);

actor.SkipTo(400, 400);
actor.Direction = DI_DOWN;
actor.Active = true;

Now entity MyEnt is like a background. So it means that the actor is behind this entity. It is the same principle as you do in in SceneEdit.

Do you understand?:)

I think i get the idea... i will load entity and then i will "load" actor again so it will be in front....
Very smart ! thx  ::thumbup




« Last Edit: September 18, 2009, 03:38:59 PM by PeterSVK »
Logged

dream

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 32
    • View Profile
Re: Actor standing behind entity :(
« Reply #5 on: September 18, 2009, 03:33:03 PM »

It is very easy Peter :). As you said first load the entity and after that load your actor:) The engine will drawn actor behind your entity:).
Logged

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Actor standing behind entity :(
« Reply #6 on: September 18, 2009, 03:39:13 PM »

but actually...it is not working...my code is :
Code: [Select]
    var roh = Scene.LoadEntity("entities\roh\roh.entity");
        roh.SkipTo(483, 284);
        roh_spawned = true;

actor.SkipTo(271, 362);
        actor.Direction = DI_LEFT;
        actor.Active = true;
Logged

dream

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 32
    • View Profile
Re: Actor standing behind entity :(
« Reply #7 on: September 18, 2009, 03:41:00 PM »

but actually...it is not working...my code is :
Code: [Select]
    var roh = Scene.LoadEntity("entities\roh\roh.entity");
        roh.SkipTo(483, 284);
        roh_spawned = true;

actor.SkipTo(271, 362);
        actor.Direction = DI_LEFT;
        actor.Active = true;

The problem can be actor´s HotSpot. Coul you make a screen please?
Logged

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Actor standing behind entity :(
« Reply #8 on: September 18, 2009, 03:46:11 PM »

Dont laugh pls  ;D it is really "crazy" minigame  :P

http://img198.imageshack.us/img198/7919/errorxj.jpg

btw. entity loads after conversation with employee and that is the time of actors reaload too...
« Last Edit: September 18, 2009, 03:50:07 PM by PeterSVK »
Logged

dream

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 32
    • View Profile
Re: Actor standing behind entity :(
« Reply #9 on: September 18, 2009, 03:49:43 PM »

Dont laugh pls  ;D it is really "crazy" minigame  :P

http://img198.imageshack.us/img198/7919/errorxj.jpg

:-D Cool graphic:). Okey Peter, I think that the problem is actor´s hotspot. Try to skip actor for example to the middle of your entity. Is actor standing in front of this entity?

EDIT: See this screenshot: http://img10.imageshack.us/i/wme1.jpg/
« Last Edit: September 18, 2009, 03:54:23 PM by archetype »
Logged

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Actor standing behind entity :(
« Reply #10 on: September 18, 2009, 03:57:54 PM »

dont worry i am not going to publish this  ::) its just some kind of test...test of logicssomething like test game(like openi wardrobe,pick up thing from it and close it, taking items etc.),storyline ... ...preparetion for bigger projects(it is called The First Step - Blázinec  C:-)) if i will be making a real game, i will spend much more time on graphics then now :)

ok.. there is a little problem.Entity is spawning after the end of conversation with employee so i want to reload actor in front of employee.
I tryed skip actor to same location as roh.entity (483, 284) but it is still not working.... :(


EDIT: your screen is exactly what i done now and exactly my problem :) entity is in front of actor
« Last Edit: September 18, 2009, 04:04:11 PM by PeterSVK »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Actor standing behind entity :(
« Reply #11 on: September 18, 2009, 04:37:51 PM »

Free entities and actors are sorted by their Y position on screen.
By default their position is given by the top-left corner, but you can change the "base point" by moving the hot-spot in SpriteEdit. You typically want to move the hot-spot to the point where the object is touching the ground. Notice that Molly has hot-spot at her feet and the red chair in WME demo has the hot-spot at the chair base (you can see the spot as a small red + if you select the chair entity in SceneEdit).

You need to do the same for your actor and your entity.
« Last Edit: September 18, 2009, 04:40:12 PM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Actor standing behind entity :(
« Reply #12 on: September 18, 2009, 04:42:05 PM »

I was thinking about this one too, but actor has hot spot between his feet(like molly) and roh.entity has hot spot in middle, so if entities are sorted by Y position, logicaly actor has to be in front of that entity..not behind
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Actor standing behind entity :(
« Reply #13 on: September 18, 2009, 04:44:40 PM »

Also they must be in the same scene region. A screenshot from SceneEdit would help.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

PeterSVK

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 41
    • View Profile
Re: Actor standing behind entity :(
« Reply #14 on: September 18, 2009, 04:56:30 PM »

My entity is not in scene edit because i am calling entity with script after conversation with employee... u can see some scripts in this topic in posts before(screenshot of problem with calling script too)

EDIT:...but u may be right, roh.entity is not standing on a floor... i will try
EDIT2:Yeah, problem was that my entity was not standing on a floor ! THX every1 for help ! wooohooo ::rock

FIXED

« Last Edit: September 18, 2009, 05:08:58 PM by PeterSVK »
Logged
Pages: [1] 2  All
 

Page created in 0.085 seconds with 19 queries.