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 Help Can HPL2 Scripts use AngelScript's import keyword?
eambertide Offline
Junior Member

Posts: 2
Threads: 1
Joined: Aug 2019
Reputation: 0
#1
Can HPL2 Scripts use AngelScript's import keyword?

AngelScript has the usage 
import void MyFunction(int a, int b) from "Another module";

in their documention, this doesn't work in Amnesia, but it also doesn't exactly crash it either, giving me hope if there is a way to make it work. HPL3 seems to have #include, but does HPL2 have anything similar?
(This post was last modified: 08-02-2019, 08:05 PM by eambertide.)
08-02-2019, 08:04 PM
Find Reply
Mudbill Offline
Muderator

Posts: 3,807
Threads: 59
Joined: Apr 2013
Reputation: 177
#2
RE: Can HPL2 Scripts use AngelScript's import keyword?

Me and others have tested this particular functionality extensively but have not come to any usable conclusion. My answer is that it does not work.

My guess is that it is dependent of some functionality in the host application (The HPL engine), and without that functionality added, we cannot use it. Since we don't have the source, we can't verify or change that.

The import keyword itself most likely allows the script file to compile successfully because it is supported by the language, but isn't able to actually read other files as the functionality would have you think, therefore it fails to load the requested function. You will notice that if you try to call a function that is "imported" with this keyword, you don't get an error, but the script execution halts for the running function, as is the expected behaviour when getting a runtime error like this.

(This post was last modified: 08-03-2019, 06:52 PM by Mudbill.)
08-03-2019, 06:49 PM
Find Reply
eambertide Offline
Junior Member

Posts: 2
Threads: 1
Joined: Aug 2019
Reputation: 0
#3
RE: Can HPL2 Scripts use AngelScript's import keyword?

(08-03-2019, 06:49 PM)Mudbill Wrote: Me and others have tested this particular functionality extensively but have not come to any usable conclusion. My answer is that it does not work.

My guess is that it is dependent of some functionality in the host application (The HPL engine), and without that functionality added, we cannot use it. Since we don't have the source, we can't verify or change that.

The import keyword itself most likely allows the script file to compile successfully because it is supported by the language, but isn't able to actually read other files as the functionality would have you think, therefore it fails to load the requested function. You will notice that if you try to call a function that is "imported" with this keyword, you don't get an error, but the script execution halts for the running function, as is the expected behaviour when getting a runtime error like this.

Thank you so much for the quick answer, it is a shame tho :/
08-03-2019, 08:07 PM
Find Reply




Users browsing this thread: 1 Guest(s)