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
Key Script?
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#1
Key Script?

So I'm trying to make it so a key in the room I'm creating can open the door of a desk, but I don't believe I can do that without scripting (at least I haven't found it out yet at least), and my scripting expertise is non-existent... Is there anyone who is willing to take a little time out of their day/night to create/help me create a script that codes a specific key to unlock said door? Oh, and one more thing, I couldn't seem to find out where to rename the key, is that also done in scripting?

While I'm at it, can someone help me create a script that activates a grunt when I pick up the lantern in the room? Thanks if you decide to help me!

It would be nice to learn how to script myself, is there any good place for tutorials on that kind of thing, like for Amnesia? Thanks again... Blush

Check out my custom stories(1)(2)!
09-15-2010, 06:37 AM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#2
RE: Key Script?

I think you should begin with something really simple, like this:
http://hpl2.frictionalgames.com/tutorial...tutorial_1
09-15-2010, 06:56 AM
Website Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#3
RE: Key Script?

(09-15-2010, 06:56 AM)jens Wrote: I think you should begin with something really simple, like this:
http://hpl2.frictionalgames.com/tutorial...tutorial_1
Thanks for your reply, I'll check it out!
Is there anywhere I can go to learn just what all the symbols and functions in scripting mean and how to compile them into fully functional scripts?

Check out my custom stories(1)(2)!
(This post was last modified: 09-15-2010, 07:33 AM by theDARKW0LF.)
09-15-2010, 06:59 AM
Find
grahfcard Offline
Junior Member

Posts: 12
Threads: 1
Joined: Sep 2010
Reputation: 0
#4
RE: Key Script?

I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?
09-15-2010, 01:46 PM
Find
DrMelon Offline
Junior Member

Posts: 3
Threads: 1
Joined: Sep 2010
Reputation: 0
#5
RE: Key Script?

(09-15-2010, 01:46 PM)grahfcard Wrote: I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?

It's a scripting language all of its own. The best place to start learning is by using the wiki and opening up scripts for the levels that already exist - they're commented properly.
Also, a list of all functions is available here:
http://hpl2.frictionalgames.com/amnesia:..._functions
09-15-2010, 01:49 PM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#6
RE: Key Script?

It's this language, http://www.angelcode.com/angelscript/

And the only official documentation I know of regarding the script part is this:
http://www.angelcode.com/angelscript/sdk...index.html
09-15-2010, 01:57 PM
Website Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#7
RE: Key Script?

I will try and make a simple map with some basic scripts and upload to the wiki, but not sure when I will be able to do so.
09-15-2010, 01:58 PM
Website Find
thePyro13 Offline
Junior Member

Posts: 24
Threads: 0
Joined: Sep 2010
Reputation: 0
#8
RE: Key Script?

(09-15-2010, 01:49 PM)DrMelon Wrote:
(09-15-2010, 01:46 PM)grahfcard Wrote: I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?

It's a scripting language all of its own. The best place to start learning is by using the wiki and opening up scripts for the levels that already exist - they're commented properly.
Also, a list of all functions is available here:
http://hpl2.frictionalgames.com/amnesia:..._functions

Aren't they using AngelScript? You can look it up to find out what syntax you can use, loops, variables so on. You have to manipulate the game using the functions provided however.

Best place to start learning is with the script files that come with Amnesia. Just mess with the levels. Comment out all the encounters in storage. Change the encounter in the guest room to come when you pick up the crowbar. That kind of stuff.

EDIT: WOAH! Ninja jens Big Grin
09-15-2010, 01:59 PM
Find
sacroid Offline
Member

Posts: 88
Threads: 11
Joined: Apr 2010
Reputation: 0
#9
RE: Key Script?

(09-15-2010, 01:59 PM)thePyro13 Wrote:
(09-15-2010, 01:49 PM)DrMelon Wrote:
(09-15-2010, 01:46 PM)grahfcard Wrote: I'm also interested in more basic tutorials for this. What script language is it? Where's a good place to start learning it?

It's a scripting language all of its own. The best place to start learning is by using the wiki and opening up scripts for the levels that already exist - they're commented properly.
Also, a list of all functions is available here:
http://hpl2.frictionalgames.com/amnesia:..._functions

Aren't they using AngelScript? You can look it up to find out what syntax you can use, loops, variables so on. You have to manipulate the game using the functions provided however.

Best place to start learning is with the script files that come with Amnesia. Just mess with the levels. Comment out all the encounters in storage. Change the encounter in the guest room to come when you pick up the crowbar. That kind of stuff.

EDIT: WOAH! Ninja jens Big Grin

I've been messing arround with the original game's scripts, but I still can't understand many things! :S I'm trying to make a monster dissapear after certain time, (despawn), but I have NO clue!

09-15-2010, 02:04 PM
Find
Jordo76 Offline
Member

Posts: 57
Threads: 7
Joined: Sep 2010
Reputation: 0
#10
RE: Key Script?

Door are Simple,All you need is a Door (Of course),a key (Big Grin) and a .hps

To open a door with a key,it's simple,name the door first,we'll name it "door_1" and the key "key_1"
Set the Door to Locked
Go to the hps file,open it and type :
void UseKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

RemoveItem(asItem);
}


void OnStart()
{

AddUseItemCallback("useexit", "key_1", "door_1", "UseKey",true);

}

And you're all set !
You can add everything in void Onstart() for example :
GiveItemFromFile("lantern", "lantern.ent");
For giving a lantern to the players,etc...
Yes i used the script of the 30 min editor map,
I hope you will do a great map !

PS : If my english is bad it's because i'm french ^^
09-15-2010, 02:31 PM
Website Find




Users browsing this thread: 2 Guest(s)