Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[HPL3 WIKI] What kind of tutorials/pages would you like to see?
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#41
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Wow this is such an in-depth post :o I'll have to sit down and give it a read 3 or 4 times to make sure I do understand~ I mean, right now, the code works, and that's what is important for me xD but I'll be sure to give it a thorough check so I don't make many screw ups in future Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-08-2015, 03:34 AM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#42
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Just want to emphasize on what TheGreatCthulhu said:
"However, FG has implemented a bunch of these helper functions that work with these classes and objects internally, and so effectively hide these details, making the scripting feel more like it did for Amnesia. "

Using the helper functions is what you should be doing 99% of the time. The rest of the stuff gets very complicated and requires much more knowledge about programing.

With the helper functions and by settings things up properly with maps and entities, the possibilities are quite endless as to what you can make with HPL3. Far beyond what you could do in Amnesia/HPL2. You would only worry about classes and all the other more complicated deeper down things if you want to create something completely different or if you want to create new helpers for other people to use.

Saying this as it is important to keep in mind and that perhaps on the wiki make sure to specify this as well. If you write something with these parts of the scripting, mark it as advanced, put a clear message it is not of interest to most and point them in the direction of the basics they need instead.

From the scripters guide I quote (and you can also check SOMA maps to see that this was kept 99% accurate):
"A level script should not be thought of as file for programing. A level script should be written and read as though it is a story (or a sequence of events if you wish).

In the level script you are crafting the experience for the user and the script should be read as the manuscript of that experience.

If the level script file contains rows of code that does not match the above description, then the rows of code does not belong in the level script, they belong in a helper file or even deeper down in the hierarchy of script files (or even in the c++ code!).

This primarily means that when working to solve a problem of how to implement an event (activity, puzzle, challenge, character interaction etc) in a level, the first approach is not that of a programmer. The correct approach to take is:

Begin by examining and configuring the resources (entities, sounds, graphics) that is used in the event. This to make best use of what is already available (in terms of prop types, configurations and so on).
Move on and make sure that the area in the level used for the event is created in a way that works. If not, you tweak it to be better. This can be as simple as renaming entities in a way that simplifies the scripting of them. You also make sure you to add in what ever new things you need (such as script areas).
Finally you can begin scripting. This you do by making use of all the existing helper functions to create a short and easy to read solution for the event implementation.
Only when or if the above will not accomplish the task at hand you continue and create helper functions, new states or other changes and additions to the lower level scripts."
10-08-2015, 08:22 AM
Website Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#43
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Thanks for the enlightenment. I've added a little note on the wiki.
I was almost starting to worry if everything in regard to scripting would end up like this. Not that I have much of a problem with it, but it would require a lot more explaining for the average user xP

(This post was last modified: 10-08-2015, 09:18 AM by Mudbill.)
10-08-2015, 09:18 AM
Find
Vale Offline
Member

Posts: 92
Threads: 13
Joined: Mar 2014
Reputation: 7
#44
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Ok, maybe I'm blind, but does anyone know where the station_gui helper is? Not the imgui, but station gui, which has commands to quickly set up a terminal. I want to reference how they wrote some of the functions but cant seem to find it.
10-08-2015, 02:42 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#45
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

https://wiki.frictionalgames.com/hpl3/co...up_an_item

A wip tutorial on how to do a super basic item
10-08-2015, 05:04 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#46
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Added to the OP Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-08-2015, 05:17 PM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#47
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Oh, yes - most people should definitively make use of the helper functions.

My post was mainly a response to something Romulator said in his tutorial (about not being sure what the "class iScrMap" thing does) - just wanted to share some info about that to him and other people who are interested in these advanced aspects of the scripting engine.

Also, at some point in time there will be people who will want to make a mod that's completely differently conceptualized then SOMA, and will want to drastically change some aspects of the game - and while people have been able to achieve that to some extent with Amnesia by using some really clever hacks to circumvent game's limitations, from what I've seen, now this is supported to a pretty great extent - so I think its worthwhile to compile some kind of documentation for advanced scripters, but phrased in such a way so that you can make (at least some) use of these features without being trained in programming.

As for my scripting page in the Scrapbooks folder - I'm gonna collect both advanced and non advanced info there, so I guess I can separate these out somehow into different section. But again, it's a "scrapbook" - a just a place to dump data so that it doesn't get lost / forgotten, that will then form a basis for a proper wiki entry at some later point.

EDIT:
But note that even for some of the non-advanced stuff, you sometimes need to have at least a basic idea on how to use objects - since some of the helper functions work with them.

E.g.
This one returns a vector object:
cVector3f Player_GetPosition()

You can then access various components of it:
PHP Code: (Select All)
cVector3f playerPos Player_GetPosition();
float x playerPos.x;

// or just
float x Player_GetPosition().x;

// Note: same for y & z components. 

And this one accepts a vector object as a parameter:
void Player_AddBodyForce(const cVector3f &in avForce, bool abUseLocalCoords)
(This post was last modified: 10-08-2015, 07:39 PM by TheGreatCthulhu.)
10-08-2015, 06:35 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#48
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

I've added a Troubleshooting page under the Editors category. It covers all of the editors and some basic errors which come up.

If there are more, please fill them in!

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-09-2015, 12:04 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#49
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Hey Modulator. A student of mine is reporting that the monster map your linked on your setting up a monster tutorial has a bugged .hps script.

I have identified and fixed 2 issues within it.

1. You forgot to add #include "helpers/helper_ai.hps" to the top of your script. The pathfinder functions rely on this helper file being included.

2. the close door function is defined as a bool, so SOMA expects you to return a bool. since your function does not return anything it should be made a void instead, or you should make it return something so SOMA does not get confused.
10-09-2015, 03:49 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#50
RE: [HPL3 WIKI] What kind of tutorials/pages would you like to see?

Awesome! I'll take a look at that right now and fix it up!

Discord: Romulator#0001
[Image: 3f6f01a904.png]
10-09-2015, 03:52 PM
Find




Users browsing this thread: 2 Guest(s)