Forum rules - please read before posting.

Several Players (Switch)

Hey guys,

My game idea is to have 3 playable characters that will interact with the world in different ways. Topic of my game is problem-solving/puzzles, and to ensure smoothness I want the characters to be able to move simultaneously.

Example: Select Guy1 -> try to interact with X -> while Guy1 walks to X, switch to Guy2 and walk up to some other hotspot, preparing that interaction.

According to what I've read in manual and other threads, only one player-prefab can be active at a time. If I understand correctly, at the time of switch to Guy2 I have to change Guy1 with an NPC. What happens with the interaction I've ordered Guy1 to do? Can he (Guy1-NPC) continue walking up to hotspot X and complete the interaction?

I guess the answer to the above applies to my next question: what if one problem is solved by Guy1 and Guy2 working in tandem, i.e: Guy1 levitates an object, Guy2 has 3 seconds to pick up something under the object.

Cheers

Comments

  • A way this problem has been solved in the past is that each of the Guys has the other Guys as inventory items (can place them in a separate window using inventory categories) and you "use" Guy 1 on Hotspot X (which runs an action that runs in the background so it doesn't block you continuing to do stuff) and then your current player Guy2 interacts with NPC while Guy1 goes about his work at Hotspot X.
  • Welcome to the community, @kuronity.

    You are correct that any character not being controlled must be swapped out with an NPC.

    Your second question is actually the easier of the two, so I'll answer that first.

    To add a timed element to anything, use a Cutscene with a When running field set to Run In Background.  This will allow gameplay to continue while it runs, and any Engine: Wait Action within will simply delay its own Actions, rather than pause the game.

    Begin this Cutscene with whatever animation you need to make the object to levitate and a Hotspot: Enable or disable Action to make it interactive.  Have it wait 3 seconds, and then run similar Actions again to stop the object levitating and make it non-interactive.

    If you need other systems to check if the object is levitating, use the ActionList: Check running Action on this Cutscene.  You can also use a boolean Variable to determine if the Guy1 is in the correct position - and set it either with a custom script or the Variable: Set Action.

    As for having Guy1 continue walking to a Hotspot after being made an NPC, that isn't possible out-of-the-box.  You could do it with some custom scripting, however - just before you call Player: Switch, you could run a custom Action that checks if he is moving to the Hotspot, and then moves the new NPC there if so.

    You can read the Hotspot being currently walked to with:

    AC.KickStarter.playerInteraction.GetHotspotMovingTo ();

    I don't know how familiar you are with coding, and it may take a bit of experimentation to get the best workflow, but you should be able to achieve something that can be applied to other situations.

    Once you've got it working for a test scenario (i.e. one particular Hotspot / situation) you can see about introducing parameters to your AcitonLists to make them apply elsewhere.  A tutorial on parameters can be found here, and they can also be made for custom Actions.
  • @ChrisIceBox I'm a beginner at C#, but it shouldn't be that big of a problem to learn. I'll give custom scripting a try as you suggest. 

    @hightreason That sounds like an interesting solution. I'll think about it.

    Thanks for the fast answers, guys!
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.