Forum rules - please read before posting.

Remember Hotspots and Sprite visibility when leaving and re-entering a scene.

edited October 2014 in Technical Q&A
I'm making a 2D traditional point and click adventure game, and I've been pouring over the Adventure Creator Manual and the forum, but I haven't found anything so general as the questions I have:

The player is in Scene 1.  When the player "pick ups" an item, for example a rope, I create the proper action for the rope to enter his inventory (Inventory: add or remove).  Then I make the rope sprite in "set geometry" invisible (Object:visibility) and the hotspot I disable (Object: send message - turn off).  This works great while the player is still in the same scene 1.  But then he leaves scene 1, goes to scene 2 and then comes back to scene 1 and the rope sprite has become visible again and the hotspot has become enabled again.  So...

QUESTION: How exactly do I tell the system to remember that the rope sprite is invisible and that the hotspot is disabled for the rest of the game?

Also, I have the player speaking with an NPC, he gives the man a comic book, and then that changes the NPC's animation to him reading the comic book.  When I leave the scene and come back, the "reading the comic" animation is no longer playing, and the NPC has reverted to its original idle.anim. 

QUESTION:  How do I tell the system to remember which .anim file an NPC should be playing, no matter the scene the player is in? 

I'm sure the answers are inter-connected and either lie in the "remember scripts" or possibly in "variable" in the Game Editor.  But I cannot, with my limited experience, figure it out.  If I could get a step by step, that would be awesome!  Thanks.  

- Jeremy

Comments

  • No problem - if you need more info, check out section 8.2 of the manual. but I'll answer your questions specifically here:
    How exactly do I tell the system to remember that the rope sprite is invisible and that the hotspot is disabled for the rest of the game?
    Adventure Creator only saves what you specifically ask it to.  This goes for both save game files and room transitions.  To mark up an object for saving, simply attach the appropriate Remember script to it.  In this case, you want to attach the RememberVisibility script.
    How do I tell the system to remember which .anim file an
    NPC should be playing, no matter the scene the player is in?
    Restoring animations are a little more complicated.  Their states can't be stored in save files, because there's just too much information involved.  The way to do it is to use Variables to determine what animation is played in your Cutscene on start.

    In your case, you'd create a Local Variable boolean called "NPC is reading", which is initially set to False, but set to True when given the comic (using the Variable: Set Action).  Then use the Scene Manager to declare a new "Cutscene on start", which uses the Variable: Check Action to query the bool's state.  Then play a different Character: Animate Action accordingly.  The ActionList Editor window is especially helpful when creating branching ActionLists such as this.
  • Wow Chris!  Thank you so much for replying to my noobie question.  Very very thorough.  

    I had made the mistake of attaching the Remember Scripts to the Interaction and not the Hotspot.  There was my mistake.  

    As far as the NPC animations are concerned, I would have never figured it out.  The variable thing just didn't make sense.  Thanks!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.