Difference between revisions of "HPL2/HPL2 Helper Scripts"

From Frictional Wiki
Jump to navigation Jump to search
m (Prepped placeholder page.)
(Added set-up instructions)
Line 1: Line 1:
 
{{TocRight}}
 
{{TocRight}}
  
==Introduction==
+
=Introduction=
 
<br>
 
<br>
 
{{ReqVer|1.5}}<br>
 
{{ReqVer|1.5}}<br>
Line 7: Line 7:
  
 
''HPL2 Helper Scripts'' is a collection of .hps files containing script classes and functions that may be useful to HPL2 modders and custom story creators (for ATDD and AAMFP). It is compatible with ATDD version 1.5 and later.
 
''HPL2 Helper Scripts'' is a collection of .hps files containing script classes and functions that may be useful to HPL2 modders and custom story creators (for ATDD and AAMFP). It is compatible with ATDD version 1.5 and later.
 +
<br> The scripts are divided into two categories: ''utilities'' and ''features''. The ''utilities'' scripts include tools for general scripting, like new maths functions, or linked lists and vector classes. The ''features'' scripts are more specific solutions that make use of the utilities, such as a way to spawn entities at specific locations, script a large chain of events or to make entities twitch and flicker. Some modders might prefer to just adopt the ''utilities'' scripts. It's up to you!
 +
 +
See below for download and set-up instructions.
  
 
{{Note|This is a placeholder. Full documentation will be available soon.}}
 
{{Note|This is a placeholder. Full documentation will be available soon.}}
 +
 +
=Contents=
 +
The documentation and help is organised by the .hps file. You'll find everything detailed on these pages:
 +
 +
 +
 +
 +
=Set-up=
 +
First, download ''HPL2 Helper Scripts'' via Steam Workshop or ModDb. Once you have it, there are three options for how you add it into your mod. '''If you are unsure, just go with option A'''.<br>
 +
 +
==Option A: The full feature-set package==
 +
If you want to be able to use all the new functions and classes, go with option A.
 +
#Copy the folder '''''HPL2HelperScripts''''' into your '''''maps''''' folder.
 +
#Include '''''HelperScripts_FullPackage.hps''''' in your level's .hps script file using the '''''#include''''' directive.
 +
#Add '''''HelperScriptsUpdate(afStep)''''' to your main '''''OnUpdate()''''' function in your level's .hps script file.
 +
E.g., in myLevel.hps:
 +
<syntaxhighlight lang="cpp">
 +
#include "HelperScripts_FullPackage.hps"
 +
 +
void OnUpdate(float afStep)
 +
{
 +
    HelperScriptsUpdate(afStep);
 +
}
 +
</syntaxhighlight>
 +
 +
==Option B: The utilities-only package==
 +
Choose option B if you want to have access to the functions and classes in the ''utilities'' category, but don't need the stuff in the ''features'' category.
 +
#Copy the folder '''''HPL2HelperScripts''''' into your '''''maps''''' folder.
 +
#Include '''''HelperScripts_UtilitiesOnly.hps''''' in your level's .hps script file using the '''''#include''''' directive.
 +
#Add '''''HelperScriptsUpdate(afStep)''''' to your main '''''OnUpdate()''''' function in your level's .hps script file.
 +
E.g., in myLevel.hps:
 +
<syntaxhighlight lang="cpp">
 +
#include "HelperScripts_UtilitiesOnly.hps"
 +
 +
void OnUpdate(float afStep)
 +
{
 +
    HelperScriptsUpdate(afStep);
 +
}
 +
</syntaxhighlight>
 +
 +
==Option C: Pick-n-mix==
 +
Advanced modders might prefer to only adopt the specific script files they need. Go nuts! But also be aware of the #include dependencies in each script file, as many of them are interdependent. You might find it easiest to start with option A or B and then remove scripts later that you definitely haven't used. You're also fully allowed and encouraged to just use HPL2HelperScripts as a learning resource or even to just copy snippets here and there.
 +
 +
