- Home /
IN-GAME - Interactive Computer/Virtual Desktop
Hi all,
I am currently working on a project that requires in-game terminals that allow for user interaction. For example a desktop where you can start different programs, but also a command line like an old DOS screen or a Unix terminal.
I need to be able to control the output so that it looks like they are interacting with a real computer (Doesnt have to be a real computer though hehe)
But cant really figure out how i would do this? I have a computer screen, but how would i take input? And create a "virtual desktop"?
I don't have UnityPro if it makes a difference.
Thanks!
Frederik
Wow that's complicated. Are you looking for a game that circles around the ter$$anonymous$$al or simply something like typing "mail" and will open your "Inbox"? Not even looking at this, you will need scripts for visible text, typing and reaction. You could load the computer on a separate level (getbuttondown, play animation, load level) or a much harder thing to do would be to create words standing next or looking at the computer. This is, like I said, a very complicated process. $$anonymous$$aking the text perform a function outside the computer would be the easiest part. Please elaborate.
I wanna start with just a DoS prompt where for example you can type "help" and all the commands will show. And when i get a little more advanced maybe with a virtual desktop with icons and stuff :-)
Answer by alexfeature · Dec 28, 2012 at 12:44 PM
Hey Frederic,
Unity pro would make this a lot easier :)
Then you could use a render texture to display image form a camera that would basically look at an off-screen GUI that you are manipulating from code. Making it look as if stuff the user is doing is displayed on a virtual screen of your model.
Since you dont have pro you could still do something similar but you would need to tinker a bit.
First you would need to get hold of a UI framework like NGUI or something similar (i think there is a free version of NGUI, check here)
Then you would simply create game object that would be positioned over the screen of your terminal model.
Figure out all the dimensions and rotations of the game object to match your screen.
Then have a way for the user to interact with the terminal. For instance a collider in front of the terminal could trigger the 'interaction phase'.
Then comes the hard part. You would need to position and display various labels and sprites to imitate a dos like UI in the LOCAL space of your screen game object.
The end result will essentially be that your player comes close to a terminal and the terminal is initialized. You then draw objects inside the virtual screen (that is hovering just above the terminal's model).
It will be awesome :)
Good luck!
Yeah, i already figured that much out. But i havent really figured out how to actually DO it.. Hm.
Well what have you tried so far? Just try to break it down into smaller junks until the problem is just a bunch of small bits that by themselves are easy.
A good place to start would be the basic model of the ter$$anonymous$$al. Then you could get the trigger done to start up the ter$$anonymous$$al and so on.
It's a big task mate, just keep at it.
I have all of that already! I am just stuck at the showing the ter$$anonymous$$al "screen" in front of the player, i could just use GUI but that would get really ugly.. Dont really know how to continue..
Why would it get ugly? I'm thinking about Deus Ex:HR and other relatively modern games, and generally when you get to a console it pops up a GUI. Do you need the characters to be able to walk away from the console instantly, without closing down a GUI? That seems like the main reason you'd avoid using one, but then you have the problem of not being able to type, because your keys are still mapped to movement.
Im talking about using the "standard Unity GUI" which is pretty ugly.. I may have to go buy NGUI..
Answer by denijn · Jan 20, 2014 at 11:13 PM
Doesn't sound too hard in my humble opinion, don't try to reinvent the wheel :) If i would attempt what you are trying to do i'd full screen the terminal and make it a new scene...
I'd use a quest based dialog system like DiaQ where you can set conditions and dialog options. You can also create variables. (your code will probably have to fill those variables depending on the player input)? Easy conditions like if var x == "whatever" is true display text "x" if not display text "y" It has a bit of a learning curve but you can do a lot with it. Hope this helps!
Your answer
![](https://koobas.hobune.stream/wayback/20220613085759im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
how to listing all game objects in GUI.Box? 1 Answer
Multiple Cars not working 1 Answer
ScrollView disappears shortly after starting the game (Android) 1 Answer