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: Unloading an actor  (Read 2705 times)

0 Members and 1 Guest are viewing this topic.

rtr_18

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Unloading an actor
« on: November 14, 2008, 09:59:57 AM »

Hi!
    I've two scenes in my Project. I'm navigating between these two scenes. I've loaded an actor in both the scenes by calling LoadActor3D() in the scene_init.script files. I've commented out the same loading script from game.script file why because the actor appears in every scene of the game. Now my problem is:

While navigating from scene1 to scene2 everything is OK. While navigating from scene2 from scene1 the already loaded actor is there. I've to unload this actor while exiting from scene1. How to do this? Is there any function to achieve this?
« Last Edit: November 14, 2008, 10:08:41 AM by rtr_18 »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Unloading an actor
« Reply #1 on: November 14, 2008, 10:26:07 AM »

There's Game.UnloadObject(). However, loading and unloading the actor all the time doesn't sound like exactly good idea (not to mention it's slow). Can't you just hide the actor in scenes where he's supposed to be hidden?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

rtr_18

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Unloading an actor
« Reply #2 on: November 14, 2008, 11:46:34 AM »

Hi!
    Thanks for your reply. I load the two actors at a common place(i.e in the game.script file).  I've changed the visiblity by using

actor.Active= true/false; This works fine while transiting from first scene to second scene. But while transiting from second scene to first

scene, the actors is not visible. In the second scene I implemented a converstion between the two actors in the second scene at the leftclick

event of the actor(not in the scene.script file but in the actor.script file). I've made the transition at this actor.script file only. Scene has

been transfered from first to second. But the actors are not visible. How to make the actors visible while transiting from second scene to first

scene?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Unloading an actor
« Reply #3 on: November 14, 2008, 01:14:16 PM »

Now you lost me a little. Actors stay visible on scene transitions, unless you explicitly hide them.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

rtr_18

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Unloading an actor
« Reply #4 on: November 17, 2008, 03:47:40 AM »

Hi Mnemonic!
                 As I told in my previous reply, I loaded the two actors in the game.script file. While loading itself(in the game.script file), I've hidden the two actors. I made only the first actor visible, in the scene_init.script file for the first scene. I've hidden the second actor since I don't want it to visible initially. In the script file for the second actor, after some conversations between the first and second actor, I've changed the scene from the second to the first scene. After that I made the second actor visible(actor2.Active = true), since after the transition fro m second scene to the first scene I want to make both the actors visible. But only the first actor is visible after the transition from second to the first scene. Where as the second actor is not. How to make both the actors visible after the transition?
Logged
 

Page created in 0.031 seconds with 20 queries.