Character selection/Path selection menus

jump2jump2 Member Posts: 17
edited July 2015 in Tech Support

I am trying to understand the concept of how to select a character on one screen (menu/scene), select the board/scene/path (choose you adventure) and have the player selected go into the selected screen.

Currently, I have a character menu screen and a path select menu screen. We are able to select a scene and a path, but how do we get the two to meet? The purpose of the game is to create a informative simulation for young students to introduce them to careers. We are just learning how to do this and must have the first for levels completed by Friday, July 17, 2015. Please help us to figure this out. I am sure this is basic to most.

Using Mac

«1

Comments

  • tintrantintran Member Posts: 453

    I'd imagine you'd have to use game attributes,
    like add a variable called character and a variable called path, then set these to numbers based on user's selection.
    Then when you change scene to a scene where these two would meet, then add rules to decide what to do based on the character attribute and path attribute.

  • jump2jump2 Member Posts: 17

    First off, thank you for responding to this question.

    So far what we have done is created actors for each character that the player can select and dragged them into a scene entitled "Character Select". Additionally, on the character select screen is an empty player actor (8 actors in the scene -- 6 selectable characters, 1 invisible player actor waiting to become one of the selected actors, and 1 button to move to the next scene -- level/path selection). Code has been added to both the selectable characters and the empty player actor. Therefore, when the actual game player selects the character, that player shows up in the player actor empty (now showing the selected character), as the player for the game. Once the character is selected, the continue button is available to continue to the path (scene) selection screen. Likewise, the code is there to support moving to selected path(scene).

    Now the questions are, how do I get the selected player to go to the selected scene? Do I need to call the player actor into the selected scene? How will the player actor know which scene was selected?

    This is confusing to me since there are multiple players and scenes to select from. I can't wrap my head around this.

    Did this give clearer information, or am I just restating info in a different way with out providing additional information to move us to a possible resolution to my problem?

    Thanks for any help you may be able to offer!!

  • SocksSocks London, UK.Member Posts: 12,822

    @jump2 said:
    Now the questions are, how do I get the selected player to go to the selected scene?

    That will depend on how you are currently changing the invisible player to the selected character - for example, if you are using a game attribute to change the invisible actor's image then all you'd need to do would be to drag a copy of the invisible actor into the scene - or spawn it into the scene.

    @jump2 said:
    How will the player actor know which scene was selected?

    It wouldn't need to know. You'd simply go to whichever scene is selected and change the character in that scene to the selected one.

    @jump2 said:
    This is confusing to me since there are multiple players and scenes to select from. I can't wrap my head around this.

    It's quite straightforward . . .

    Choose a scene 1, 2, 3, 4 or 5 . . . . the player chooses 4
    Choose a character 1, 2, 3, 4 or 5 . . . the player choose 2

    So we go to scene 4 and spawn character 2 (or change the image on the character in that scene to character 2's image . . . etc).

  • jump2jump2 Member Posts: 17

    @Socks... thank you very much for this response. I am going to see if I can think through your path and use the little knowledge I have to solve this puzzle before I ask for the exacting coding answer so I can learn to fish. Hopefully, I will respond with an I got it.
    Thanks again!!!

  • ookami007ookami007 Member Posts: 581

    @Socks is correct. It's pretty straightforward.

    Create a game attribute called player and one called scene.

    At the scene selection, whatever selection they choose (say 1-6), you store in the scene attribute (let's say they choose 4 which is the graveyard).

    Then, they select the player, and you store that in the player attribute. Say they choose 3, the rogue.

    Either upon the second selection of some other event (continue button), you do a IF game.scene = 1 then goto scene 1, IF game.scene = 2, then goto scene 2, etc. In this case, it's 4 so we goto the graveyard scene.

    Within the scene, you have a playerSPAWN actor and the first thing it does is a series of IF game.player = 1 then spawn player1 actor (say fighter), if game.player = 2 then spawn the player2 actor (say mage), etc. In this case, we spawn player3 (rogue) and then destroy the playerSPAWN actor.

    You could have ALL the player behaviors in one actor, but that gets to be a pretty burdensome actor with all the rules. For instance, the rogue may have a tumble ability or a special jump ability where the fighter may have a block ability, etc.

  • jump2jump2 Member Posts: 17

    @ookami007 Thank you for taking the time to write this out for me. After Sock's response, I began down the path you have suggested. I made the selecting page for the scene/path the game player chooses go directly to the scene -- eliminating the need to store extra info. I added a save attribute to the character select screen (specifically the next button -- which already has the conditions required before the game player can go to the scene select screen/menu).

    My next steps are to go to each screen and put the actor spawn code in the scene so the stored character code will spawn and be ready for game play/coding once the scene opens.

    I have created an actor called GamePlayer to spawn the actor into. Is this the correct thing to do because it is not working. Here I am stuck ... again...Suggestions???

  • jump2jump2 Member Posts: 17

    I forgot to say that I created a global integer entitled CurrentPlayer. CurrentPlayer is the save attribute for the number of the character selected for game play. I am trying to call this "CurrentPlayer" into the chose scene and add the appropriate movement, actions etc... to complete the scene mission(s).

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    @jump2 said:
    I have created an actor called GamePlayer to spawn the actor into.

    You don't really spawn an actor 'into' an another actor, you spawn an actor directly into a scene, so you might make an actor called 'Game Controller' (or whatever you like) and this actor spawns the selected character into the scene.

  • jump2jump2 Member Posts: 17

    So this is what I have done:
    1. created an actor called -- GamePlayer
    2. created a rule
    Attribute game.CurrentPlayer (this the save attribute with the selected character number) greater or equal to 1

    ...added a Change Attribute
    self.Image To: game.CurrentPlayer
    2.opened a new scene

    1. dragged in the GamePlayer actor
    2. Previewed and nothing showed up

    What am I missing here. I must be close.

  • jump2jump2 Member Posts: 17

    @Socks and @ookami007
    So I should do something like the following
    in my Game Player Actor:
    Create a rule:
    Atribute - CurrentPlayer(the global selected character saved attribute name) = 1
    Spawn Actor (name/number) of possible actor selected

    I should create a rule with this coding for each possible number character a game player could select.

    ...and then as ookami007 said previously, I should destroy the Game Player actor. This would need to be done so I would not have two actors on screen at the same time as players (it's a single player game). Is this the right way of thinking about this???

  • SocksSocks London, UK.Member Posts: 12,822

    @jump2 said:
    So this is what I have done:
    1. created an actor called -- GamePlayer
    2. created a rule [in the actor called GamePlayer]
    When attribute CurrentPlayer is greater or equal to 1
    Change self.Image To: game.CurrentPlayer

    Opened a new scene

    1. dragged in the GamePlayer actor
    2. Previewed and nothing showed up

    What am I missing here. I must be close.

    Did the blank actor not even show up ?
    Is CurrentPlayer is greater or equal to 1 ?
    Is there an image called 1 (or any number) ?

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    You have a bunch of images (all the different characters) these image are named 1,2,3,4 . . . etc

    Scene 1

    A bunch of actors each displaying a different character image.

    Actor 1 has a rule that says - when touch is pressed change CurrentPlayer to 1
    Actor 2 has a rule that says - when touch is pressed change CurrentPlayer to 2
    Actor 3 has a rule that says - when touch is pressed change CurrentPlayer to 3
    . . . etc

    Scene 2

    Contains the actual GamePlayer actor.

    The GamePlayer actor's first rule is Change self.image to CurrentPlayer.

  • jump2jump2 Member Posts: 17

    The blank character show as a white box because I did not change the opacity.
    The CurrentPlayer is set to "is greeter than or equal to 1"
    The images are assigned a number of 1-6 on each character actor
    Code reads: [on each character actor]
    rule
    actor receives event touch is pressed
    Change attribute: game.character select To: 1
    Each of the character actors has this code

    On the character select screen/menu there are 8 actors 6 selectable characters, 1 box the selected character shows up in and the trigger button with conditions to be met before the game can proceed.

    I created a global game integer entitled "Character select" which I set to "0"

    I then created a Fill Character Actor (Once the game player selects their character, it shows up in the fill character actor). the code is as follows[code for the fill character actor]:
    Rule:
    Attribute game. Character select = 5
    Change attribute Ch 1

    there are 6 characters and each one has this rule in it

    Finally, there is a trigger/button (called start game actor) that checks for a condition which is, did the game player select a character and what was the number. The code for this is as follows:
    Rule:
    If
    Actor receives event touch is pressed
    Attribute game.Character select greater than or = to 1
    then
    Save Attribute
    Atribute game.Character select key: game:CurrentPlayer

    Display Text Continue [THIS WILL NOT DISPLAY WHEN INSIDE OF THIS CODE. BUT WILL IF
    NOT INSIDE OF THIS CODE]

    Change Scene
    Go to Scene: Door selection

  • jump2jump2 Member Posts: 17

    @Socks you have given me something to adjust. I did not have a code to adjust the global CurrentPlayer attribute. I will add this a see If I get a better result.

    Question... Must I rename my character 1- 6 even though I have assigned them a number as explained through my lengthy previous post??

    Thanks for everyones help on this. This is a code setup that we will use frequently so I need to get it right. Thanks!!!!

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    @jump2 said:
    Thanks for everyones help on this. This is a code setup that we will use frequently so I need to get it right. Thanks!!!!

    Seems to be to be a very complex way to achieve a very simple task ?

    @jump2 said:
    The blank character show as a white box because I did not change the opacity.

    I don't know what this means or what it is in relation to ?

    @jump2 said:
    Question... Must I rename my character 1- 6 even though I have assigned them a number as explained through my lengthy previous post??

    (I didn't read all of the post, sorry, too long and confusing).

    You need a way to tell the character actor which image he should use - how are you currently doing this ?

  • jump2jump2 Member Posts: 17
    edited July 2015

    @Socks said:Seems to be to be a very complex way to achieve a very simple task ?

    Yes it does. All I want to do is have a character selection screen were the game player can select their "player character", and to bring that "player character" into the scene the game player chooses to start playing or progress to through linear assignment.

    I tried thinking this through--clearly I am not doing something right. Can you just tell me how you would do this (code wise)? I need to complete this project this week :|. Thanks

    Below is information on the coding I have done todate to try to make this work. If you have a simpler solution that works, I am receptive.

    @Socks said: Did the blank actor not even show up ?
    Is CurrentPlayer is greater or equal to 1 ?
    Is there an image called 1 (or any number) ?

    The blank character showed up as a white box because I did not change the opacity.
    The CurrentPlayer is set to "is greeter than or equal to 1"
    The images are assigned a number of 1-6 on each character actor
    Code reads: [on each character actor]

    @Socks said:You need a way to tell the character actor which image he should use - how are you currently doing this ?

    rule
    actor receives event touch is pressed
    Change attribute: game.character select To: 1
    Each of the character actors has this code

    On the character select screen/menu there are 8 actors 6 selectable characters, 1 box the selected character shows up in and the trigger button with conditions to be met before the game can proceed.

    I created a global game integer entitled "Character select" which I set to "0"

    I then created a Fill Character Actor (Once the game player selects their character, it shows up in the fill character actor). the code is as follows[code for the fill character actor]:
    Rule:
    Attribute game. Character select = 5
    Change attribute Ch 1

    there are 6 characters and each one has this rule in it

    Finally, there is a trigger/button (called start game actor) that checks for a condition which is, did the game player select a character and what was the number. The code for this is as follows:
    Rule:
    If
    Actor receives event touch is pressed
    Attribute game.Character select greater than or = to 1
    then
    Save Attribute
    Atribute game.Character select key: game:CurrentPlayer

    Display Text Continue [THIS WILL NOT DISPLAY WHEN INSIDE OF THIS CODE. BUT WILL IF
    NOT INSIDE OF THIS CODE]

    Change Scene
    Go to Scene: Door selection

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    @jump2 said:

    It's really difficult to hold a conversation where each reply is an essay ! :smiley: I'm really just trying to ask a simple question !

    You have a character that changes its image based on a choice made by the player, how is this character changing its image ?

    I don't really need to know the names of scenes and when text will and will not be displayed or about the 'fill' actor or how the buttons work or the names of your Save Attribute keys (and so on !) :smiley: I'm just asking by what process the character is able to determine which image it should use ?

  • jump2jump2 Member Posts: 17

    @Socks said:It's really difficult to hold a conversation where each reply is an essay ! :smiley: I'm really just trying to ask a simple question !

    Fair enough. Most people say they don't have enough info to answer the question. Sorry for the steroid responses.

    @Socks said:You have a character that changes its image based on a choice made by the player, how is this character changing its image ?

    Specifically, in the scene the player clicks on the character they want to play as and it appears in the play as character area in the same scene. My problem is getting the selected character into the selected scene.

  • SocksSocks London, UK.Member Posts: 12,822

    @jump2 said:
    . . . the player clicks on the character they want to play as and it appears in the play as character area in the same scene. My problem is getting the selected character into the selected scene.

    Q: You have a character that changes its image based on a choice made by the player how is this character changing its image ?

    I'm not sure how else I can phrase the question . . . ?

    I am asking you how your character changes its image, you have told me (several times! :smile: ) how you make the choice of which character is going to be the chosen one, I want to know through which process the actual character actor, the one you play as, changes its image . . . is that any clearer ?

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    Example of what I mean . . .

    I have a scene, it has 5 buttons- when I press one an attribute called ButtonChoice is changed from 0 to either 1, 2, 3, 4 or 5.

    In the next scene, I have car, it has 5 rules, the first rules say:
    if ButtonChoice is 1 then change colour to red
    if ButtonChoice is 2 then change colour to blue
    if ButtonChoice is 3 then change colour to green
    . . . etc etc

    When asking how the car changes its colour, the question is about the car's rules, rather than the rules in the buttons . . . . it's impossible to determine the cause of the issue whereby the car actor turns white on Preview if, when asking how the the car chooses its colour, you are only told the rules for the buttons.

    Is that any clearer ?

  • jump2jump2 Member Posts: 17

    Thank you for your continued attempts to help and educate me in this area!!!

    Ok.... here is goes:
    I have a scene that has eight actors - when I press one of the first six actors, the attribute game.Character Select is changed from "0" to 1-6 (depending on which one is selected) and that actor is displayed in actor 7. Actor 7 is what I want to be the character played in the game.

    So......
    when actor 1 is clicked .... the engineer image shows
    when actor 2 is clicked .... the programmer image shows in actor 7
    when actor 3 is clicked .... the nurse image shows in actor 7
    when actor 4 is clicked .... the musician image shows in actor 7

    When actor 7 is filled, actor 8 can be clicked to go to the next scene.

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    @jump2 said:
    Ok.... here is goes:

    My car analogy didn't really work, lol, let's try this one . . .

    . . . . . .

    A man choose a colour by pointing at a specific colour on a colour chart.

    A second man takes this colour selection and produces a star in that colour.

    So, my question would be 'how does the second man produce this star' - a possible answer would be 'he produces the star by painting it on a wall with oil paints' - but at the moment I am asking 'how does the second man produce this star' and you are replying that 'the first man choose a colour by pointing at a specific colour on a colour chart'.

    . . . . .

    Does that make sense !!!! :smile:

    I don't want to know how you make the selection, I want to know how the character then changes its image to the selection.

    Maybe you could upload a screenshot of the rules you have for your character actor, this is the character actor in the second scene that appears blank when you preview the second scene.

  • jump2jump2 Member Posts: 17
    edited July 2015

    @Socks .... you have already said that I am making this way to difficult. Why don't we restart this conversation as I really need the assistance. I will state the problem and perhaps you can help me with the coding. I would really appreciate that. Here is the situation.

    I would like to have a screen where the player can select the character they want to play as
    I would like to have another screen where the player selects the board/level they would like to game play on
    I then need the selected character to appear in the selected game play scene so they can complete the mission.

    That is it. That is all I have been trying to accomplish. Can you hep me with that?

    Thanks

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    @jump2 said:
    I will state the problem and perhaps you can help me with the coding.

    You have stated the situation, in detail a few times times ! :smile: Stating it again will not make any difference !

    Can you not simply tell me how the character is able to determine which image it should use ? We know how the selection is made, but I need to know how the character uses that information to change its image.

    Maybe you could upload a screenshot of the rules you have for your character actor then I can see the rule for myself ?

  • jump2jump2 Member Posts: 17
    edited July 2015

    .

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2015

    @jump2 said:
    This is a partial image of the code . . .

    So, this is the actor that when previewed appears as a blank white box ?

    These rules look nothing like the one's you've described, we are trying, through this conversation to work out why the character actor appears as a blank box, you described the rules that cause this issue as . . .

    "When attribute CurrentPlayer is greater or equal to 1"
    "Change self.Image To: game.CurrentPlayer"

    . . . but the rules in this screenshot appear to be saying:

    When game.Character = 1
    Change Image

    . . . anyhow, sorry I can't offer a solution, maybe someone else has some ideas, best of luck.

  • jump2jump2 Member Posts: 17
    edited July 2015

    .

  • jump2jump2 Member Posts: 17
    edited July 2015

    .

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078

    @jump2 would this help, its a free template that i made really quickly.

  • jump2jump2 Member Posts: 17

    @CodeMonster
    Thank you for your response. This does look like it may be less complicated and cleaner than the route I have taken.Thank you!!!!

Sign In or Register to comment.