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: 2 actors in a scene  (Read 4490 times)

0 Members and 1 Guest are viewing this topic.

vatre

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 9
  • vatre the unavoidable
    • View Profile
2 actors in a scene
« on: November 16, 2004, 07:27:15 AM »

Hey, beautiful people!

OK, I ran into a problem again. Maybe it was the late hour of the nite, or my stupidity, but nevertheless here it is:
On a scene I've set two actors. One of them is my regular, player controlled actor, the other one is Molly - the woman from the demo. :)
Anywayz, I took things for granted and didn't really do anything with her until know, when I wanted to test interactivity between my two actors.
On scene_init I load her (Molly) up, I make her interactive, movable, visible and I attach a script to her (a customized scene_object WME template). Also, on some random event I want to make her walk to a certain entity. Now these are my problems:

- When I try to walk to her, talk to her, take her or look at her, everything in the attached script works except the walking part. It gives me runtime error. In the script I have the default actor.GoToObject(this), but the log says that method needs an entity parameter. How do I reference Molly in this case? I thought "this" works for everything.

- When I try to make HER walk to the entity - she doesn't. I use the typical Zenska.GoToObject(Scene.GetNode("sign")); <- where Zenska is a global variable defined in base.inc with Molly loaded in. Now, she does do the WalkToDirection part (she turns in the place where she is), but she doesn't do the WalkToX and WalkToY part of the GoToObject instruction. The "sign", of course, has all that WalkTo properties set.

That's it, now you... ;)
Logged
• VatrE •

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: 2 actors in a scene
« Reply #1 on: November 16, 2004, 05:52:49 PM »

- When I try to walk to her, talk to her, take her or look at her, everything in the attached script works except the walking part. It gives me runtime error. In the script I have the default actor.GoToObject(this), but the log says that method needs an entity parameter. How do I reference Molly in this case? I thought "this" works for everything.
The runtime error is right, this method only works for entities, simply because they are static so it's easy to set a target point for them. Actors move so even of you'd set the point relative to actor's current position, that point could be easily invalidated when e.g. the actor is stading beside a blocked region. In other words, if you want one actor to walk to another actor you'll have to script that explicitly.


- When I try to make HER walk to the entity - she doesn't. I use the typical Zenska.GoToObject(Scene.GetNode("sign")); <- where Zenska is a global variable defined in base.inc with Molly loaded in. Now, she does do the WalkToDirection part (she turns in the place where she is), but she doesn't do the WalkToX and WalkToY part of the GoToObject instruction. The "sign", of course, has all that WalkTo properties set.
I tried that and it seems to work ok for me. If the walking part fails, perhaps the actor is unable to walk to that point for some reason? (missing waypoints etc.).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

vatre

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 9
  • vatre the unavoidable
    • View Profile
Re: 2 actors in a scene
« Reply #2 on: November 16, 2004, 06:54:22 PM »

The runtime error is right, this method only works for entities, simply because they are static so it's easy to set a target point for them. Actors move so even of you'd set the point relative to actor's current position, that point could be easily invalidated when e.g. the actor is stading beside a blocked region. In other words, if you want one actor to walk to another actor you'll have to script that explicitly.

Yeah, that makes sense.  Hm-hm... I can see a bunch of problems coming my way now. Oh, well...  ::)

I tried that and it seems to work ok for me. If the walking part fails, perhaps the actor is unable to walk to that point for some reason? (missing waypoints etc.).

You are right, I messed it up. It works now...
Thank you again!
Logged
• VatrE •
 

Page created in 0.043 seconds with 19 queries.