Interaction with in-game computer
Posted: Mon Sep 14, 2020 2:36 pm
Hello!
Dialogue System is an amazing asset, with tons of features. Keeping in mind that I am a beginning developer, it might be highly possible that I might come across silly doubts!
Apologies in advance and Noob-Alert ahead!
I have a situation where after completing a conversation with NPC, I require a set of questions to be asked to player, and I have a computer screen asset in my scene. I am looking forward to use that, to provide a feeling of interacting with in-game computer!
I referred the interaction with Terminal in Demo Scene 1, provided as sample with Dialogue System. It is almost similar to what I am looking forward to implement, except for the fact that I require the NPC Subtitles and Response Buttons, to appear on the computer screen asset, in order to exactly match the UI experience.
I set up a scene, where I created a new camera, as a child of the computer asset, and set it accordingly, to show the desired view. After setting up the new camera, I disabled it. Then, I provided an extra collider to the object, so that player's proximity selector component can detect the computer object to interact with, "OnUse".
Then, I added "Usable", "Dialogue System Trigger" and "Override UI" components to the computer asset.
In the Dialogue Manager > Camera & Cutscene Settings > Sequencer Camera, I passed the newly created camera object.
Player's proximity selector does show the computer asset name, when it is in radius of the computer screen asset.
Now, when player interacts with computer screen asset, I want my game view, to transition to computer screen asset.
As I have not specified any actions in Dialogue System Trigger so far, the sequencer camera does change the angle to desired view, but only momentarily. As soon as my desired view is reached, the game view is reverted back to it's original position. What I mean to say is, the view which the sequencer camera represents, is quickly reset to game view which the main camera represents!
Note that I have a camera follow script attached to player, which would put the main camera, as a child of Player, at runtime, and a camera collision script attached to main camera!
So, initially when player's proximity selector show's computer screen asset, and when player interacts with it, the game view needs to transition to a different view, that which shows only computer screen.
Next, I require a button, which would be present in the centre of the computer screen asset. In order to do that, I created a new button, as a child object of computer asset. Note that a new Canvas object gets created first, which acts as immediate child of computer asset. The button is then created as child of the canvas object.
Then, I set the Renderer of newly created Canvas to Screen Space Overlay.
What I want is, the button to be activated, when player interacts with computer screen asset. So, I disabled the newly created button object, and then added an action of activating that button, using computer screen asset's > Dialogue System Trigger > Actions > Set Game Object Active/Inactive component.
Now, I want the conversation to be started, when the button I created earlier is clicked. So, I passed the object "Dialogue Manager" to "OnClick()" property of previously created button and set the function "StartConversation()".
So far when I test this, when player interacts with computer asset, sequencer camera does momentarily change the angle, but it gets reset to main camera's view, as soon as it reaches the desired view. Then, the button which I created earlier, does show up, and when I click it, the conversation gets started.
But, the conversation show's the name of previous NPC character, and sometimes the Dialogue UI does not get overridden. Also, when response menu is triggered after NPC dialogue, response button is non-functional and I'm not able to click it. Therefore, I'm not able to proceed ahead in the conversation.
Talking about the conversation, I have questions which would be a part of NPC subtitles. But I require at least 4 Radio Buttons or 4 regular buttons, in the response menu. But those buttons should be represented separately and independently, and not in scrollable view. I tried, but was not able to get it appropriately. So, if there's any way by which I could do that, your help would be much appreciated!
And, As an alternative to creating a new camera and passing it to Dialogue Manager's Sequencer Camera slot, I created an empty game object, to represent the position, which would provide the desired view. I named that object "CameraAngle". Then, I set the sequence manually, using Camera(CameraAngle,,1) command, in the first dialogue.
But even that didn't work. Like, the same issue would persist where the desired view would be changed momentarily and then get reset back to main camera's view.
To sum up, this is what I'm trying to accomplish:
1) Transition to computer screen view, when player interacts with computer screen asset.
2) A button in the centre of screen, which would be activated once the player interacts with computer screen asset, and which when clicked, would start the conversation. And then get deactivated when conversation ends.
3) Multiple response buttons, at least 4 and first preference radio buttons or any other form of buttons, not in scrollable view.
4) Transition back to original view, when conversation is ended or cancelled.
Any help would be much appreciated!
And Dialogue System is truly an amazing asset!
Kind Regards,
Bhavin.
Dialogue System is an amazing asset, with tons of features. Keeping in mind that I am a beginning developer, it might be highly possible that I might come across silly doubts!
Apologies in advance and Noob-Alert ahead!
I have a situation where after completing a conversation with NPC, I require a set of questions to be asked to player, and I have a computer screen asset in my scene. I am looking forward to use that, to provide a feeling of interacting with in-game computer!
I referred the interaction with Terminal in Demo Scene 1, provided as sample with Dialogue System. It is almost similar to what I am looking forward to implement, except for the fact that I require the NPC Subtitles and Response Buttons, to appear on the computer screen asset, in order to exactly match the UI experience.
I set up a scene, where I created a new camera, as a child of the computer asset, and set it accordingly, to show the desired view. After setting up the new camera, I disabled it. Then, I provided an extra collider to the object, so that player's proximity selector component can detect the computer object to interact with, "OnUse".
Then, I added "Usable", "Dialogue System Trigger" and "Override UI" components to the computer asset.
In the Dialogue Manager > Camera & Cutscene Settings > Sequencer Camera, I passed the newly created camera object.
Player's proximity selector does show the computer asset name, when it is in radius of the computer screen asset.
Now, when player interacts with computer screen asset, I want my game view, to transition to computer screen asset.
As I have not specified any actions in Dialogue System Trigger so far, the sequencer camera does change the angle to desired view, but only momentarily. As soon as my desired view is reached, the game view is reverted back to it's original position. What I mean to say is, the view which the sequencer camera represents, is quickly reset to game view which the main camera represents!
Note that I have a camera follow script attached to player, which would put the main camera, as a child of Player, at runtime, and a camera collision script attached to main camera!
So, initially when player's proximity selector show's computer screen asset, and when player interacts with it, the game view needs to transition to a different view, that which shows only computer screen.
Next, I require a button, which would be present in the centre of the computer screen asset. In order to do that, I created a new button, as a child object of computer asset. Note that a new Canvas object gets created first, which acts as immediate child of computer asset. The button is then created as child of the canvas object.
Then, I set the Renderer of newly created Canvas to Screen Space Overlay.
What I want is, the button to be activated, when player interacts with computer screen asset. So, I disabled the newly created button object, and then added an action of activating that button, using computer screen asset's > Dialogue System Trigger > Actions > Set Game Object Active/Inactive component.
Now, I want the conversation to be started, when the button I created earlier is clicked. So, I passed the object "Dialogue Manager" to "OnClick()" property of previously created button and set the function "StartConversation()".
So far when I test this, when player interacts with computer asset, sequencer camera does momentarily change the angle, but it gets reset to main camera's view, as soon as it reaches the desired view. Then, the button which I created earlier, does show up, and when I click it, the conversation gets started.
But, the conversation show's the name of previous NPC character, and sometimes the Dialogue UI does not get overridden. Also, when response menu is triggered after NPC dialogue, response button is non-functional and I'm not able to click it. Therefore, I'm not able to proceed ahead in the conversation.
Talking about the conversation, I have questions which would be a part of NPC subtitles. But I require at least 4 Radio Buttons or 4 regular buttons, in the response menu. But those buttons should be represented separately and independently, and not in scrollable view. I tried, but was not able to get it appropriately. So, if there's any way by which I could do that, your help would be much appreciated!
And, As an alternative to creating a new camera and passing it to Dialogue Manager's Sequencer Camera slot, I created an empty game object, to represent the position, which would provide the desired view. I named that object "CameraAngle". Then, I set the sequence manually, using Camera(CameraAngle,,1) command, in the first dialogue.
But even that didn't work. Like, the same issue would persist where the desired view would be changed momentarily and then get reset back to main camera's view.
To sum up, this is what I'm trying to accomplish:
1) Transition to computer screen view, when player interacts with computer screen asset.
2) A button in the centre of screen, which would be activated once the player interacts with computer screen asset, and which when clicked, would start the conversation. And then get deactivated when conversation ends.
3) Multiple response buttons, at least 4 and first preference radio buttons or any other form of buttons, not in scrollable view.
4) Transition back to original view, when conversation is ended or cancelled.
Any help would be much appreciated!
And Dialogue System is truly an amazing asset!
Kind Regards,
Bhavin.