=Support=
 +
''HPL2 Helper Scripts'' is made by mrbehemo of Aetheric Games. If you need support, first be sure to check this documentation. If you're still stuck and have a question about these scripts, come and find me on the Frictional Discord server.
 +
 +
=Licence=
 +
You are free to use ''HPL2 Helper Scripts'' in whatever way you see fit, no rights reserved by Aetheric Games. If you find it helpful, it would be nice to include a credit. You can list it as "HPL2 Helper Scripts by Aetheric Games".
  
  
== Support ==
 
''HPL2 Helper Scripts'' is made by mrbehemo (Aetheric Games). If you need support, first be sure to check this documentation. If you're still stuck and have a question about these scripts, come and find me on the Frictional Discord server.
 
 
__FORCETOC__
 
__FORCETOC__
 
__NOINDEX__
 
__NOINDEX__

Revision as of 09:55, 22 November 2023

Introduction


Alert icon.png Requires version 1.5

HPL2 Helper Scripts is a collection of .hps files containing script classes and functions that may be useful to HPL2 modders and custom story creators (for ATDD and AAMFP). It is compatible with ATDD version 1.5 and later.
The scripts are divided into two categories: utilities and features. The utilities scripts include tools for general scripting, like new maths functions, or linked lists and vector classes. The features scripts are more specific solutions that make use of the utilities, such as a way to spawn entities at specific locations, script a large chain of events or to make entities twitch and flicker. Some modders might prefer to just adopt the utilities scripts. It's up to you!

See below for download and set-up instructions.

Note icon.png This is a placeholder. Full documentation will be available soon.

Contents

The documentation and help is organised by the .hps file. You'll find everything detailed on these pages:



Set-up

First, download HPL2 Helper Scripts via Steam Workshop or ModDb. Once you have it, there are three options for how you add it into your mod. If you are unsure, just go with option A.

Option A: The full feature-set package

If you want to be able to use all the new functions and classes, go with option A.

  1. Copy the folder HPL2HelperScripts into your maps folder.
  2. Include HelperScripts_FullPackage.hps in your level's .hps script file using the #include directive.
  3. Add HelperScriptsUpdate(afStep) to your main OnUpdate() function in your level's .hps script file.

E.g., in myLevel.hps:

#include "HelperScripts_FullPackage.hps"

void OnUpdate(float afStep)
{
    HelperScriptsUpdate(afStep);
}

Option B: The utilities-only package

Choose option B if you want to have access to the functions and classes in the utilities category, but don't need the stuff in the features category.

  1. Copy the folder HPL2HelperScripts into your maps folder.
  2. Include HelperScripts_UtilitiesOnly.hps in your level's .hps script file using the #include directive.
  3. Add HelperScriptsUpdate(afStep) to your main OnUpdate() function in your level's .hps script file.

E.g., in myLevel.hps:

#include "HelperScripts_UtilitiesOnly.hps"

void OnUpdate(float afStep)
{
    HelperScriptsUpdate(afStep);
}

Option C: Pick-n-mix

Advanced modders might prefer to only adopt the specific script files they need. Go nuts! But also be aware of the #include dependencies in each script file, as many of them are interdependent. You might find it easiest to start with option A or B and then remove scripts later that you definitely haven't used. You're also fully allowed and encouraged to just use HPL2HelperScripts as a learning resource or even to just copy snippets here and there.

Support

HPL2 Helper Scripts is made by mrbehemo of Aetheric Games. If you need support, first be sure to check this documentation. If you're still stuck and have a question about these scripts, come and find me on the Frictional Discord server.

Licence

You are free to use HPL2 Helper Scripts in whatever way you see fit, no rights reserved by Aetheric Games. If you find it helpful, it would be nice to include a credit. You can list it as "HPL2 Helper Scripts by Aetheric Games".