edited November 2013 in ORK Support
Hi,

I am trying to set up a menu screen that shows when starting a new game where the player can choose between having a male character or a female character. I have created both male/female prefabs in unity.

I can't seem to wrap my brain around how to do this with ORK. I need a nudge in the right direction.

Thanks!
  • Hi there Hankphone!

    So, character selection. There are several ways to do this; I will use the variable example to demonstrate this. I apologize in advance for the length of this post/tutorial.

    -=-=-=-=-=-=-

    Creating the Character Gender Selection Event:
    1). First, make sure you have a seperate combatant defined for each possible player model. Go to 'Combatants > Combatants', and add a male and female character. Assign your prefabs.

    2). Create a new event, add a 'Show Dialogue' step. Set the dialogue type to 'Choice'. Now change the message to something like 'Select a Character'. Click the 'Add Choice' button twice, and name one 'Male' and the other 'Female'.

    3). Now add a 'Change Variable' step (Variables > Change Game Variables), and click the button to add a new variable. Leave the settings default, and enter in 'playerType' as the variable key value, and 'male' for the string value. Now connect the 'male' option of your dialogue to this change game variables step.

    4). Duplicate the 'Change Game Variables' step, and change the key from male to 'female'. Now connect this one to the 'female' option of your dialogue.

    5). Finally, add a 'Load Scene' step (Scene Steps > Load Scene). Enter the name of your first level in the Target Scene field. Connect BOTH the male and female 'change game variables' steps to the load scene step. Save the event.

    -=-=-=-=-=-=-

    Now I assume you have at least three scenes. For this to work, you need the main menu, which points to your character creation/selection scene. Then from the character scene, you go to level 1. Go to your character selection scene, and add your new event with a start type of 'autostart'. Leave all other settings default.

    -=-=-=-=-=-=-

    Creating the Spawn Player Event:
    1). Create another new game event, and add a 'Check Game Variables' step. (Variable Steps > Check Game Variables). Click the button to add a new variable, and enter in our values from earlier. The variable key value should be 'playerType', and the string value should be 'male'. Also, check the box 'Is Valid'. Now, duplicate this step, and change 'male ' to 'female', so we have one for each gender.

    2). Connect the default 'Event Settings' to one of the steps - it doesn't matter which one. Now connect the 'Failed' option of the step connected to your 'Event Settings' to the remaining 'Check Game Variables' step.

    3). Add a 'Join Active Group' step (Active Group Steps > Join Active Group). Set the combatant to your male character. Now, find the 'Check Game Variables' step which belongs to the male character, and connect the 'Success' box to the 'Join Active Group' step.

    4). Duplicate the 'Join Active Group' step, and change the combatant from male to female, and like before, connect the proper 'Check Game Variables' success step to this step.

    5). Lastly, add a 'Spawn Player' step (Spawn Steps > Spawn Player). Connect BOTH the 'Join Active Group' steps to this step, and save the event as Player Spawn, or whatever you wish.

    6). Close the ORK II Editor after saving, and navigate to your first game level. Add in your spawn player event, with the start type set to autostart. Now, run your game from the main menu, and you should be good to go!

    I hope that I have been useful in some way. Good luck!

    -Jikiyal
  • Wow, Jikiyal, great work - just a small addition:
    You don't need to use game variables, you can simply join the correct combatant right after the selection and spawn it in the other event :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks guys, I was trying to do a combination of some of these steps but I didn't have it quite right. I'll try it out this evening and see if I can't figure out where I went wrong. Thanks!
Sign In or Register to comment.