Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Problem with "actorEntry"  (Read 3930 times)

0 Members and 1 Guest are viewing this topic.

Hiro

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
Problem with "actorEntry"
« on: June 09, 2011, 02:51:53 AM »

hello my name is Jeison Morales
and I'm from Venezuela
I need your help
I have a scene with 3D characters
but when the enemy actor
enters a region
change the scene
I want the scene change
only when the player enters the region
and not the enemy
as I solve the problem?

Logged

piere

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 301
  • Sorry for any bad english in my posts. Game on !
    • View Profile
Re: Problem with "actorEntry"
« Reply #1 on: June 09, 2011, 03:54:03 AM »

Did you try to use a code that changes the scene? Maybe if you did a IF (enemy enters scene) Change Scene; type of code?
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Problem with "actorEntry"
« Reply #2 on: June 09, 2011, 06:41:19 AM »


Code: WME Script
  1. var ActorRegion;
  2. on "ActorEntry"
  3. {
  4. ActorRegion = Scene.GetRegionAt(actor.X, actor.Y);
  5. if (ActorRegion.Name == this.Name)
  6.     {
  7.     Game.ChangeScene(.....);
  8.     }
  9. }
Logged

Hiro

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Problem with "actorEntry"
« Reply #3 on: June 09, 2011, 04:08:58 PM »


Code: WME Script
  1. var ActorRegion;
  2. on "ActorEntry"
  3. {
  4. ActorRegion = Scene.GetRegionAt(actor.X, actor.Y);
  5. if (ActorRegion.Name == this.Name)
  6.     {
  7.     Game.ChangeScene(.....);
  8.     }
  9. }

does not work
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Problem with "actorEntry"
« Reply #4 on: June 09, 2011, 04:32:05 PM »

I use the same code on some scenes, it should work. Obviously it depend also on you scenes.
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Problem with "actorEntry"
« Reply #5 on: June 09, 2011, 04:38:59 PM »

Actually you ofcourse have to use the right actor . That means in yourcase it's not actor.X and actor.Y , but enemy.X and enemy.Y

The line

Code: [Select]
ActorRegion = Scene.GetRegionAt(enemy.X, enemy.Y);

will give you the region name at the given coordinates. And don't forge, the "ActorEntry" Event happens in the Regions Script, not in the Actors Script.
Logged
 

Page created in 0.022 seconds with 21 queries.