Making NPC the main character.

Started by dbuske, Sat 30/04/2011 22:41:52

Previous topic - Next topic

dbuske

I am making a game where the main character is like in Amadeus where the main character is telling the story and
then flashbacks occur.  This goes back and forth throughout the game.
I start with the main character in room 1, then switch to room 2 and make the main character transparent.
How do I get the NPC to be able to be controlled  ie. the main character.
Then switch back again.

I found this but the npc still cannot be made to walk:
   cDumbledore.SetAsPlayer(); 

What if your blessings come through raindrops
What if your healing comes through tears...

monkey0506

Well, is there a walkable area in the room? Is cDumbledore on the walkable area?

dbuske

#2
Quote from: monkey_05_06 on Sun 01/05/2011 00:33:44
Well, is there a walkable area in the room? Is cDumbledore on the walkable area?

I am pretty sure he is, but I will check.  Thanks.
Yes there is a walkable area and he is standing squarely on it.

I have made the first player just transparent.  Can there be 2 main characters in the same room?
What if your blessings come through raindrops
What if your healing comes through tears...

monkey0506

You can't have more than one "main"/player character at one time anyway. So as soon as you call cDumbledore.SetAsPlayer the previous player is no longer the player character.

So where are you calling the SetAsPlayer function at? Also, your on_mouse_click function might be relevant.

dbuske

Quote from: monkey_05_06 on Sun 01/05/2011 02:33:08
You can't have more than one "main"/player character at one time anyway. So as soon as you call cDumbledore.SetAsPlayer the previous player is no longer the player character.

So where are you calling the SetAsPlayer function at? Also, your on_mouse_click function might be relevant.

Yep, turning on mouse click false worked.  the character walks.
What is the most efficient way to accomplish the change back and forth from the main Narrating character room to the other main character in flashback.
Thank you
What if your blessings come through raindrops
What if your healing comes through tears...

Snarky

If the flashback takes place in a different room, you simply call .SetAsPlayer() and the game transitions to the room that character is in.

If the flashback takes place in the same room, the main challenge is probably to make sure the state is set to "the way things were," with the right characters and objects being in the room in the right positions, and to recover the present state once the flashback is over. Depending on the extent to which present/flashback things overlap, it might actually be easier to just make a copy of the room for the flashback (that way you can also make it black & white or some other effect to show that it's a flashback). Otherwise, write a function that backs up the state of everything in the present, sets the state to whatever you want it to be in the flashback, and then restores the state once the flashback is over.

The most efficient solution depends a lot on what your game is like. How interactive are the flashbacks? Are you going to be switching rooms within the flashback? Do you want the room to look and/or behave different in the past, or is it identical?

SMF spam blocked by CleanTalk