User Tools

Site Tools


Sidebar

hpl3:community:scripting:terminal_basics

Setting up a simple Terminal (Not even close to being finished)

I started this a bit late and need sleep, will finish tomorrow. Totally pointless reading atm.

What is in this tutorial, and what should I know/do first?

After much demand, here is a guide on how to set up a basic terminal in SOMA.This guide will cover these concepts:

  • Setting up your script/map for a terminal
  • Basic terminal logic; how the game reads what you code, and where to code it
  • How to use some of the fast functions for GUI included in SOMA, such as a main menu, back button, adding dialog, displaying an image, etc.

The guide will not cover more advanced topics like password input, video cameras, locking doors, etc. Those will be in a later guide, so if you're searching for an advanced topic like one of the ones I've listed then be patient until a guide is made for them. Keep in mind, there are few limits to what you can pull off with a terminal; I'll be teaching you how to quickly set up the normal terminals seen throughout SOMA, but you can also setup GUI for things like the laptop at the start of the game, and, as far as I know, much more advanced and interactive GUI than the basic stuff if you have the patience for it.

I also recommend you know the following things first:

  • How to set up codelite! I really have to stress this one. It will make your life easier if you use it properly.
  • Make sure you've set up your mod. Check here: wiki.frictionalgames.com/hpl3/community/hpl3_getting_started
  • How to use language files in SOMA. Not necessary, but I recommend you have an english file set up (or whatever language you prefer.) There isn't a guide for this yet, but there will be sooner or later. Reading the guide for Amnesia for this might help out, as it uses the same format.
  • Basic understanding of C, and how to read error messages. Seriously, knowing what a simple error message means will help you debug, and knowing the different variable types in C and the function types (like what is a void, a bool, or an int function?) If you know this stuff, than you'll also have an easier time learning new code on your own. You could probably just google 'learning basic C' to find some quick tutorials.

After you've done ALLLLL this crap, or the things you think are necessary, then follow me to the basic setup.

Just let me add my terminal already!

Alright. So to start off, make sure you have a map set up with the terminal you want. Name the terminal something you'll remember thats code friendly. (IE coolTerminal, cool_terminal, etc) If you select the terminal, you should see something like this in it's entity tab:

If not, then find another terminal to use that has this menu. (I imagine there are ways to create any entity into a terminal with the model editor, but I have not looked yet.) Make sure your terminal is once again properly named, and then in terminal window find the boxes entitled 'OnGuiFunction', 'EnterCallback', and 'LeaveCallback'. These are the callbacks that we will primarily use in our code to run the terminal. I recommend clicking the generate button beneath each, but if you prefer you can name each callback yourself. Also make sure to check the 'allowInteraction' box if the player can interact with the terminal. Otherwise they can only look at it. Once the boxes have names, generated or otherwise, save your map and open up your script. Your terminal on the map side of things should be done!

Script Setup

hpl3/community/scripting/terminal_basics.1444268134.txt.gz · Last modified: 2015/10/08 01:35 by valetheimpaler