Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Can you walk over a region entity?  (Read 2918 times)

0 Members and 1 Guest are viewing this topic.

BishopGrutty

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
    • View Profile
Can you walk over a region entity?
« on: March 07, 2009, 07:30:00 AM »

Sorry if this is a noob question - Can you walk over a region entity?

I have a hill top covered in flowers. The actor needs to be able to walk into the field and pick a flower.

Thanks
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Can you walk over a region entity?
« Reply #1 on: March 07, 2009, 12:15:36 PM »

Region entities don't affect path finding at all. They just define active spots on the screen.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

BishopGrutty

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
    • View Profile
Re: Can you walk over a region entity?
« Reply #2 on: March 07, 2009, 10:51:09 PM »

Thanks for the reply - I must be doing something wrong, I'll have another look.
Logged

BishopGrutty

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 3
    • View Profile
Re: Can you walk over a region entity?
« Reply #3 on: March 08, 2009, 07:43:05 AM »

I found the problem - In case it's of use to anyone:

The region entity was interactive, which meant my "field full of flowers" was correctly seen as an object. In the default game.script this meant that a left click triggered a "LeftClick" event, rather than passing the click onto the scene.script (the scene.script being where the walk to code is).

Line 48 - 76 of the default game script:

 if(ActObj!=null) // i.e. interactive checked in the case of a region entity
  {
      // Lots of checks against what object can do, but no code causing movement
  }
  else   // else propagate the LeftClick event to a scene, which causes move.
  {
    Scene.ApplyEvent("LeftClick");
  }


I modified the script so that the conditions within the first half of the if statement pass the click on to the scene if no other interactive conditions are met. This meant that the actor could walk into the area.

Lines 68 - 69

    // just a simple click
    else ActObj.ApplyEvent("LeftClick");

Become

    // Check if a LeftClick handler is available.
    else if(ActObj.CanHandleEvent("LeftClick")) {
      ActObj.ApplyEvent("LeftClick");
       }
   // Else hand to scene, allowing actor to walk into area
   else {
      Scene.ApplyEvent("LeftClick");
   }



Sorry if this is basic stuff, but just in case it's helpful.

Have been using Wintermute for a couple of weeks now, but only now starting to really play with the scripting. It's a great system.
« Last Edit: March 08, 2009, 07:45:38 AM by BishopGrutty »
Logged
 

Page created in 0.048 seconds with 24 queries.