Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: entering area, then new layer  (Read 3274 times)

0 Members and 1 Guest are viewing this topic.

Adventure-Macher

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Posts: 8
    • View Profile
entering area, then new layer
« on: January 18, 2011, 08:41:56 PM »

Hi,

I have an area, with a region. So there is a closed wall, with a door. I will make it, that the character go automaticaly through the door, and in this situation, the wall will flip out and the player can see somethink of inside this entered room. So I have another layer, putting on closed-walllayer. The main-background shows the complete open room.

Can I handle this with a script? When entering the area from the door to the inside of the room, then the script will run. And when going out of the room, the script will stop.

Will this be done by:

EntityName
    The name of the new entity

??
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: entering area, then new layer
« Reply #1 on: January 18, 2011, 09:14:23 PM »

Regions provide two events, ActorEntry and ActorLeave. So you are able to detect actor entering an area in the scene and call some script code.
Attach the following script to the region:

Code: WME Script
  1. on "ActorEntry"
  2. {
  3.   Game.Msg("actor entered the area");
  4.   // do something
  5. }
  6.  
  7. on "ActorLeave"
  8. {
  9.   Game.Msg("actor left the area");
  10.   // do something else
  11. }
  12.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Adventure-Macher

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Posts: 8
    • View Profile
Re: entering area, then new layer
« Reply #2 on: January 18, 2011, 09:32:43 PM »

Hi,

thanks. So I can put a new layer when "ActorEntry"? And what should I do, then "ActorLeave"?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: entering area, then new layer
« Reply #3 on: January 18, 2011, 09:43:31 PM »

I think it would be easier to prepare the layer in SceneEdit and only show/hide it in the script. However, nothing is stopping you from dynamically creating the layer (Scene.AddLayer()) and destroying it (Scene.DeleteLayer()).
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.022 seconds with 22 queries.