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: keeping track of the current scene for multiple actors  (Read 2327 times)

0 Members and 1 Guest are viewing this topic.

fatkat

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
keeping track of the current scene for multiple actors
« on: February 12, 2008, 12:28:44 PM »

i was wondering whether anyone has any tips n tricks on how to handle multiple actors moving around in a game. for instance, i would like to have a bunch of actors that move around in the game world. what's the best way of keeping track of their current scene and making sure they're only shown when they're supposed to? is there any standard functionality for doing this or do i have to manually store the scene for each actor and set the active-property (or load the actor) in each scene_init-script?
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: keeping track of the current scene for multiple actors
« Reply #1 on: February 12, 2008, 01:45:37 PM »

If there are many actors like that, I'd probably use an extra attribute for the actor. Let's say my actor's are Sally, Peter and Paul.

First you preset some starting room for them:

Sally.CurrentScene = "Room";
Peter.CurrentScene = "Room";
Paul.CurrentScene = "Barn";

I'd set their active status according to this logic:

function checkStatus()
{
    if (Sally.CurrentScene == Scene.Name) Sally.Active = true;
    else
    Sally.Active = false;

    if (Peter.CurrentScene == Scene.Name) Peter.Active = true;
    else
    Peter.Active = false;

//   etc.
}

optionally you could use an array and store the room information into that array if you're speaking about more than 3 actors.

Then with every character change you simply store the current actor's Scene.Name into his CurrentScene attribute.

In the beginning of the scene init you call the checkStatus() and it should work.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

fatkat

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: keeping track of the current scene for multiple actors
« Reply #2 on: February 14, 2008, 03:19:27 PM »

thanks for the reply. that's more or less what i came up with too. i guess i was hoping for some kind of system event like "changescene" that each actor could handle and do their own activate/inactivate code. i can't really think of many other scenarios where that'd be useful though so i understand if it's not in there.
Logged
 

Page created in 0.039 seconds with 24 queries.