Forum rules - please read before posting.

Check/Switch Current Player?

edited March 2018 in Technical Q&A
Hey again,
I'm so sorry that I keep posting here but either I'm too enthusiastic or too stupid to figure things out.

Is there a method to check and switch the current player in script? Player switching is on and there are 2 of them.
It feels like it should be blatantly obvious but I can't for the life of me find where it is in the scripting guide...

Thanks again :)

Comments

  • When looking for code that does the same thing as Actions already do, you can usually luck out by opening the Action files - in this case, ActionPlayerCheck and ActionPlayerSwitch.

    Each Player has an ID number, which relates to their listing in the Settings Manager.  The current player's ID can be read with:

    AC.KickStarter.player.ID

    To change player, call:

    AC.KickStarter.ResetPlayer

    However, the saving of the previous player's data is not automatic, and must be done separately with:

    KickStarter.saveSystem.SaveCurrentPlayerData ();

    Loading the correct scene after switching to a previously-used player must be done separately as well.  It's probably best to just rely on the Player: Switch Action instead, and call an ActionList containing it via script.
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.