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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script helpers by modders for modders
Vale Offline
Member

Posts: 92
Threads: 13
Joined: Mar 2014
Reputation: 7
#1
Script helpers by modders for modders

I was thinking that as a modding community it might be a good idea to create our own helpers as we get more used to hpl3. While its a bit out of reach right now, I think before long it would be wise to set up a modders helper library for various functions that people might find useful, which modders could download and add to their mods.
For example, it would probably be possible to make an hpl2 helper which lets you use imitations of the scripts in hpl2 with the same syntax.
Any thoughts?
10-08-2015, 02:46 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Script helpers by modders for modders

I've had this thought as well, and I think it's a great idea. We gotta make sure it's easy for people to understand how to apply though, or else people might be scared to try them. A convenient and user-friendly library would work, either on the wiki or the forums (or both).

(This post was last modified: 10-08-2015, 03:38 PM by Mudbill.)
10-08-2015, 03:38 PM
Find
Vale Offline
Member

Posts: 92
Threads: 13
Joined: Mar 2014
Reputation: 7
#3
RE: Script helpers by modders for modders

Alright.
After I finish up the wiki page on terminals Im going to look into setting up a simple helper library.
I'll be going with the hpl2 imitator library for now unless anyone has a better suggestion?
10-08-2015, 03:43 PM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#4
RE: Script helpers by modders for modders

^That's not a bad idea. I think you can mostly just wrap existing functions with the ones in your library. You can probably make it all in one .hps file. (Some aspects could prove tricky (or not), but if something too tricky comes along, you might be able to simply omit it - as long as the library supports the most used/useful functions, it should be fine.)
Using it should then just be a matter of a adding a single #include.
(This post was last modified: 10-08-2015, 07:12 PM by TheGreatCthulhu.)
10-08-2015, 07:10 PM
Find
Vale Offline
Member

Posts: 92
Threads: 13
Joined: Mar 2014
Reputation: 7
#5
RE: Script helpers by modders for modders

Alright. I may open a thread somewhere asking what functions people miss most from hpl2.
And yeah, having a single include is the idea. I think it will be mainly for people experienced with hpl2 who dont want to have to learn hpl3.
10-08-2015, 07:14 PM
Find
PathOS Offline
Member

Posts: 189
Threads: 11
Joined: Sep 2013
Reputation: 6
#6
RE: Script helpers by modders for modders

For newcomers not familiar with HPL, is there a document or description which best summarizes what these "Helper" objects do?

I know they are important as Jens in another thread pretty much emphasized that most people who wish to do anything in the editor should be using them almost all the time.

Thanks!
(This post was last modified: 10-08-2015, 07:18 PM by PathOS.)
10-08-2015, 07:17 PM
Find
Vale Offline
Member

Posts: 92
Threads: 13
Joined: Mar 2014
Reputation: 7
#7
RE: Script helpers by modders for modders

Ok, so heres the idea of a helper. (Not only does hpl use them, but most programming languages have some form of them.)
Imagine you create a bunch of functions that you can use between a bunch of maps. Rather than coding them for every map, you code them into another 'helper' hps file which you include in each map. You can then use these functions in that map!
So a function like ImGui_drawGfx(), which may seem like something hardcoded into Soma, is actually a function coded somewhere else and included with a #include.
Its no different from you making a custom void myFunc().
(This post was last modified: 10-08-2015, 07:24 PM by Vale.)
10-08-2015, 07:23 PM
Find
PathOS Offline
Member

Posts: 189
Threads: 11
Joined: Sep 2013
Reputation: 6
#8
RE: Script helpers by modders for modders

So would you say that Helpers have a similar function in a sense to "Prefabs"? (which to my understanding are bundles of assets grouped together). I'm not a coder/programmer so I'm trying to relate Tongue
(This post was last modified: 10-08-2015, 07:34 PM by PathOS.)
10-08-2015, 07:33 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#9
RE: Script helpers by modders for modders

It's a common file used throughout multiple script files.

If you know of The Second Dimension (which I'd find likely) and looked at its code (which I'd find unlikely), you'd see that there's a section in every map that had the exact same code. It's under a comment that says //GENERAL SCRIPTS or something. This is because Amnesia does not use the #include, so MrBehemoth had to add the same code to every file in order to access it.

If we made a helper file with useful helpers, then others could download that, use #include, and then use those helpers without having to know how they work under-the-hood. For example, we could have a function there like CreateExplosion(). The user of this helper would give it some arguments, like position, velocity etc. but the function itself in the helper file would be specifying things like "GetPosition, PlaySoundAtPosition, CreateImpulse, AddScreenEffects" and so on, which the user would not need to touch or even know about. They just need to know the result. Hope this makes sense.

(This post was last modified: 10-08-2015, 08:54 PM by Mudbill.)
10-08-2015, 08:50 PM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#10
RE: Script helpers by modders for modders

Quote:"Prefabs"
Well, in some sense, I guess you can think of them like that. Scripts that offer functionality you can reuse in many different projects and in various ways.

But Jens was talking about something slightly different. In HPL2, the scripting system consisted more or less of a bunch of functions that you could call in user scripts, but that were defined in the game engine itself (as in, embedded in the game executable files).
With HPL3, there are also functions and some other stuff defined in this way, but they are much more low-level (that is they are much more "closer" to the "core" engine features other stuff is built upon), and there's quite a bit more of them.
Then there's a whole another level (or two) of script code written "on top" of those core features that makes all kinds of things happen. To work with that directly, you have to know quite a bit about programming.

However, FG then created on top of all that these helper scripts that make it much more simpler to use that stuff, and make scripting feel more like it was in HPL2/Amnesia - and these are the helper scripts that Jens was talking about.
For what most people will be doing, these will suffice for pretty much everything you can think of.
So, they are important in the sense that here they play the role engine script functions played before in HPL2.
And there's a lot more of these helper functions this time around, so there's a lot more things you can do. And while some of the documentation on the wiki is still being prepared - for helper functions, there's documentation in the .hps files themselves that scripters can make use of, so that's pretty neat.

(10-08-2015, 08:50 PM)Mudbill Wrote: If you know of The Second Dimension (which I'd find likely) and looked at its code (which I'd find unlikely)

Hehehe @ that second part Big Grin

I guess when most people look at the code they go: "What sorcery is this?!"
(This post was last modified: 10-08-2015, 09:12 PM by TheGreatCthulhu.)
10-08-2015, 09:04 PM
Find




Users browsing this thread: 1 Guest(s)