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
Adv Scripting Questions
Endlvl Offline
Junior Member

Posts: 28
Threads: 4
Joined: Aug 2011
Reputation: 0
#1
Adv Scripting Questions

Couple of Questions:

Does HPL2 have a onkeypress() function?

Can you use a method or function to receive player camera head position (not changing it just reading it)?

Does anyone know any other functions that are from AngelScript that were used to create the game but are not mentioned on the wiki? Stuff such as keypress, changing the position of the camera, etc. If these things are not supported by the engine is their any work around such as making a full conversion or accessing other base files?
(This post was last modified: 08-03-2011, 12:12 AM by Endlvl.)
08-02-2011, 10:09 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: Adv Scripting Questions

Welcome to the Frictional Games forums! Big Grin

The HPL2 engine does not have a command function called "OnKeyPress()" built into the game. Can you please describe what you want this function to do because you can create your own functions by simply scripting it. Smile

You can change the position of the camera, but I'm not sure if there's a way you can record the position of it.

Here's the script functions page incase you didn't already check them out: http://wiki.frictionalgames.com/hpl2/amn..._functions

There's a way to edit some of the game files with a full conversion. There is a page on the wiki about it, and there is also some videos on youtube on how to make it. Wiki page: http://wiki.frictionalgames.com/hpl2/amnesia/full_conv

08-02-2011, 10:19 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#3
RE: Adv Scripting Questions

Quote:Does HPL2 have a onkeypress() function?
No, but you can detect all the movement functions & the lantern apart if the player doesn't move at all with a work-around.

Quote:Can you use a method or function to receive player camera head position (not changing it just reading it)?
You can get the position of the head relative to the player simply by the fact that you can just store what you set it to in a variable - it doesn't change on it's own. Getting the position of the player is much more difficult, and impractical to do at any precise level - this feature wasn't deemed necessary (sadly) as the levels are designed around triggers.

Quote:Does anyone know any other functions that are from AngelScript that were used to create the game but are not mentioned on the wiki?
AddKeyPart(int x); //This was to do with the ending code in Justine
MovePlayerForward(float afAmount); //Must be called every 1/60 seconds, from justine
SetPlayerPermaDeathSound(string asFile); //Self explanatory, again from justine
You can also use classes and all the stuff (that doesn't use extensions) in the angelscript documentation - but the states of the classes and global vars are not saved. You can detect loading using this, though.

Quote: Stuff such as keypress, changing the position of the camera, etc. If these things are not supported by the engine is their any work around such as making a full conversion or accessing other base files?
Work-arounds depend entirely on what you are trying to achieve, a full conversion will let you change the language files and config files, but not expose any extra scripting functionality. The scripting language is very focused on setting up levels and puzzles by registering callbacks, and not building new games out of, which isn't to say it can't be done.
(This post was last modified: 08-02-2011, 11:35 PM by Apjjm.)
08-02-2011, 11:07 PM
Find
Endlvl Offline
Junior Member

Posts: 28
Threads: 4
Joined: Aug 2011
Reputation: 0
#4
RE: Adv Scripting Questions

thanks ,OnKeyPress does exactly what it sounds like, when a specified key is pressed it preforms an action, something similar is used in a lot of different languages, and ty once again but i already know the functions page.

Also do u know how to change the position of an object? Like its coordinates in game
AHHHH thank you for that Apjjm

Storing the head rotation as a variable is probably the best solution for my problem, also do u know the extension to change the position?

Also since the game was written in AngelScript (right?) they would have defined a 3d environment (something of this nature?) and had specific ways to interact with the environment that later would create the functions that we use know in hps. Is their any way of accessing those functions?
(This post was last modified: 08-02-2011, 11:20 PM by Endlvl.)
08-02-2011, 11:08 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#5
RE: Adv Scripting Questions

The game uses angelscript for level scripting only, stuff like game world & rendering etc are all handled by the game engine itself which we can't change. Certain things are exposed to the level scripts - they are covered by the angel-script documentation and the wiki. HPL3 - the new engine looks to expose loads more and fully utilise angel-script, the features of this are discussed in the FG blog.

Quote:Storing the head rotation as a variable is probably the best solution for my problem, also do u know the extension to change the position
To be honest, i've never really played about with the SetPlayerHeadPos function too much, so I don't know if you can configure it to look in any direction or whether it's locked towards the player's body (unless you use the SetPlayerLookAt stuff), and this will of-course effect the x/y/z coords of the camera depending on which is the case. You will just have to play about with this, though it is possible to roughly track the player's position, but it is an ugly method.
(This post was last modified: 08-02-2011, 11:49 PM by Apjjm.)
08-02-2011, 11:47 PM
Find
Endlvl Offline
Junior Member

Posts: 28
Threads: 4
Joined: Aug 2011
Reputation: 0
#6
RE: Adv Scripting Questions

KK ill check out the blog thanks for the help and info =D
08-03-2011, 12:12 AM
Find




Users browsing this thread: 2 Guest(s)